Single-chip microcomputer intelligent adjustment control method and system based on linkage of environmental parameters

By constructing a knowledge graph of the relationship between device mutual exclusion and environmental influence on a microcontroller platform, and collecting environmental status in real time and making sequential decisions, the problems of device mutual exclusion conflict and power load peak smoothing are solved, thus achieving stable environmental comfort and safe power use.

CN122632783APending Publication Date: 2026-08-25CHANGCHUN VOCATIONAL INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610915988.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-24
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing technologies on single-chip microcomputer platforms struggle to effectively address integrated control issues such as device mutual exclusion conflicts, smoothing peak power loads in residential homes, and maintaining multi-dimensional environmental comfort, leading to frequent device switching, increased energy consumption, and fluctuations in environmental parameters.

Method used

By constructing a knowledge graph of equipment mutual exclusion information and environmental impact information, the system collects environmental status in real time, generates operational urgency and predicts environmental parameters, and uses equipment mutual exclusion constraints and the upper limit of the incoming power capacity to make sequential decisions, generating equipment operation sequences and realizing closed-loop linkage control of equipment mutual exclusion constraints, power load smoothing and environmental comfort.

Benefits of technology

With extremely low computational overhead, it achieves the resolution of device mutual exclusion conflicts, smoothing of peak power loads in households, and proactive maintenance of multi-dimensional environmental comfort, ensuring the stability of household electricity safety and environmental comfort.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122632783A_ABST
    Figure CN122632783A_ABST
Patent Text Reader

Abstract

The application relates to a single-chip intelligent adjustment control method and system based on linkage of environmental parameters. The method realizes real-time calculation of an environmental deviation vector through a lightweight atlas of a preset device mutual exclusion relationship and an environmental influence relationship of a single-chip microcomputer, and obtains a device operation urgency through weighted accumulation after influence direction matching, thereby estimating a required operation time length and expected power to form a unified request. Then, future environmental states are deduced in a prediction time domain by using the influence relationship, hard boundaries are formed by using mutual exclusion constraints and an upper limit of household power, and a sequential decision is made on all requests to generate an execution sequence and implement control, so that real-time resolution of device mutual exclusion conflicts, peak shaving and valley filling of household power loads and prospective linkage maintenance of indoor comfort are realized under extremely low computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of embedded control systems for smart homes, and in particular relates to a single-chip microcomputer intelligent adjustment and control method and system based on environmental parameter linkage. Background Technology

[0002] In the field of smart home environmental control, local controllers based on microcontrollers are widely used due to their low cost and convenient deployment. However, there is an objective limit to the capacity of the household power distribution system. If multiple high-power environmental control devices, such as air conditioners, humidifiers, dehumidifiers, fresh air systems, and electric heaters, are operated simultaneously, it can easily cause power load spikes, and in severe cases, trigger circuit breaker tripping, threatening household electrical safety. Furthermore, these devices have mutually exclusive physical functions: for example, the air conditioner's cooling process involves forced dehumidification, and its simultaneous operation with a humidifier will result in functional cancellation and energy waste; the simultaneous operation of a dehumidifier and a humidifier is a direct physical conflict. If these mutually exclusive relationships are not explicitly managed and coordinated, it will not only lead to unnecessary frequent switching of devices and increased energy consumption, but also cause continuous fluctuations in multi-dimensional environmental parameters such as indoor temperature, humidity, and carbon dioxide concentration, affecting the comfort of residents.

[0003] Currently, there are three main types of methods for solving the coordinated control of multiple devices. One type is centralized optimization scheduling methods, such as multi-objective optimization based on genetic algorithms, reinforcement learning, or model predictive control. Theoretically, these methods can obtain high-quality running sequences, but their solution process involves a large number of iterations or matrix operations, placing high demands on processor computing power and memory, making them difficult to run in real-time on consumer microcontrollers such as the Cortex-M series. Another type is the independent threshold control strategy commonly used in engineering, where each device starts and stops independently based on its own associated single environmental parameter threshold. This strategy is computationally simple, but it completely ignores the mutual exclusion effects between devices, often leading to multiple devices operating at high power simultaneously in pointless functional competition, failing to suppress peak power consumption or guarantee stable environmental comfort. Another type is the scheduling method based on fixed priority, which determines the start-up and shutdown order by preset device priority. However, its priority is not related to the dynamic evolution of environmental parameters, nor is the physical mutual exclusion relationship between devices explicitly modeled. When multiple parameters deviate from the comfort zone at the same time, low-priority devices may be shelved for a long time, causing a serious deterioration of comfort in certain dimensions, and it is impossible to make forward-looking adjustments based on real-time environmental change trends.

[0004] Therefore, existing technologies have not yet effectively solved the integrated control challenge of simultaneously resolving device mutual exclusion conflicts, smoothing peak power loads in the home, and proactively maintaining multi-dimensional environmental comfort on the highly constrained microcontroller platform with extremely low computational overhead. Thus, there is an urgent need for a low-complexity intelligent control method based on environmental parameter linkage analysis, capable of explicitly utilizing device mutual exclusion relationships while balancing load smoothing and comfort maintenance, to meet the deployment requirements of practical smart home systems. Summary of the Invention

[0005] Therefore, it is necessary to provide a single-chip microcomputer intelligent adjustment and control method and system based on environmental parameter linkage to address the above-mentioned technical problems.

[0006] Firstly, this application provides a single-chip microcomputer intelligent adjustment and control method based on environmental parameter linkage, including:

[0007] S1. According to the preset scheduling cycle, the microcontroller collects sensor data from various environmental sensors to obtain an environmental state vector; based on the deviation between the environmental state vector and the preset comfort target value, a deviation vector is constructed; wherein, the microcontroller's non-volatile memory pre-stores device mutual exclusion relationship information and the influence relationship information of the controlled devices on environmental parameters. The device mutual exclusion relationship information indicates whether any two controlled devices will cause physical functional conflicts when running simultaneously, and the influence relationship information indicates the amount and direction of change of each controlled device on each dimension of environmental parameters per unit time during operation.

[0008] S2. For each controlled device, the quantities in the deviation vector that have the same direction of change as the influence relationship information corresponding to the controlled device are weighted and accumulated to obtain the operational urgency.

[0009] S3. For controlled equipment with an operational urgency greater than a preset threshold, estimate the runtime required to eliminate the deviation value based on the ratio of the deviation value of the parameter associated with the controlled equipment in the deviation vector to the corresponding change in the influence relationship information, and generate an operation request carrying the runtime and expected operating power based on the deviation value to determine the expected operating power of the controlled equipment.

[0010] S4. Within the current scheduling cycle, construct a prediction time domain of a preset length; within the prediction time domain, utilize the influence relationship information to predict the evolution of environmental parameters under the start-up and shutdown of different controlled devices in each time slot, and obtain the predicted environmental parameters.

[0011] S5. Based on predicted environmental parameters, using equipment mutual exclusion information as mutual exclusion constraints, using the preset upper limit of the household power capacity as power constraints, and taking the reduction of total power peak and the reduction of comfort loss as joint objectives, sequential decision-making is performed on all operation requests to obtain the equipment operation sequence; where reducing the total power peak refers to reducing the maximum value of the total power of the selected equipment operation sequence in each time slot within the prediction time domain, and reducing comfort loss refers to reducing the cumulative penalty amount caused by the start-up and shutdown sequence arrangement of controlled equipment that causes environmental parameters to deviate from the preset comfort target value;

[0012] S6. Based on the equipment operation sequence, at the beginning of the corresponding time slot, the microcontroller controls each controlled device to perform start-stop and power adjustment actions.

[0013] Secondly, this application also provides a single-chip microcomputer intelligent adjustment and control system based on environmental parameter linkage, used to implement the method described in the first aspect, the system comprising:

[0014] The environmental perception and deviation calculation module is used to collect sensor data from various environmental sensors through a microcontroller according to a preset scheduling cycle to obtain an environmental state vector; based on the deviation between the environmental state vector and the preset comfort target value, a deviation vector is constructed; wherein, the microcontroller's non-volatile memory pre-stores device mutual exclusion relationship information and the influence relationship information of controlled devices on environmental parameters. The device mutual exclusion relationship information indicates whether any two controlled devices will cause physical functional conflicts when running simultaneously, and the influence relationship information indicates the amount and direction of change of each controlled device on each dimension of environmental parameters per unit time during operation.

[0015] The equipment urgency assessment module is used to weight and accumulate the quantities in the deviation vector that are consistent with the direction of change in the influence relationship information corresponding to the controlled equipment for each controlled equipment, so as to obtain the operational urgency.

[0016] The operation requirement generation module is used to estimate the runtime required to eliminate the deviation value for controlled equipment with an operation urgency greater than a preset threshold, based on the ratio of the deviation value of the parameter associated with the controlled equipment in the deviation vector to the corresponding change in the influence relationship information, and to generate an operation request carrying the runtime and expected operating power based on the deviation value to determine the expected operating power of the controlled equipment.

[0017] The multi-constraint environment prediction module is used to construct a prediction time domain of a preset length within the current scheduling cycle; within the prediction time domain, it uses the influence relationship information to predict the evolution of environmental parameters under the start-up and shutdown of different controlled devices in a time slot, and obtains the predicted environmental parameters.

[0018] The dual-objective optimization scheduling module is used to make sequential decisions on all operation requests based on predicted environmental parameters, using equipment mutual exclusion information as mutual exclusion constraints, a preset upper limit of the incoming power capacity as a power constraint, and reducing the total power peak and reducing comfort loss as joint objectives, to obtain the equipment operation sequence. Among them, reducing the total power peak refers to reducing the maximum value of the total power of the selected equipment operation sequence in each time slot within the prediction time domain, and reducing comfort loss refers to reducing the cumulative penalty amount caused by the start-up and shutdown sequence arrangement of controlled equipment that deviates from the preset comfort target value.

[0019] The equipment execution control module is used to control each controlled device to perform start-stop and power adjustment actions through a microcontroller at the beginning of the corresponding time slot according to the equipment operation sequence.

[0020] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a single-chip microcomputer intelligent adjustment and control method based on environmental parameter linkage as described in the first aspect.

[0021] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a single-chip microcomputer intelligent adjustment and control method based on environmental parameter linkage as described in the first aspect.

[0022] The aforementioned microcontroller-based intelligent adjustment and control method and system based on environmental parameter linkage forms a lightweight equipment interaction knowledge graph by pre-setting equipment mutual exclusion relationship information and environmental impact relationship information. Based on this, it collects environmental status in real time and compares it with comfort target values ​​to construct a deviation vector. It uses the change direction information in the environmental impact relationship information to perform directional matching and weighted accumulation of the deviation, generating an operational urgency reflecting the marginal benefit of equipment adjustment. Then, it estimates the runtime and expected operating power required to eliminate the deviation and encapsulates them into a unified operating request. In the prediction time domain, it uses the environmental impact relationship information to deduce the evolution of environmental parameters under different equipment start-stop combinations time-slot by time slot to obtain predicted environmental parameters. Finally, it uses the mutual exclusion relationship information to... Using the legality criterion, the upper limit of the power supply to the household as the total power boundary, and reducing the peak total power in the time domain and the cumulative penalty for environmental parameters deviating from the comfort target value as the joint optimization objectives, the system performs sequential decision-making to generate the equipment operation sequence for all operation requests. Finally, it outputs start / stop and power adjustment commands to each controlled device according to the sequence. Thus, under the extremely limited storage and computing resources of the microcontroller, it realizes a closed-loop linkage control that integrates three mutually coupled control objectives: equipment mutual exclusion constraints, power load peak smoothing, and forward-looking maintenance of environmental comfort. With extremely low computational overhead, it simultaneously achieves the effects of eliminating physical functional conflicts between devices, smoothing the power load curve to the household, and ensuring the overall comfort of the indoor environment. Attached Figure Description

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

[0024] Figure 1 A flowchart illustrating a single-chip microcomputer intelligent adjustment and control method based on environmental parameter linkage provided by the present invention;

[0025] Figure 2 This is a schematic diagram illustrating the process of sequentially deciding on all running requests to obtain a device running sequence in one optional embodiment of the present invention.

[0026] Figure 3 This invention provides a schematic diagram of a single-chip microcomputer-based intelligent adjustment and control system based on environmental parameter linkage. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0028] The application environment of this invention is a typical home smart home local control system (hereinafter referred to as "the system"). The core control terminal of the system is an embedded microcontroller controller deployed inside the home distribution box or the smart home low-voltage box. This controller uses a microcontroller chip based on the ARM Cortex-M series core as the main control unit, which integrates Flash program memory, SRAM data memory, a multi-channel successive approximation analog-to-digital converter, a general-purpose input / output interface, and several standard serial communication peripherals. Temperature sensors, humidity sensors, carbon dioxide concentration sensors, and particulate matter concentration sensors are respectively connected via... A bus or single bus connects to the corresponding serial interface of the microcontroller, continuously or polling-basedly providing environmental sensing data from various indoor monitoring points to the controller according to their respective data output rates. At the controlled execution end, variable frequency air conditioners, fixed frequency dehumidifiers, ultrasonic humidifiers, fresh air exchangers, and electric heaters connect to the output interface of the microcontroller through their respective smart sockets, infrared remote control relay modules, or RS-485 bus driver nodes, receiving start / stop commands and power adjustment commands from the microcontroller. The main power distribution circuit into the house converts the total incoming current signal into a voltage signal via an open-type current transformer and signal conditioning circuit, then connects to a backup channel of the analog-to-digital converter of the microcontroller, thereby feeding back the real-time measurement value of the total incoming power to the microcontroller as an auxiliary reference signal. However, the upper limit of the incoming power capacity used in the scheduling algorithm of this invention is itself fixed in the controller's Flash program memory as a preset constant. Redundancy judgment is only performed in conjunction with real-time measurement values ​​when extreme safety checks are required; during normal operation, the pre-stored constant upper limit value is used directly. The microcontroller controller executes the method of the present invention cyclically with a preset fixed scheduling cycle. The duration of the scheduling cycle can be selected as a fixed value between tens of seconds and several minutes. At the beginning of each cycle, all sensor data are collected, all calculations and decisions are completed within the cycle, and control commands are uniformly output to each execution device before the end of the cycle or at the beginning boundary of each time slot, forming a complete closed loop of perception-decision-execution.

[0029] Example 1:

[0030] refer to Figure 1 The document presents a flowchart illustrating a single-chip microcomputer-based intelligent adjustment and control method based on environmental parameter linkage, as provided in this application. The method includes the following steps:

[0031] S1. According to the preset scheduling cycle, the microcontroller collects sensor data from various environmental sensors to obtain an environmental state vector; based on the deviation between the environmental state vector and the preset comfort target value, a deviation vector is constructed; wherein, the microcontroller's non-volatile memory pre-stores device mutual exclusion relationship information and the influence relationship information of the controlled devices on environmental parameters. The device mutual exclusion relationship information indicates whether any two controlled devices will cause physical functional conflicts when running simultaneously, and the influence relationship information indicates the amount and direction of change of each controlled device on each dimension of environmental parameters per unit time during operation.

[0032] Specifically, during the system initialization phase, device mutual exclusion information is... The symmetric matrix is ​​burned into the Flash memory of the microcontroller controller, wherein... This represents the total number of controlled environment control devices included in unified management. The device mutual exclusion matrix is ​​denoted as... Matrix elements Defined as: if the first Taiwan controlled equipment and the first When multiple controlled devices operate simultaneously, physical functional conflicts can occur, significantly weakening their respective regulatory effects or creating antagonistic effects. If both can run simultaneously without affecting each other, then .matrix diagonal elements A value of 0 indicates that the device itself is not mutually exclusive. Typical mutual exclusion relationships include: mutual exclusion between an air conditioner and a humidifier operating in cooling mode due to the canceling out of the functions of the air conditioner's condensation dehumidification and the humidifier's spray humidification; direct functional conflict between a dehumidifier and a humidifier due to their separate dehumidification and humidification functions; energy consumption between a cooling air conditioner and an electric heater due to the simultaneous cooling and heating of indoor air; and conditional mutual exclusion between a fresh air system introducing high-temperature, high-humidity outdoor air and the air conditioner's dehumidification function. This conditional mutual exclusion can be preset as a mutual exclusion bit in the basic static matrix and dynamically softened through subsequent online learning. The above mutual exclusion relationships are written into Flash memory after experimental calibration. To save storage space, since the number of devices in a home setting is usually no more than ten, the matrix... Bitmap storage can be used for compression, with each element occupying only one bit, and the storage overhead of the entire matrix can be controlled within a few bytes.

[0033] Simultaneously, a matrix of information on the influence of devices on environmental parameters is pre-stored in Flash, denoted as... Its dimensions are ,in This represents the number of dimensions of the environmental parameters of interest. In this embodiment, The values ​​are taken from four environmental parameters: air temperature, relative humidity, carbon dioxide concentration, and inhalable particulate matter concentration. Matrix The rows correspond to the various controlled devices, the columns correspond to the aforementioned environmental parameter dimensions, and the matrix elements... Indicates the first The controlled equipment operates at its rated power for a given period of time. The amount of change caused by environmental parameters, and The symbols indicate that a positive value will increase the parameter value due to the operation of the equipment, while a negative value will decrease the parameter value due to the operation of the equipment. For example, for an inverter air conditioner, at its rated cooling capacity, its temperature response... A negative value indicates the rate of temperature decrease per unit time; for humidity... Also a negative value, it represents the absolute humidity decrease per unit time due to the dehumidification effect. For an ultrasonic humidifier, its effect on humidity... A positive value indicates the amount of humidification per unit time; relative to temperature. It may be a tiny negative value, indicating a weak cooling effect caused by the heat absorption during atomization. For a fresh air exchanger, its effect on carbon dioxide concentration... A negative value indicates the dilution effect of introducing fresh outdoor air on indoor carbon dioxide; however, its influence on temperature and humidity depends on the indoor-outdoor temperature and humidity differences. It can be preset in the basic matrix according to typical seasonal operating conditions and gradually approximates the true value through online correction during actual operation. The elements of the influencing relationship information originate from the step response change curves of environmental parameters recorded by independently operating each device and utilizing each sensor during the manufacturing or installation and commissioning phases. The linear segments of the change curves are calibrated using least-squares regression, and the resulting regression coefficients are rounded or fixed-pointed and then stored in Flash memory. In addition, preset comfort target value vectors for each dimension of environmental parameters are also included. Weighting coefficients for each dimension of deviation Change rate weighting coefficient Maximum power capacity for residential use Rated operating power of each device Minimum operating power of each device and maximum operating power Scheduling cycle duration Predicted time domain length and startup threshold These parameters are also stored in Flash as constants; among them, This indicates the transpose operation.

[0034] After entering the online operation phase, at the beginning of each scheduling cycle, the microcontroller controller samples the analog outputs of the temperature and humidity sensors through its on-chip analog-to-digital converter, and converts the sampling results into digital values ​​through analog-to-digital conversion; simultaneously, it... The bus sequentially sends read commands to the carbon dioxide sensor and particulate matter concentration sensor to acquire digital outputs. This yields four-dimensional raw sensor readings. A sliding median filter with a window length of five is then applied to each of these four sets of raw data to remove pulse noise spikes introduced by electromagnetic interference or instantaneous airflow disturbances. The sliding median filter operates as follows: a first-in, first-out buffer containing the five most recent sampled values ​​is maintained for each parameter. Each time a new sampled value arrives, the oldest value in the buffer is discarded and the new value is pushed in. Then, the five values ​​in the buffer are sorted, and the median is used as the filtered output. After median filtering, a first-order low-pass digital filter is applied to the output sequence to further smooth high-frequency measurement jitter. The difference equation for the first-order low-pass filter is: ,in This is the median filter result of the current input. This is the current low-pass filter output. This is the output value of the previous filter. These are the filter coefficients, and their values ​​range from 0 to 1. A smaller value results in a stronger smoothing effect but also a slower response. After the above two-stage filtering process, the current time is finally obtained. Environment state vector ,in This indicates the temperature of the air after filtering. This represents the relative humidity after filtering. This indicates the carbon dioxide concentration after filtering. This indicates the concentration of inhalable particulate matter after filtering.

[0035] Next, the microcontroller reads the preset comfort target value vector from the Flash memory. The environmental state vector With the comfort target value vector Perform subtraction operations dimension by dimension to obtain the current time. deviation vector Specifically, for the first The formula for calculating the deviation value of the environmental parameters is as follows: .when When the value is positive, it indicates that the current parameter value is lower than the comfort target value, and the controlled equipment needs to apply positive adjustment to the parameter to increase it; when... When the value is negative, it indicates that the current parameter value has exceeded the comfort target value, and the controlled equipment needs to apply negative adjustment to the parameter to reduce it; when When the absolute value is very small, it indicates that the current parameter is close to the comfort target and no significant adjustment is needed. The construction of the deviation vector provides quantitative requirements for each dimension of the subsequent urgency assessment.

[0036] S2. For each controlled device, the quantities in the deviation vector that have the same direction of change as the influence relationship information corresponding to the controlled device are weighted and accumulated to obtain the operational urgency.

[0037] Specifically, in this embodiment, to ensure extremely low computational overhead to adapt to the limited computing power of the microcontroller, the calculation of urgency does not involve differential operations or environmental parameter change rate terms; it only performs single-step weighted accumulation based on the consistency of the changing direction in the current deviation vector and the influence relationship information. For each controlled device... urgency of operation The calculation process is as follows: First, initialize the device. The operational urgency is 0, that is... Then from the influence relationship information matrix Take out the device by row corresponding row vector Then iterate through all of them. Dimensional environmental parameters For the first Dimension, from the deviation vector Obtain the deviation value of this dimension. At the same time from the row vector Obtain equipment from China Change in this dimension parameter . judge positive and negative signs and Are the positive and negative signs the same? If they are the same, it means the device... The operation of the first As environmental parameters change towards the target comfort value, meaning the equipment's adjustment direction aligns with the need to correct current environmental deviations, this factor positively contributes to the urgency level. The contribution value is calculated as follows: And accumulate this contribution value to Above. If the two signs are different, it means the device... The operation will cause this dimension of environmental parameters to deviate further from the comfort target value, and this item does not contribute to urgency; if If it is exactly zero, it also makes no contribution. Among them, For the first The weighting coefficients for the environmental parameter deviations are preset in Flash. The sum of the weighting coefficients for the four dimensions is 1. Their relative magnitudes reflect the relative importance of each environmental parameter to human comfort. For example, the weights of temperature and humidity are usually higher than those of carbon dioxide and particulate matter concentration. The above calculation process only requires a few multiplications, absolute values, and comparisons. The computational load for each device is constant and minimal, and no floating-point arithmetic unit is required.

[0038] The physical significance of this simplified urgency calculation lies in the fact that it measures the urgency of equipment activation solely by multiplying the absolute amount of the current deviation by the equipment's adjustment capability. Furthermore, it ensures through sign consistency that only equipment effective in improving the current comfort deviation receives positive urgency. This calculation method is equivalent to measuring the directional matching degree between the equipment's influence vector and the deviation vector in vector space, providing clear geometric intuition. Although this method does not utilize the future trend information implied by the rate of change of environmental parameters and cannot proactively respond to deteriorating trends that are not yet fully reflected in the deviation, it is sufficient to rationally prioritize needs based on each device's marginal correction capability to the current environmental deviation, providing an effective priority basis for subsequent scheduling.

[0039] S3. For controlled devices whose urgency exceeds a preset threshold, estimate the runtime required to eliminate the deviation value based on the ratio of the deviation value of the parameter associated with the controlled device in the deviation vector to the corresponding change in the influence relationship information, and generate a runtime request carrying the runtime and expected runtime based on the deviation value to determine the expected operating power of the controlled device.

[0040] Specifically, after calculating the operational urgency of all controlled equipment, the urgency of each piece of equipment will be... Each is compared with the preset startup threshold stored in Flash. Compare them one by one. If a certain device... of If so, it is considered that the equipment currently has a relatively urgent adjustment need and should be subject to an operation request for its production cost scheduling cycle; if If the current environmental deviation associated with the device has not yet reached a level that warrants activation, no request will be generated, and the device will maintain its original operating state during this cycle.

[0041] For each device that passes the threshold screening, the primary associated environmental parameter dimension most closely related to that device is determined. The principle for dividing the primary associated parameter dimension is as follows: air temperature for air conditioners and electric heaters, relative humidity for humidifiers and dehumidifiers, carbon dioxide concentration for fresh air systems, and inhalable particulate matter concentration for air purifiers. This division is determined based on the device's primary design function and is stored in Flash as a lookup table of device type codes and primary associated parameter indices for program lookup. After determining the primary associated parameters, the deviation vector is used... Extract the deviation value corresponding to the main correlation parameter from the data, and denot it as... And from the influence relationship information matrix Remove the device from the middle The change in this primary correlation parameter is denoted as... To ensure that the estimated runtime is positive and physically plausible, the absolute value of the deviation is divided by the absolute value of the change; the quotient is the theoretically required continuous runtime to eliminate the deviation. The calculation formula is: Since both the numerator and denominator take absolute values, This value must be non-negative, representing the estimated runtime required to adjust the primary associated environmental parameter from its current value to the target comfort value. The runtime... Expressed in actual time units, such as seconds or minutes, it will be converted into the number of time slots as needed in subsequent scheduling.

[0042] In this embodiment, the desired operating power is determined in the most direct and simplified way: instead of adjusting the power proportionally based on the magnitude of the deviation, the rated operating power of each controlled device is used directly. The desired operating power is used as the reference. While this simplified method fails to utilize the equipment's frequency conversion capability for refined energy consumption control, it avoids the additional multiplication, division, and limiting calculations required for power factor calculation, further reducing the computational burden. The rated operating power is used as the reference. During the initialization phase, the device information is stored in the Flash memory. For fixed-frequency devices, this is the unique operating power, while for variable-frequency devices, it is the typical economic operating power.

[0043] Include device identification and the aforementioned operational urgency. The request runtime And the desired operating power (in this embodiment, the rated operating power) This is encapsulated into a run request data structure. This data structure can be represented as a simple structure in the microcontroller's memory, containing a device ID byte, an integer variable representing urgency, an integer or fixed-point variable representing the runtime, and a variable representing the desired power value. All devices that meet the threshold conditions generate their respective run requests in the above manner, ultimately forming the run request set for this cycle.

[0044] S4. Within the current scheduling cycle, construct a prediction time domain of a preset length; within the prediction time domain, utilize the influence relationship information to predict the evolution of environmental parameters under the start-up and shutdown of different controlled devices in each time slot, and obtain the predicted environmental parameters.

[0045] Specifically, set the prediction time domain length. This is a preset positive integer, selected during initialization based on the available SRAM capacity of the microcontroller and the control response speed requirements. It represents the prediction from the current time slot towards the future. The scheduling cycle consists of several consecutive time slots, the duration of which is the length of each time slot. A two-dimensional array is allocated in the microcontroller's memory to store the predicted environment parameters; this array is denoted as... ,in This is a time slot index, with values ​​ranging from integers. Each row of this array represents a predicted vector of environmental parameters at the end of a time slot, containing... Each element, namely The memory space occupied by this array is If each data unit is stored as a 16-bit integer variable, the total memory overhead can be controlled within a few hundred bytes under typical parameter selection, which fully meets the SRAM limit of the microcontroller.

[0046] Set the initial value of the predicted sequence to the current time step. The environmental state vector obtained by acquisition and filtering, i.e. Subsequently, without considering newly generated runtime requests in this cycle, only the set of devices that were already started and had remaining runtime from the previous scheduling cycle are carried over to the current time slot and thereafter. As a known, definitively operating device, the future environmental state is calculated recursively, slot by slot. The recursive process is as follows: for each slot... from arrive Processing sequentially, first determining the time slot. The internally determined set of devices to maintain operation Specifically, From set The remaining runtime covers the time slots. The equipment configuration. Then, based on the aforementioned influence relationship information matrix. Calculate time slots The total combined impact of all operating equipment on environmental parameters within the time slot. This total combined impact is equal to the impact vector of each operating device within that time slot. Multiply by the duration of a single time slot Then, the vectors are added together for each unit. Finally, this total joint effect is superimposed on the predicted state at the end of the current time slot to obtain the predicted environmental state at the end of the next time slot. The entire recursive relationship is given by the following formula:

[0047]

[0048] in, For the first Environmental parameter prediction vector at the end of the time slot, For the first Environmental parameter prediction vector at the end of the time slot; In time slot The set of controlled devices that are currently in operation is identified within the system. For matrix Controlled equipment The corresponding row vector, its components Indicates equipment For the The change in environmental parameters per unit time; The duration of each time slot is the preset scheduling cycle duration; the summation symbol represents the summation of the sets. Multiply the influence vector of all devices in the middle Then vector addition is performed. The above recursive operation is executed once in each scheduling cycle, and its computational complexity depends on the length of the prediction time domain. And the number of currently operating devices, in a household where the total number of devices typically does not exceed ten. When the selected scenario is within tens, the entire prediction process involves only a few hundred addition operations and a very small number of multiplication operations, which can be completed within milliseconds, fully meeting the real-time requirements of the microcontroller.

[0049] Through the above time-slot-by-time recursion, the environmental parameter prediction sequence at the end of each time slot in the prediction time domain is finally obtained under the condition that no new running requests generated in this cycle are inserted. ,in This sequence is the predicted environmental parameter, which provides a basic reference for the future environmental evolution in subsequent sequential decision-making steps.

[0050] S5. Based on the predicted environmental parameters, using the mutual exclusion information of the equipment as mutual exclusion constraints, the preset upper limit of the power supply capacity as the power constraint, and the joint objective of reducing the total power peak and reducing the comfort loss, a sequential decision is made on all operating requests to obtain the equipment operating sequence. Among them, reducing the total power peak refers to reducing the maximum value of the total power of the selected equipment operating sequence in each time slot in the prediction time domain, and reducing the comfort loss refers to reducing the cumulative penalty amount caused by the start-up and shutdown sequence arrangement of the controlled equipment, which causes the environmental parameters to deviate from the preset comfort target value.

[0051] Specifically, firstly, an array is established in the microcontroller's memory corresponding to the predicted time domain length. Corresponding power usage array and device usage array The time slot index Power usage array Each element is recorded in this time slot. Total operating power of all devices already included; device occupancy array Each element is a list or bitmask of device numbers, recorded in that time slot. Specifically, which devices are currently running? During initialization, all time slots... The element is assigned the value 0. The elements are assigned to an empty set. Then, based on the device operation tasks determined in the previous scheduling cycle and required to continue into the current cycle, the two arrays are initially filled: traversing the sets... For each device in the dataset, the time slot interval it covers in the prediction time domain is determined based on the device's remaining runtime in the current time slot. Assume the device... The operation must continue from the current time slot. If there are 1 time slot, then the coverage area of ​​that time slot is 1 / 2 time slot. To the time slot For each time slot within this coverage area Perform the following operations: [Place device] Expected operating power (In this embodiment, the power is the rated power) Accumulate to ,Right now At the same time, the equipment The number is added to the device occupancy record for that time slot. Once this process is complete, the initial power occupancy array and the initial equipment occupancy array, reflecting the current known load distribution and equipment occupancy status, are obtained.

[0052] Collect all the runtime requests generated by S3, and categorize them according to the runtime urgency value carried in each request. The requests are sorted in descending order of urgency. If two requests have the same urgency, they are further sorted in descending order of the absolute value of the deviation of the device's main association parameter to ensure that the device with the larger deviation under the same urgency is scheduled first. After sorting, the queue of requests to be scheduled is formed.

[0053] Next, following the order of the queue of requests to be scheduled, one request is taken from the head of the queue one by one as the current processing request. For each current request, the device identifier, execution urgency, and request runtime are parsed. and expected operating power The runtime of the request. Converted to the required number of time slots The conversion method is as follows: Divide by scheduling cycle length If the result is not divisible, it is rounded up to positive infinity to obtain the initial number of time slots. Then, the initial number of time slots is combined with a preset maximum allowed number of time slots. Compare the two values ​​and take the smaller value as the final number of time slots. This is to prevent a single scheduling request from occupying too long a prediction time domain, thus preventing other requests from being scheduled. This operation can be expressed mathematically as follows: ,in This represents the function for rounding up.

[0054] Then, all possible candidate start time slots are determined within the prediction time domain. Candidate start time slots The value of must satisfy two basic conditions: one is The first is non-negative; the second is... This means that the requested operating range is completely contained within the prediction time domain and does not exceed the boundaries. From Start by incrementally increasing the number of candidate start slots that meet the above conditions.

[0055] For each candidate starting time slot during the traversal process For its corresponding continuous time slot interval Each time slot within Check whether the following two constraints are satisfied simultaneously. The first is the equipment mutual exclusion constraint: retrieve the time slot. The data is already recorded in the device occupancy array. All device numbers in the set, for each of the occupied devices Query the device mutual exclusion matrix stored in Flash. elements ,in This is the device ID corresponding to the current request. If any one exists... Make This indicates that the device currently requesting the request... With time slot Equipment already discharged There is a physical functional conflict, and the mutual exclusion constraint is not satisfied; this candidate start time slot... If deemed infeasible, the process stops checking that time slot and proceeds directly to the next candidate start time slot. If for that time slot... All occupied equipment All Then the mutual exclusion constraint is satisfied in that time slot. The second term is the incoming power capacity constraint, i.e., the power constraint: from the power occupancy array Extracting time slots The current power consumption value is compared with the expected operating power of the currently requesting device. The sums are used to obtain the expected total power for that time slot after the current request is received. It is then determined whether this expected total power is less than or equal to the preset upper limit of the household power supply capacity. .like If the condition is met, the power constraint is satisfied in that time slot; otherwise, it is not met, and the candidate starting time slot is also deemed infeasible. This applies only to each time slot within the time slot interval. If both the mutual exclusion constraint and the power constraint are satisfied simultaneously, then the candidate start time slot is... Only then was it finally determined to be a feasible time slot.

[0056] In this embodiment, the sequential decision-making process embodies the dual objectives of reducing total power peak and reducing comfort loss. Specifically, for all feasible time slots obtained after passing the above constraint checks, the earliest one is not simply selected, but rather each feasible time slot is... A simplified comprehensive cost is calculated, which is a weighted synthesis of the power peak cost and the comfort loss cost. The time slot with the minimum comprehensive cost is selected from the set of feasible time slots as the execution time slot, thus achieving the joint optimization of the two objectives.

[0057] For calculating the peak power cost: the simulation will take the current request at the expected operating power. Insert candidate start time slot The corresponding time slot interval The power values ​​of each time slot within the interval are simulated and superimposed on a temporary copy of the power occupancy array. Then, all power values ​​within the interval are traversed, and the maximum value is extracted as the power peak cost. This cost reflects the height of the power peak that would result in a local interval of the prediction time domain if this time slot were selected for execution; the higher the power peak, the greater the cost.

[0058] Regarding the calculation of the cost of comfort loss: Example 1 employs a simplified estimation method based on the current deviation and delay duration, eliminating the need to re-execute the full environmental prediction simulation. Specifically, for candidate start time slots... The delayed startup corresponding to this time slot will cause the device to delay from the current time slot to the startup time slot. During this period, the device cannot play a regulatory role, and environmental parameters affected by it may continuously deviate from the comfort target. A simplified formula for calculating the cost of comfort loss is as follows: ,in For the equipment The set of indexes of environmental parameters that have a significant impact. For the first Dimensional bias weighting coefficient The first of the current deviation vectors dimensional components, For the devices in the influence relationship information For the The amount of change in the dimensional parameter; For a sign function, when When, take 1, when When -1 is taken, Take 0 at the time; The index value for the candidate starting time slot reflects the number of time slots with delay. The physical meaning of this simplified formula is that comfort loss is proportional to the number of time slots with delay, and the loss is only considered when the deviation direction is consistent with the equipment adjustment direction. This simplified calculation avoids complex environmental prediction simulations, but its reasonable approximation is already able to effectively distinguish the cost differences of different delay durations in decision-making.

[0059] Peak power cost Cost of Loss of Comfort According to the preset weighting coefficients and Perform a weighted summation to obtain candidate time slots. The overall cost Iterate through all feasible time slots and select the one that minimizes the overall cost. The smallest time slot is used as the execution time slot. .

[0060] When the execution slot is selected Then, resource reservation and forecast update operations are performed on the current system state. For the interval... Each time slot within Perform the following update: update the power usage array The current value increases the expected operating power of the device. ,Right now ; put the equipment The number is appended to the device occupancy array. In the records. Subsequently, due to the insertion of new equipment changing the equipment operating set in some time slots, the environmental parameter prediction sequences previously calculated based on the old equipment set were affected. From time slot The current time slot is outdated and needs to be recalculated and updated. The specific update method is as follows: starting from the affected time slot... Begin by re-executing the recursive prediction formula described in S4, time-slot by time. ,in This already includes the newly inserted currently requesting device, and the calculation continues up to the time slot. This update ensures that subsequent request scheduling decisions are based on the latest prediction environment, maintaining causal consistency throughout the decision-making process.

[0061] If all candidate start time slots have been traversed from arrive Subsequently, no time slots satisfying both mutual exclusion and power constraints were found, meaning the feasible time slot set was empty. This indicates that a legal operating interval cannot be arranged for the request within the current cycle. At this point, the request is temporarily shelved, marked as a suspended request, and not included in the device's operating sequence for this cycle, nor are any arrays updated. This suspended request will be re-evaluated in the next scheduling cycle. As the absolute value of the environmental deviation associated with the device may further increase over time, its urgency in the next cycle will increase accordingly, thus naturally obtaining a higher scheduling priority and having the opportunity to be executed in a subsequent cycle.

[0062] After removing the current request from the queue of requests to be scheduled, the next request in the queue is processed. The processes of constraint checking, comprehensive cost calculation, execution slot selection, and resource prediction update are repeated until the queue of requests to be scheduled is empty. Once all requests have been processed, the device occupancy array of the final version is used as the basis for processing. and the execution start slot selected for each request in the above process. and runtime slots This generates a complete time-slot resolution sequence of device operation for the current scheduling period. This sequence is a list of control commands of the same length as the prediction time domain, indexed by time slots. It explicitly specifies which controlled devices need to be turned on and off in each time slot, as well as the expected operating power value of each device (in this embodiment, these are the corresponding rated power), thus forming a directly executable time-triggered control plan.

[0063] Through the aforementioned sequential decision-making process, this embodiment simultaneously achieves four scheduling objectives—mutual exclusion constraint satisfaction, power limit compliance, peak power reduction, and comfort loss reduction—with extremely low computational complexity, forming a complete joint optimization closed loop. Peak power reduction is achieved by prioritizing the time slot with the minimum peak power increase among all feasible time slots, while comfort loss reduction is achieved through weighted penalty of latency duration. Both are unified under the same comprehensive cost framework through weighted summation. Although the simplified comfort loss cost calculation used in this embodiment has slightly lower accuracy, it eliminates the need for multiple complete environmental recursive predictions, resulting in lower computational load and providing satisfactory scheduling performance in most everyday home scenarios.

[0064] S6. Based on the equipment operation sequence, at the beginning of the corresponding time slot, the microcontroller controls each controlled device to perform start-stop and power adjustment actions.

[0065] Specifically, after generating a complete device operation sequence in S5, the microcontroller controller will execute the corresponding control instructions sequentially according to the start time of each time slot in the sequence. At the start time of each time slot, the microcontroller sends an on / off switch instruction to the corresponding smart socket, infrared remote control forwarding module, or device driver through its general-purpose input / output interface or RS-485 serial communication bus. For devices that need to maintain operation in this time slot, if they were already running in the previous time slot and their power setting remained unchanged, there is no need to repeat the instruction to reduce the bus communication load. For devices newly started or requiring power setting adjustment in this time slot, the microcontroller sends a power adjustment instruction through the corresponding interface according to the expected operating power value recorded in the device operation sequence. In this embodiment, since the expected operating power of all devices is simplified to the rated power, the power instruction is the rated power setting value included in the start instruction. For devices controlled by infrared remote control, the instruction is sent by the forwarding module in the form of infrared encoding; for devices controlled by smart sockets, the instruction is sent to the socket microcontroller in the form of serial data packets. Upon receiving the instruction, each controlled device executes the corresponding start / stop and power switching actions, thereby completing the control output for this time slot. Subsequently, the system enters the environmental monitoring waiting phase, where the microcontroller continuously queries or waits for sensor data updates through the sensor interface until the start of the next scheduling cycle arrives, at which point the complete closed-loop process from S1 to S6 is re-executed.

[0066] The technical process described in Example 1 can achieve multi-device coordinated control based on environmental parameter linkage, device mutual exclusion management, and power capacity constraints under the constraints of extremely limited computing and storage resources of a microcontroller. This achieves the basic effects of eliminating physical functional mutual exclusion conflicts, preventing excessive power input, and maintaining indoor environmental comfort through joint optimization of peak power and comfort loss. This scheme organically integrates hard constraint lookup of the mutual exclusion graph, predictive recursion of the influence relationship matrix, and sequential scheduling based on comprehensive cost evaluation into a lightweight closed-loop control framework. Its total computational load in each scheduling cycle consists of at most a few hundred integer multiplication-addition operations and a small number of comparison branch operations. This enables the home microcontroller controller, which originally only had simple threshold control capabilities, to handle multi-device coupling constraints and joint optimization adjustment. From a technical perspective, this combination of "lightweight prediction plus hard constraint sequential plus simplified joint cost" achieves conflict-free operation between mutually exclusive devices and effective suppression of peak power input with a computational overhead far lower than model predictive control or genetic algorithms. Simultaneously, by simplifying the introduction of comfort loss costs, it also takes into account the dynamic maintenance of environmental comfort to a certain extent.

[0067] The aforementioned microcontroller-based intelligent adjustment and control method based on environmental parameter linkage forms a lightweight equipment interaction knowledge graph by pre-setting equipment mutual exclusion relationship information and environmental impact relationship information. Based on this, it collects environmental status in real time and compares it with comfort target values ​​to construct a deviation vector. It then uses the change direction information in the environmental impact relationship information to perform directional matching and weighted accumulation of the deviation, generating an operational urgency reflecting the marginal benefit of equipment adjustment. This allows for the estimation of the runtime and expected operating power required to eliminate the deviation, which are then encapsulated into a unified operating request. Within the prediction time domain, it uses the environmental impact relationship information to deduce the evolution of environmental parameters under different equipment start-stop combinations time-slot by time-slot to obtain predicted environmental parameters. Finally, it uses mutual exclusion relationships... Using legality criteria, the upper limit of the power supply to the household as the total power boundary, and reducing the peak total power in the time domain and the cumulative penalty for environmental parameters deviating from the comfort target value as joint optimization objectives, a sequential decision is executed on all operating requests to generate a device operating sequence. Finally, start, stop and power adjustment commands are output to each controlled device according to the sequence. Thus, under the extremely limited storage and computing resources of the microcontroller, a closed-loop linkage control is achieved that integrates three mutually coupled control objectives: device mutual exclusion constraints, power load peak smoothing and forward-looking maintenance of environmental comfort. With extremely low computational overhead, it simultaneously achieves the effects of eliminating physical functional conflicts between devices, smoothing the power load curve to the household, and ensuring the overall comfort of the indoor environment.

[0068] Example 2:

[0069] Step S2 includes the following steps:

[0070] S11. Perform differential processing on the environmental state vector to obtain the rate of change vector representing the rate of change of environmental parameters in each dimension.

[0071] Specifically, the microcontroller controller obtains the current time... Filtered environment state vector Then, it retrieves the data from the previous scheduling cycle at time [time] from its internally maintained historical data buffer. The environmental state vector collected and stored after the same filtering process For each dimension of environmental parameters First-order backward difference operations are performed to obtain the original rates of change of each dimension of the environmental parameters. The formula for calculating the original rate of change is: The raw rate of change represents the average rate of change of the environmental parameter within the most recent scheduling cycle interval. A positive value indicates that the parameter is increasing, and a negative value indicates that the parameter is decreasing. The absolute value indicates the speed of change. Subsequently, to suppress abnormal fluctuations in the raw rate of change caused by measurement noise or instantaneous airflow disturbances, a first-order low-pass filter is applied to each of the four sets of raw rate of change sequences. The filter difference equation is consistent with that used in S1, i.e. ,in The filtered result at the current time is the th Rate of change of dimensional parameter This represents the rate of change after filtering in the previous period. These are the rate of change filter coefficients. The filtered results are combined to form the rate of change vector. This vector carries information on the current evolution trend of each environmental dimension.

[0072] S12. Perform a first weighted summation on the product of each component in the deviation vector and the corresponding change in influence, and only sum the components whose positive or negative sign is consistent with the direction of change to obtain the first weighted summation result.

[0073] S13. Perform a second weighted summation on the product of each component in the rate of change vector and the corresponding change amount, and only sum the components whose positive and negative signs are opposite to the direction of change to obtain the second weighted summation result.

[0074] S14. Combine the first weighted cumulative result with the second weighted cumulative result to obtain the execution urgency; the expression for the execution urgency is:

[0075]

[0076] in, Indicates controlled equipment At the present moment The urgency of operation This represents the total number of dimensions of the environmental parameters. For the first Weighting coefficients for environmental parameter deviations. The first in the deviation vector Environmental parameters at time The difference, To influence the controlled devices in the relationship information For the The amount of change in environmental parameters. For the first The weighting coefficients for the rate of change of environmental parameters. For the first Environmental parameters at time The rate of change; For a sign function, when When, take 1, when When -1 is taken, Take 0 at that time.

[0077] Specifically, S12 to S14 together complete the improved operational urgency calculation in Example 2. Unlike the simplified calculation based solely on the current deviation in Example 1, this example decomposes the urgency into a superposition of a static demand component driven by the deviation and a dynamic forward-looking demand component driven by the rate of change.

[0078] Step S12 calculates the first weighted cumulative result, and its calculation logic is completely consistent with the core logic of the urgency calculation in Example 1: traversing all environmental parameter dimensions. For the first Dimension, from the deviation vector China Obtain from information about influencing relationships . judge positive and negative signs and If the symbols are the same, then the contribution item will be... The summation process is performed. The sum obtained after traversing all dimensions is the first weighted summation result, which represents the static adjustment urgency based on the environmental deviation at the current moment.

[0079] Step S13 calculates the second weighted cumulative result, which is the dynamic look-ahead part added in Example 2 compared to Example 1. This involves traversing all environmental parameter dimensions. For the first Dimension, from the rate of change vector China Obtain from information about influencing relationships Determine the rate of change The sign of positive and negative and the amount of change Are the signs opposite? If the signs are opposite, it means that the current environmental parameters are evolving in a direction away from the comfort target—for example, the rate of temperature change corresponding to air conditioning. The value is positive (temperature is rising), while the change in temperature caused by the air conditioner is... A negative value (cooling down) indicates that the temperature is deteriorating (heating up), requiring the air conditioner to intervene in advance to counteract this deterioration. In this case, the contribution item will be... Perform the summation. Note the rate of change in this item. The absolute value is not taken; its sign is preserved to produce the correct directional contribution in the accumulation. Multiply by This converts the rate of change into an increment of urgency proportional to the equipment's adjustment capacity. If the rate of change... The sign and the change If the signs are the same, it indicates that the environment is already improving towards a comfortable goal on its own. In this case, the device does not need to increase its urgency due to the changing trend, and this contribution is 0 and is not accumulated. For the preset first Weighting coefficients for the rate of change of environmental parameters in each dimension. The sum is not necessarily 1, but is set independently based on the time inertia and control response speed of each dimension of environmental parameters, in order to balance the influence of static deviation and dynamic trend in the final urgency.

[0080] Step S14: Directly sum the first weighted summation result and the second weighted summation result to obtain the device... At the present moment urgency of operation The complete mathematical expression after merging is: .in, Indicates controlled equipment At the present moment The urgency of operation is a non-negative scalar value; the larger the value, the more urgent it is to start the device. In this embodiment, the total number of dimensions of the environmental parameters is [number missing]. . For the first The weighting coefficients of environmental parameter deviations reflect the relative importance of these deviations to comfort. The first in the deviation vector Environmental parameters at time The difference is calculated using the following formula: A positive value indicates that the parameter is lower than the target, and a negative value indicates that the parameter is higher than the target. The influence relationship information matrix Controlled equipment For the The absolute value of the change in environmental parameters. Indicates the rate of change per unit time, symbol It indicates a change of direction. For the first The weighting coefficients of the rate of change of environmental parameters are used to adjust the sensitivity to future trends. For the first Environmental parameters at time The rate of change is calculated from S11. For symbolic functions, their definition is: when hour ,when hour ,when hour . To find the maximum value function, when Time return ,when Returns 0.

[0081] In the above expression, the first summation term The calculation method is as follows: for each dimension ,calculate The product of these two factors is positive if and only if the direction of the deviation is consistent with the direction of the equipment's influence; using The function truncates negative values ​​or zero to 0, ensuring that it only contributes positive urgency to dimensions that help improve bias; then it is multiplied by the weight. and the extent of the impact Then the summation is performed. The second summation term... The calculation method is as follows: for each dimension , Equivalent to Therefore, the product A positive value indicates that the environment is deteriorating and the equipment can counteract this deterioration; in this case, the factor contributes positively to the urgency level. This is then multiplied by the rate of change weight. and the extent of the impact Then the summation is performed.

[0082] The aforementioned urgency formula organically integrates the static information of the current deviation and the dynamic information of the environmental evolution trend into the same scalar index, so that the urgency ranking takes into account both "how bad it is now" and "how bad it will get in the future", thereby providing more accurate priority guidance for subsequent scheduling.

[0083] Example 3:

[0084] Step S3 includes the following steps:

[0085] S21. Determine the expected operating power coefficient of the controlled equipment based on the ratio of the deviation value of the environmental parameter associated with the controlled equipment in the deviation vector to the preset maximum allowable deviation; wherein, the expected operating power coefficient is used to characterize the expected operating power.

[0086] Specifically, for controlled devices that pass the urgency threshold screening, the absolute value of the current deviation of their primary associated environmental parameter dimension is selected and denoted as... The preset maximum permissible deviation value corresponding to this master correlation parameter is pre-stored in Flash, denoted as... This maximum permissible deviation value defines the boundaries of the allowable deviation range on both sides of the comfort target value. Dividing the absolute value of the current deviation by the maximum permissible deviation value yields a dimensionless deviation ratio value between 0 and 1. This ratio reflects the extent to which the current deviation represents the maximum permissible deviation. The closer a value is to 1, the more severe the deviation; the closer it is to 0, the closer it is to the comfort target. This ratio is used as the basis for calculating the expected operating power coefficient: Let the initial power coefficient... ,in This is a preset scaling factor used to map the deviation ratio to the device power factor domain. A lower limit is then applied to this initial factor. and upper limit Limiting constraints ensure the final desired operating power factor. It falls within the actual operating power range allowed by the equipment. Limiting operation can be expressed as... ,in , These correspond to the ratios of the equipment's minimum operating power to its rated power and the ratio of its maximum operating power to its rated power, respectively. For fixed-frequency equipment, The desired operating power is always the rated power. For adjustable equipment such as inverter air conditioners, It can take values ​​in the range of 0.3 to 0.5. A value within the range of 1.0 to 1.2 can be taken, depending on the characteristics of the equipment. The final desired operating power factor is obtained. That is, it is used to characterize the desired operating power, which is determined by... The calculation yielded the result.

[0087] The aforementioned adaptive power determination method based on deviation ratio enables the device to operate at higher or even higher power to quickly eliminate deviations when environmental parameters deviate significantly from the comfort target. When the deviation is small, it can finely adjust at lower power to save energy and reduce noise, thus achieving automatic switching between coarse and fine adjustment.

[0088] S22. The ratio of the absolute value of the deviation value of the preset main associated environmental parameter in the deviation vector to the absolute value of the corresponding change in the influence relationship information is used as the continuous running time required to eliminate the deviation value, thus obtaining the running time.

[0089] Specifically, when calculating request runtime, the absolute value of the deviation of the primary associated parameter is taken. As the numerator, the absolute value of the change in this main correlation parameter by the device in the influence relationship information matrix is ​​taken. As the denominator, the quotient is used to calculate the request runtime. It represents the estimated time required for the equipment to adjust its parameters to the target comfort value at the rated rate, given the current deviation.

[0090] S23. Encapsulate the desired operating power factor and operating time into a running request.

[0091] Specifically, the equipment identification and the expected operating power coefficient obtained in step S21 are... The request runtime obtained in step S22 Together with the operational urgency already calculated in the previous steps These are collectively encapsulated into a single structure for the run request. In subsequent S5 scheduling steps, the desired operating power is calculated by multiplying this power factor by the device's rated power. It participates in power constraint checks and serves as the basis for setting power adjustment actions in S6.

[0092] Example 4:

[0093] refer to Figure 2 Step S5 includes the following steps:

[0094] S31. Based on the predicted time domain and predicted environmental parameters, construct the power occupancy array and device occupancy array corresponding to the predicted time domain.

[0095] Specifically, in the microcontroller's memory, this represents the length of the predicted time domain. Assign two lengths A one-dimensional array data structure. The first array is the power occupancy array, denoted as... ,in Each array element is a 16-bit or 32-bit unsigned integer, used to store the cumulative total operating power within the corresponding time slot. The second array is the device occupancy array, denoted as... Each element records which devices are running within that time slot. The storage method can be a bitmask (using individual bits of a word to represent each device) or a short list, depending on the total number of controlled devices. During initialization, all time slots are... Assigning a value of 0 will remove all Set the null flag. Then, iterate through the set of all devices currently running with remaining runtime. For each device in the process, the time slot interval it will cover in the predicted time domain is determined based on its remaining runtime. For each time slot within this interval... The expected operating power of the device Accumulated to In, and the equipment Add numbering markers Once this initialization process is complete, the initial power occupancy array and the initial equipment occupancy array, which reflect the current known load distribution and equipment occupancy pattern, are obtained.

[0096] S32. Sort all running requests in descending order of running urgency to obtain the queue of requests to be scheduled.

[0097] Specifically, all runtime requests generated in step S3 of this cycle are collected into an unordered set, and then a sorting operation is performed on this set. The primary key for sorting is the runtime urgency value carried by each request. The requests are sorted in descending order of urgency. If two requests have exactly the same urgency value, a secondary key is used for further sorting. The secondary key can be the absolute value of the deviation of the primary associated environmental parameter of the device corresponding to that request. The requests are also sorted in descending order to ensure that requests from devices with more severe environmental deviations are processed first, given the same level of urgency. The resulting ordered list is the queue of requests to be scheduled.

[0098] S33. Take the first request from the queue of requests to be scheduled as the current request; determine multiple candidate start time slots based on the number of time slots required for the runtime of the current request; traverse the candidate start time slots in the prediction time domain, and use the equipment mutual exclusion relationship information and the upper limit of the power supply capacity to perform constraint checks on each candidate start time slot to obtain a set of feasible time slots.

[0099] Specifically, following the order of the queue of requests to be scheduled, the request at the head of the queue is taken as the current request for scheduling and processing. The device identifier in the request is then parsed. urgency of operation Request runtime and expected operating power Request runtime The required number of time slots is calculated in the same manner as in Example 1. In the prediction time domain, all conditions that satisfy... and integer time slots All of them were identified as candidate start time slots, forming a candidate start time slot set. Then, for each candidate start time slot in the set... Perform the same mutual exclusion constraint and power constraint check process as in Example 1, that is, for time slot intervals Each time slot within Inspection The equipment and devices already recorded Mutual exclusion relationships, and verification Only candidate starting time slots that satisfy both constraints are collected into a dedicated result set. After traversing all candidate starting time slots, this result set is the feasible time slot set.

[0100] S34. When the feasible time slot set is empty, mark the current request as a delayed request, skip the subsequent processing of the delayed request, and remove the delayed request from the queue of requests to be scheduled. When the feasible time slot set is not empty, calculate the comprehensive cost corresponding to the joint objective for each time slot in the feasible time slot set based on the influence relationship information and the predicted environment parameters.

[0101] Specifically, after obtaining the feasible time slot set, branching is performed based on whether the set is empty. If the feasible time slot set is empty, it indicates that under the current occupied resources and constraints, it is impossible to find any continuous operating interval that satisfies mutual exclusion and power limits for the request within the prediction time domain. In this case, the request is marked as a delayed request, no execution time slot is allocated to it, the subsequent update steps for the request are skipped, and the delayed request is removed from the queue of requests to be scheduled, moving on to the next request in the queue of requests to be scheduled. If the feasible time slot set is not empty, it is necessary to calculate the comprehensive cost of arranging the request to start in each candidate starting time slot in the set. In Example 4, the calculation of the comprehensive cost includes two components: a power smoothing index and a comfort loss index. The power smoothing index is calculated in the same way as in Example 1, that is, after simulating inserting the current request into the candidate time slot interval with the expected operating power, the maximum power value in that interval is extracted. The comfort loss index also adopts the simplified calculation method based on the current deviation and the number of delayed time slots in Example 1, that is... The comprehensive cost of the candidate time slot is obtained by weighting and summing the power smoothing index and the comfort loss index according to preset weights. The difference between Example 4 and Example 5 is that Example 4 uses the simplified method of comfort loss calculation that does not rely on simulated environment prediction, while Example 5 introduces accurate comfort loss calculation based on the complete environment prediction sequence.

[0102] S35. Select the time slot with the lowest overall cost from the set of feasible time slots as the execution time slot, update the predicted environment parameters, power occupancy array and device occupancy array using the execution time slot and runtime, and remove the current request from the queue of requests to be scheduled.

[0103] Specifically, by traversing the comprehensive costs calculated for each candidate time slot in the feasible time slot set in S34, the candidate starting time slot with the smallest comprehensive cost is found through a successive comparison method, and this is determined as the execution time slot for the request. Then, using the selected execution slot. and the number of time slots requested. Update the power occupancy array in exactly the same manner as in Example 1. and device usage array And recursively update the predicted environmental parameter sequence starting from the affected time slot. Once the update is complete, remove the current request from the queue of requests to be scheduled.

[0104] S36. Repeat S33 to S35 until the queue of pending scheduling requests is empty, and generate the device operation sequence based on the final device occupancy array.

[0105] Specifically, the process of "retrieving the head of the queue request – traversing candidate time slots and checking constraints – comprehensive cost evaluation – selecting the optimal time slot – updating the array" is repeated continuously until all running requests in the queue of requests to be scheduled have been processed (either normally allocated execution time slots or marked as delayed requests). After all requests have been processed, the device occupancy array of the final version is used. The device start / stop status of each time slot recorded in the system is combined with the execution time slot and runtime information allocated to each request to generate a complete device operation sequence for the current scheduling cycle.

[0106] Example 5:

[0107] When the feasible time slot set is not empty, based on the impact relationship information and predicted environmental parameters, the comprehensive cost corresponding to the joint objective is calculated for each time slot in the feasible time slot set, including the following steps:

[0108] S41. Based on the runtime of the current request and the candidate start timeslots in the feasible timeslot set, determine the time slot interval occupied by the current request in the prediction time domain; wherein, the occupied timeslot interval is... , Controlled equipment The number of time slots corresponding to the runtime. This is a candidate start time slot.

[0109] Specifically, for each candidate start time slot in the feasible time slot set Let the runtime of the current request be... The converted number of time slots is If the request is scheduled in a time slot Upon startup, the range of time slot numbers that will be continuously occupied within the predicted time domain is from... arrive The closed interval. This interval is formally defined as the occupied time slot interval corresponding to the candidate time slot, denoted as . The start and end points of the occupied time slot interval are both non-negative integers, and the end point does not exceed [a certain value]. .

[0110] S42. Based on the occupied time slot interval and the expected operating power of the current request, the power occupancy array is simulated and updated to obtain the simulated power occupancy array.

[0111] Specifically, when evaluating a candidate start slot, to avoid directly modifying the current actual power occupancy array and thus affecting the independent evaluation of other candidate slots, a data copying and local modification approach is used. First, from the current power occupancy array... A duplicate copy is created, and a simulated update is performed on this copy. Specifically, on this copy array, for the occupied time slot interval... Each time slot index within Perform analog power accumulation The resulting replica array is the simulated power occupancy array.

[0112] S43. Extract the maximum power value corresponding to the occupied time slot interval from the simulated power occupancy array to obtain the power smoothing index.

[0113] Specifically, iterate through the simulated power occupancy array corresponding to the occupancy time slot interval. For all elements, find the largest element value by comparing each element pairwise, and record it as a candidate starting time slot. The corresponding power smoothing index is denoted as This power smoothing index visually reflects the peak height achievable in a local region of the power occupancy curve after a new device is inserted, if this time slot is selected. The lower the peak value, the more advantageous the candidate time slot is in avoiding the formation of new load spikes.

[0114] S44. Based on the predicted environmental parameters and the information on the relationships between them, the simulation will run the current request at the expected operating power within the occupied time slot interval in order to re-predict the predicted environmental parameters and obtain the simulated environmental parameter prediction sequence.

[0115] Specifically, based on the predicted environmental parameter sequence that is not currently affected by the selection of this candidate time slot. Assuming the device corresponding to the current request Operating at the desired power within the occupied time slot interval Run. Based on the environment recursive prediction method in S4, from the current time slot... Start re-executing a complete environmental prediction simulation, but in the time slot. When the device falls within the occupied time slot interval, it needs to be... The set of equipment operations included in this time slot Among them. For the affected time slots, the recursive formula is also... ,in This represents the predicted sequence of simulated environmental parameters. For matrix medium equipment The influence of row vectors Adjustments are made based on the simulated equipment occupancy. Through this simulation recursive process, a complete sequence of environmental parameter predictions under the candidate time slot assumption is obtained, which serves as the simulated environmental parameter prediction sequence.

[0116] S45. Based on the simulated environmental parameter prediction sequence, for each dimension of environmental parameter affected by the controlled equipment corresponding to the current request, calculate the cumulative squared deviation from the current time slot to the end of the occupied time slot interval, and only include environmental parameters whose deviation direction is consistent with the changing direction of the controlled equipment, to obtain the comfort loss index; wherein, the calculation formula of the comfort loss index is:

[0117]

[0118] in, Candidate start time slot The following is a comfort loss index. Indicates the device The set of indexes of environmental parameters that have a significant impact. For the first Comfort target values ​​for environmental parameters. For the environmental parameter prediction sequence, the first The end of the time slot Predicted values ​​of environmental parameters To affect the device in the relationship information For the The amount of change in the dimensional parameter; For a sign function, when When, take 1, when When -1 is taken, Take 0 at that time.

[0119] Specifically, the comfort loss index is used to quantitatively assess the impact of equipment... The startup delay is until the candidate start time slot. During the entire period from the current time slot until the end of the device's operation, how much unmet comfort demand will accumulate in the environmental dimensions affected by it? First, determine the affected equipment. Set of environmental parameter dimension indexes with significant impact The set is determined by iterating through all dimensions. If the absolute value of the corresponding element in the influence relationship information matrix If the salience exceeds a preset significance threshold, then the dimension will be... Add to collection .so, Only those devices are included. It is important to identify environmental dimensions that can produce substantial regulatory effects, and avoid including dimensions unrelated to the equipment in the comfort loss calculation to prevent interference.

[0120] For sets Each dimension of environmental parameters From the current time slot The last time slot of the occupied time slot interval Until then, traverse every time slot. In each time slot Extract the predicted value at the end of the corresponding time slot from the simulated environment parameter prediction sequence. Calculate its relationship with the comfort target value The difference However, not all deviations need to be factored into the loss – a delay only results in a real loss of comfort when the direction of the deviation aligns with the device's adjustment capability (i.e., the device could have improved the deviation but failed to do so due to the delay). This condition is determined by multiplying by the sign function. To achieve direction filtering: If A positive value indicates that the deviation of the environmental parameters is exactly in the direction of the equipment's influence, and this deviation can be attributed to the equipment's delay; a negative value or zero indicates that the deviation is in the opposite direction to the equipment's capability or that the parameters have met the standards, and is not considered a loss caused by the equipment's delay. Utilizing The function truncates the positive values ​​and squares them to obtain the comfort loss component of that dimension parameter in that time slot. All these components are then indexed in the dimension index. and time slot The candidate time slot is obtained by performing double accumulation on two dimensions. The corresponding comfort loss index. The complete formula for calculating this comfort loss index is as follows: .in, Candidate start time slot The comfort loss index is a non-negative scalar; the larger the value, the higher the comfort cost caused by delayed start. Indicates the device A set of indexes for environmental parameters that have a significant impact. For the first The preset comfort target values ​​for environmental parameters. The first in the simulated environment parameter prediction sequence The end of the time slot Predicted values ​​of environmental parameters. The influence relationship information matrix medium equipment For the The change in a dimension parameter, with the positive or negative sign indicating the direction of the change. It is a symbolic function, and its output is based on The positive, negative, or zero values ​​are 1, -1, or 0, respectively. The function outputs 0 when the input is less than 0, ensuring that only the positive bias portion that needs to be included in the loss is summed by squares. The double summation symbol indicates that the summation is performed first on the time slot. From 0 to Iterate through the collection and then index the dimensions. Each dimension in Accumulate.

[0121] The calculation of this comfort loss index utilizes the precise definition of the equipment's impact range based on the aforementioned influence relationship information, and combines it with a forward-looking accumulation of comfort states for multiple future time slots based on simulated and predicted environmental evolution trajectories. This transforms the abstract "comfort loss" into a target quantity that can be specifically calculated on a microcontroller. Compared to the simplified comfort loss calculation methods used in Embodiments 1 and 4, the precise calculation method in this embodiment fully considers the actual impact path of the equipment on environmental parameters after its insertion and operation, as well as the indirect effects generated between multiple devices through the transmission of environmental parameters. Therefore, the assessment of delay costs is more accurate and can support more refined scheduling decisions.

[0122] S46. The power smoothing index and the comfort loss index are weighted and summed to obtain the comprehensive cost.

[0123] Specifically, the power smoothing index is obtained from S43. The comfort loss index is obtained from S45. Based on the power weighting coefficients pre-set in the Flash memory. and comfort weighting coefficient The candidate start time slot is obtained by linearly weighting and summing the two. Corresponding comprehensive cost The formula for weighted summation is: .in, and All are non-negative real numbers and satisfy The relative size of this setting reflects the system's emphasis on both peak shaving and valley filling, and maintaining comfort. Increasing... The system will then tend to shift the load backward to reduce peak power, even if this may come at the cost of some comfort delay; increase The system will then be more inclined to start immediately to maintain comfort, even if this may cause a short-term buildup of power load. The specific values ​​of the two weights can be preset according to user preferences or seasonal characteristics, or they can be dynamically adjusted through subsequent online learning.

[0124] Example 6:

[0125] After marking the current request as a delayed request in step S34, the following steps are also included:

[0126] S51. Store the delayed request in the waiting queue, record the first generation time, and obtain the delayed request with timestamp.

[0127] Specifically, in S34 of Embodiment 4 or Embodiment 5, when the feasible time slot set of a request is determined to be empty, the request is marked as a delayed request. At this time, the delayed request is placed in a waiting queue specifically maintained in the microcontroller's memory. This waiting queue is a linked list or array structure with dynamically growing or fixed-allocation length. Each node in the queue stores complete information about a delayed request, including device identifier, original running urgency, expected running power, requested runtime, and the time when the request was first marked as delayed and entered the waiting queue. The method for recording the initial generation time is to read the microcontroller's internal real-time clock or cumulative scheduling cycle count value and append this value as a timestamp to the delayed request's data structure. Thus, the timestamped delayed request is obtained, and its timestamp is used to track the postponement duration of the request in subsequent steps.

[0128] S52. In subsequent scheduling cycles, calculate the current deviation vector based on the current environmental state vector and the preset comfort target value, and calculate the current environmental parameter change rate based on the current environmental state vector and the environmental state vector of the previous scheduling cycle.

[0129] Specifically, at a fixed point in each subsequent scheduling cycle (e.g., before or after the main scheduling task begins), a waiting queue inspection subroutine is initiated. This subroutine first collects and filters data according to the method described in S1 to obtain the current time. Environment state vector And read the comfort target value vector from Flash. Calculate the current deviation vector ,in Meanwhile, following the first-order backward differential and low-pass filtering method described in S11 of Embodiment 2, the current environmental state vector is utilized. and the environment state vector stored in the previous scheduling cycle Calculate the rate of change of current environmental parameters ,in For the first The rate of change of the dimension parameter after filtering.

[0130] S53. Based on the current rate of change of environmental parameters, the current deviation vector, and the information on influencing relationships, update the cumulative comfort loss value of the timestamped delay request to obtain the updated cumulative comfort loss value; wherein, the formula for updating the cumulative comfort loss value is:

[0131]

[0132] in, Controlled equipment The cumulative comfort loss value corresponding to timestamped delayed requests. For the first Loss conversion coefficients of environmental parameters, The first in the current deviation vector Environmental parameters at time The difference, To influence the controlled devices in the relationship information For the The amount of change in the dimensional parameter, For the first Environmental parameters at time The rate of change of current environmental parameters, The duration of the preset scheduling cycle; For a sign function, when When, take 1, when When -1 is taken, Take 0 at that time.

[0133] Specifically, for each timestamped delayed request in the waiting queue, the accumulated comfort loss value of that request is incrementally updated using the current environmental parameter change rate, the current deviation vector obtained from S52, and the influence relationship information matrix pre-stored in Flash. Each delayed request's accumulated comfort loss value is updated when it first enters the waiting queue. It is initialized to 0 and remains so after each update until the request is finally scheduled for execution.

[0134] The physical meaning of the updated formula is that: only when the direction of the environmental parameter deviation is consistent with the direction of the equipment's influence (i.e., the equipment is indeed capable of improving the current deviation), and the environmental parameters are continuously deteriorating at a certain rate, will the delay cause a cumulative loss of comfort at a rate proportional to that rate of change. If the environmental parameters have improved spontaneously due to the effects of other equipment or natural causes, then... It may become a negative value and be The cutoff value is 0, and the loss for that period is not included. This calculation method ensures that delay losses only reflect the additional deterioration in comfort caused by the equipment's failure to operate in a timely manner, avoiding double counting of deviations that have already been compensated for by other factors.

[0135] S54. When the cumulative comfort loss value after the update exceeds the preset tolerance threshold, the urgency of the time-stamped delay request is increased to the highest level, and a priority delay request is obtained.

[0136] Specifically, after each cumulative loss update operation of S53 is completed, the updated cumulative comfort loss value is obtained. With a preset tolerance threshold Compare. If This indicates that the environmental comfort level corresponding to the device has accumulated a significant loss due to the long delay, and it is imperative to obtain an operational opportunity as soon as possible to curb further deterioration of comfort. In this case, the urgency of the delayed request is forcibly set to a value far exceeding the highest priority achievable by any normal request, and the request is marked as a priority delayed request. The highest priority value can be set to an extremely large constant that would not appear in the normal urgency range.

[0137] S55. In the next scheduling cycle, the priority delayed request will be re-entered into the queue of pending requests.

[0138] Specifically, after the S3 run requests for the next scheduling cycle are generated and before the S5 sequential decision begins, device requests marked as priority delay requests are directly inserted at the head of the queue of scheduled requests. Since their urgency is now set to the highest level, they will be ranked first even if they are in the same queue as other newly generated high-urgency requests. During the subsequent S5 sequential decision process, this priority delay request will be the first to be processed because it has already obtained the highest processing priority in the queue. Combined with the constraint checking mechanism, the scheduler will prioritize searching for execution slots and allocating resources for it under the current mutual exclusion and power constraints, thereby greatly increasing the probability that it will be executed in the current scheduling, quickly compensating for the accumulated environmental comfort loss. Once the delay request is successfully scheduled and executed, its accumulated comfort loss value... The results were then reset to zero, and a new round of statistics began.

[0139] This embodiment links the delay waiting time with the rate of environmental deterioration, dynamically adjusts the priority of the shelved equipment, and avoids the problem of low-priority equipment being "starved" for a long time in traditional fixed-priority scheduling. This allows the system to adaptively allocate control resources to the dimension with the fastest accumulation of comfort loss when resources are scarce, thereby ensuring the balance of comfort of environmental parameters in all dimensions on a macro time scale.

[0140] The aforementioned microcontroller-based intelligent adjustment and control method based on environmental parameter linkage forms a lightweight equipment interaction knowledge graph by pre-setting equipment mutual exclusion relationship information and environmental impact relationship information. Based on this, it collects environmental status in real time and compares it with comfort target values ​​to construct a deviation vector. It then uses the change direction information in the environmental impact relationship information to perform directional matching and weighted accumulation of the deviation, generating an operational urgency reflecting the marginal benefit of equipment adjustment. This allows for the estimation of the runtime and expected operating power required to eliminate the deviation, which are then encapsulated into a unified operating request. Within the prediction time domain, it uses the environmental impact relationship information to deduce the evolution of environmental parameters under different equipment start-stop combinations time-slot by time-slot to obtain predicted environmental parameters. Finally, it uses mutual exclusion relationships... Using legality criteria, the upper limit of the power supply to the household as the total power boundary, and reducing the peak total power in the time domain and the cumulative penalty for environmental parameters deviating from the comfort target value as joint optimization objectives, a sequential decision is executed on all operating requests to generate a device operating sequence. Finally, start, stop and power adjustment commands are output to each controlled device according to the sequence. Thus, under the extremely limited storage and computing resources of the microcontroller, a closed-loop linkage control is achieved that integrates three mutually coupled control objectives: device mutual exclusion constraints, power load peak smoothing and forward-looking maintenance of environmental comfort. With extremely low computational overhead, it simultaneously achieves the effects of eliminating physical functional conflicts between devices, smoothing the power load curve to the household, and ensuring the overall comfort of the indoor environment.

[0141] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0142] Based on the same inventive concept, this application also provides a system for implementing the above-mentioned microcontroller-based intelligent adjustment and control method based on environmental parameter linkage. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more embodiments of the microcontroller-based intelligent adjustment and control system based on environmental parameter linkage provided below can be found in the limitations of the microcontroller-based intelligent adjustment and control method based on environmental parameter linkage described above, and will not be repeated here.

[0143] In one exemplary embodiment, such as Figure 3As shown, a single-chip microcomputer intelligent adjustment and control system 30 based on environmental parameter linkage is provided to implement the methods in the above-described method embodiments. The system includes:

[0144] The environmental perception and deviation calculation module 31 is used to collect sensor data from various environmental sensors through a microcontroller according to a preset scheduling cycle to obtain an environmental state vector; and to construct a deviation vector based on the deviation between the environmental state vector and the preset comfort target value. The microcontroller's non-volatile memory pre-stores device mutual exclusion information and the influence relationship information of the controlled devices on environmental parameters. The device mutual exclusion information indicates whether any two controlled devices will cause physical functional conflicts when running simultaneously, and the influence relationship information indicates the amount and direction of change of each controlled device on each dimension of environmental parameters per unit time during operation.

[0145] The equipment urgency assessment module 32 is used to weight and accumulate the quantities in the deviation vector that are consistent with the change direction in the influence relationship information corresponding to the controlled equipment for each controlled equipment, so as to obtain the operational urgency.

[0146] The operation requirement generation module 33 is used to estimate the runtime required to eliminate the deviation value for controlled equipment with an operation urgency greater than a preset threshold, based on the ratio of the deviation value of the parameter associated with the controlled equipment in the deviation vector to the corresponding change in the influence relationship information, and to generate an operation request carrying the runtime and expected operating power based on the deviation value to determine the expected operating power of the controlled equipment.

[0147] The multi-constraint environment prediction module 34 is used to construct a prediction time domain of a preset length within the current scheduling cycle; within the prediction time domain, it uses the influence relationship information to predict the evolution of environmental parameters under the start and stop of different controlled devices in a time slot, and obtains the predicted environmental parameters.

[0148] The dual-objective optimization scheduling module 35 is used to make sequential decisions on all operation requests based on predicted environmental parameters, using equipment mutual exclusion information as mutual exclusion constraints, a preset upper limit of the incoming power capacity as a power constraint, and reducing the total power peak and reducing comfort loss as joint objectives, to obtain the equipment operation sequence. Among them, reducing the total power peak refers to reducing the maximum value of the total power of the selected equipment operation sequence in each time slot in the prediction time domain, and reducing comfort loss refers to reducing the cumulative penalty amount caused by the start-up and shutdown sequence arrangement of controlled equipment that deviates from the preset comfort target value.

[0149] The equipment execution control module 36 is used to control each controlled device to perform start-stop and power adjustment actions through a microcontroller at the beginning of the corresponding time slot according to the equipment operation sequence.

[0150] Embodiments of this application also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the aforementioned method embodiments.

[0151] Embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0152] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0153] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A single-chip microcomputer intelligent adjustment and control method based on environmental parameter linkage, characterized in that, The method includes: S1. According to a preset scheduling cycle, sensor data from various environmental sensors are collected by a microcontroller to obtain an environmental state vector; based on the deviation between the environmental state vector and the preset comfort target value, a deviation vector is constructed; wherein, the microcontroller's non-volatile memory pre-stores device mutual exclusion information and the influence relationship information of controlled devices on environmental parameters. The device mutual exclusion information indicates whether any two controlled devices will cause physical functional conflicts when running simultaneously, and the influence relationship information indicates the amount and direction of change of each controlled device on each dimension of environmental parameters per unit time during operation. S2. For each controlled device, the quantities in the deviation vector that have the same direction of change as the influence relationship information corresponding to the controlled device are weighted and accumulated to obtain the operational urgency. S3. For the controlled device whose urgency is greater than a preset threshold, based on the ratio of the deviation value of the parameter associated with the controlled device in the deviation vector to the corresponding change in the influence relationship information, estimate the running time required to eliminate the deviation value, and based on the deviation value, determine the expected running power of the controlled device, and generate a running request carrying the running time and the expected running power. S4. Within the current scheduling cycle, construct a prediction time domain of a preset length; within the prediction time domain, use the influence relationship information to predict the evolution of environmental parameters under the start-up and shutdown of different controlled devices in a time slot, and obtain the predicted environmental parameters. S5. Based on the predicted environmental parameters, using the device mutual exclusion information as mutual exclusion constraints, the preset upper limit of the household power capacity as a power constraint, and the joint objective of reducing the total power peak and reducing comfort loss, a sequential decision is made on all the operation requests to obtain the device operation sequence; wherein, reducing the total power peak refers to reducing the maximum value of the total power of the selected device operation sequence in each time slot within the prediction time domain, and reducing comfort loss refers to reducing the cumulative penalty amount caused by the start-up and shutdown sequence arrangement of the controlled devices to deviate from the preset comfort target value; S6. According to the equipment operation sequence, at the beginning of the corresponding time slot, the microcontroller controls each controlled device to perform start-stop and power adjustment actions.

2. The method according to claim 1, characterized in that, S2 includes: S11. Perform differential processing on the environmental state vector to obtain a rate of change vector representing the rate of change of environmental parameters in each dimension. S12. Perform a first weighted summation on the product of each component in the deviation vector and the corresponding change in influence, and only sum the components whose positive or negative sign is consistent with the direction of change to obtain the first weighted summation result. S13. Perform a second weighted summation on the product of each component in the rate of change vector and the corresponding change amount, and only sum the components whose positive or negative signs are opposite to the direction of change to obtain the second weighted summation result. S14. Combine the first weighted cumulative result with the second weighted cumulative result to obtain the running urgency; wherein, the expression for the running urgency is: ; in, Indicates controlled equipment At the present moment The aforementioned operational urgency, This represents the total number of dimensions of the environmental parameters. For the first Weighting coefficients for environmental parameter deviations. The first in the deviation vector Dimensional environmental parameters at time The difference, For the controlled devices in the influence relationship information For the The amount of change in environmental parameters. For the first The weighting coefficients for the rate of change of environmental parameters. For the first Environmental parameters at time The rate of change; For a sign function, when When, take 1, when When -1 is taken, Take 0 at that time.

3. The method according to claim 1, characterized in that, S3 includes: S21. Determine the expected operating power coefficient of the controlled equipment based on the ratio of the deviation value of the environmental parameter associated with the controlled equipment in the deviation vector to the preset maximum allowable deviation; wherein, the expected operating power coefficient is used to characterize the expected operating power; S22. The ratio of the absolute value of the deviation value of the preset main associated environmental parameter in the deviation vector to the absolute value of the corresponding change in the influence relationship information is used as the continuous running time required to eliminate the deviation value, and the running time is obtained. S23. Encapsulate the desired operating power coefficient and the operating time into the operating request.

4. The method according to claim 1, characterized in that, S5 includes: S31. Based on the predicted time domain and the predicted environment parameters, construct a power occupancy array and a device occupancy array corresponding to the predicted time domain; S32. Arrange all the running requests in descending order of running urgency to obtain a queue of requests to be scheduled; S33. Take the first request from the queue of requests to be scheduled as the current request; determine multiple candidate start time slots based on the number of time slots required for the runtime of the current request; traverse the candidate start time slots in the prediction time domain, and perform constraint checks on each candidate start time slot using the device mutual exclusion information and the upper limit of the power supply capacity to obtain a set of feasible time slots; S34. When the feasible time slot set is empty, mark the current request as a delayed request, skip the subsequent processing of the delayed request, and remove the delayed request from the queue of requests to be scheduled; when the feasible time slot set is not empty, calculate the comprehensive cost corresponding to the joint objective for each time slot in the feasible time slot set based on the influence relationship information and the predicted environment parameters. S35. Select the time slot with the lowest overall cost from the set of feasible time slots as the execution time slot, update the predicted environment parameters, the power occupancy array and the device occupancy array using the execution time slot and the runtime, and remove the current request from the queue of requests to be scheduled. S36. Repeat S33 to S35 until the queue of requests to be scheduled is empty, and generate the device running sequence based on the final device occupancy array.

5. The method according to claim 4, characterized in that, When the feasible time slot set is not empty, based on the influence relationship information and the predicted environment parameters, the comprehensive cost corresponding to the joint objective is calculated for each time slot in the feasible time slot set, including: S41. Based on the runtime of the current request and the candidate start time slots in the feasible time slot set, determine the time slot interval occupied by the current request in the prediction time domain; wherein, the time slot interval is... , Controlled equipment The number of time slots corresponding to the runtime, The candidate start time slot; S42. Based on the occupied time slot interval and the expected operating power of the current request, the power occupancy array is simulated and updated to obtain a simulated power occupancy array; S43. Extract the maximum power value corresponding to the occupied time slot interval from the simulated power occupancy array to obtain the power smoothing index; S44. Based on the predicted environmental parameters and the influence relationship information, simulate running the current request at the expected operating power within the occupied time slot interval to re-predict the predicted environmental parameters and obtain a simulated environmental parameter prediction sequence. S45. Based on the simulated environmental parameter prediction sequence, for each dimension of environmental parameter affected by the controlled device corresponding to the current request, calculate the cumulative squared deviation from the current time slot to the end of the occupied time slot interval, and only include environmental parameters whose deviation direction is consistent with the changing direction of the controlled device, to obtain a comfort loss index; wherein, the calculation formula of the comfort loss index is: ; in, Candidate start time slot The aforementioned comfort loss index, Indicates the device The set of indexes of environmental parameters that have a significant impact. For the first Comfort target values ​​for environmental parameters. For the environmental parameter prediction sequence, the first... The end of the time slot Predicted values ​​of environmental parameters For the devices in the influence relationship information For the The amount of change in the dimensional parameter; For a sign function, when When, take 1, when When -1 is taken, Take 0 at the time; S46. The power smoothing index and the comfort loss index are weighted and summed to obtain the comprehensive cost.

6. The method according to claim 4, characterized in that, After marking the current request as a delayed request, the method further includes: S51. Store the delay request in the waiting queue, record the first generation time, and obtain the timestamped delay request; S52. In subsequent scheduling cycles, calculate the current deviation vector based on the current environmental state vector and the preset comfort target value, and calculate the current environmental parameter change rate based on the current environmental state vector and the environmental state vector of the previous scheduling cycle. S53. Based on the current environmental parameter change rate, the current deviation vector, and the influence relationship information, update the cumulative comfort loss value of the timestamped delay request to obtain the updated cumulative comfort loss value; wherein, the formula for updating the cumulative comfort loss value is: ; in, Controlled equipment Corresponding to the cumulative comfort loss value of the timestamped delay request, For the first Loss conversion coefficients of environmental parameters, The first in the current deviation vector Environmental parameters at time The difference, For the controlled devices in the influence relationship information For the The amount of change in the dimensional parameter, For the first Environmental parameters at time The rate of change of current environmental parameters, The duration of the preset scheduling period; For a sign function, when When, take 1, when When -1 is taken, Take 0 at the time; S54. When the cumulative comfort loss value after the update exceeds the preset tolerance threshold, the running urgency of the timestamped delay request is raised to the highest level to obtain a priority delay request. S55. In the next scheduling cycle, the priority delay request is re-entered into the queue of requests to be scheduled.

7. A single-chip microcomputer-based intelligent adjustment and control system based on environmental parameter linkage, used to implement the method according to any one of claims 1 to 6, characterized in that, The system includes: The environmental perception and deviation calculation module is used to collect sensor data from various environmental sensors through a microcontroller according to a preset scheduling cycle to obtain an environmental state vector; and to construct a deviation vector based on the deviation between the environmental state vector and the preset comfort target value; wherein, the microcontroller's non-volatile memory pre-stores device mutual exclusion relationship information and the influence relationship information of controlled devices on environmental parameters. The device mutual exclusion relationship information indicates whether any two controlled devices will cause physical functional conflicts when running simultaneously, and the influence relationship information indicates the amount and direction of change of each controlled device on each dimension of environmental parameters per unit time during operation. The equipment urgency assessment module is used to weight and accumulate the quantities in the deviation vector that are consistent with the direction of change in the influence relationship information corresponding to the controlled equipment for each controlled equipment, so as to obtain the operational urgency. The operation requirement generation module is used to estimate the runtime required to eliminate the deviation value of the controlled device whose operation urgency is greater than a preset threshold, based on the ratio of the deviation value of the parameter associated with the controlled device in the deviation vector to the corresponding change in the influence relationship information, and to generate an operation request carrying the runtime and the expected operation power of the controlled device based on the deviation value. The multi-constraint environment prediction module is used to construct a prediction time domain of a preset length within the current scheduling cycle; within the prediction time domain, the influence relationship information is used to predict the evolution of environmental parameters under the start-up and shutdown of different controlled devices in a time slot, so as to obtain the predicted environmental parameters. The dual-objective optimization scheduling module is used to perform sequential decision-making on all the operation requests based on the predicted environmental parameters, using the mutual exclusion relationship information of the devices as mutual exclusion constraints, the preset upper limit of the incoming power capacity as a power constraint, and the joint objectives of reducing the total power peak and reducing comfort loss, to obtain the device operation sequence; wherein, reducing the total power peak refers to reducing the maximum value of the total power of the selected device operation sequence in each time slot in the prediction time domain, and reducing comfort loss refers to reducing the cumulative penalty amount caused by the start-up and shutdown sequence arrangement of the controlled devices to deviate from the preset comfort target value; The device execution control module is used to control each controlled device to perform start-stop and power adjustment actions through a microcontroller at the beginning of the corresponding time slot according to the device operation sequence.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.