Smart home constant temperature control method and system

By utilizing a combination of information age perception and integral forgetting in a smart home constant temperature control system, the differential and integral terms are reconstructed, solving the instability problem of temperature regulation in a wireless network environment and achieving stable temperature control under network communication delay fluctuations.

CN122431448APending Publication Date: 2026-07-21JIANGSU BERGER HOME TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU BERGER HOME TECH CO LTD
Filing Date
2026-06-18
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In a wireless network environment, channel contention and signal interference affect the stability of temperature regulation in a smart home thermostat control system, causing the actual operating state of the control loop to deviate from the design assumptions.

Method used

By acquiring temperature sensing data packets with timestamps, calculating the age of uplink information using the local clock, generating virtual errors using a pre-identified offline first-order inertial pure time delay model of the controlled object, reconstructing the differential term, and updating the integral accumulator using the integral forgetting factor and the mixed error signal, a control signal is generated, and the integral forgetting factor is adjusted to adapt to changes in network communication conditions.

Benefits of technology

Under network communication latency fluctuations, the timing consistency of each operation stage of the control law is maintained, the differential impact caused by sampling interval jumps is suppressed, the integral energy is prevented from increasing unidirectionally, and the controlled temperature is stabilized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431448A_ABST
    Figure CN122431448A_ABST
Patent Text Reader

Abstract

The application provides a smart home constant temperature control method and system, and belongs to the technical field of smart home. In the temperature control based on wireless network feedback, temperature sensing data packets carrying time stamps are acquired, and uplink information age is calculated. Whether the uplink information age exceeds a dynamic threshold is judged. When the uplink information age exceeds the dynamic threshold, a virtual error is generated by using a pre-off-line identified first-order inertia pure lag model of a controlled object, and a differential term is reconstructed. When the uplink information age does not exceed the dynamic threshold, a differential term is calculated by using a historical error signal. Meanwhile, an integral forgetting factor is calculated according to the uplink information age. Under the trigger of a timing interrupt, the integral forgetting factor and a selected mixed error signal are used to update an integral accumulator to generate an integral term. After a proportional term, the differential term and the integral term are superposed and limited in amplitude, a control signal is generated, and the integral forgetting factor is adjusted according to a continuous missing state of a downlink confirmation signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart home technology, specifically relating to a smart home constant temperature control method and system. Background Technology

[0002] In smart home bedroom thermostat control scenarios, a common existing processing method involves a temperature sensor collecting indoor temperature data at a fixed sampling period and reporting the collected temperature data to a central control device via a wireless network. After receiving the temperature data, the central control device compares it with the user-set target temperature, generates a temperature error signal, and calculates a control signal to adjust the operating frequency of the air conditioner compressor. The control signal is then sent to the actuator at the air conditioner end via the wireless network, and the actuator continuously drives the air conditioner to operate based on the most recently successfully received control signal.

[0003] However, in a wireless network environment, factors such as channel contention and signal interference can cause random fluctuations in the actual data transmission interval, causing the actual operating state of the control loop to deviate from the design assumptions and affecting the stability of room temperature regulation. Summary of the Invention

[0004] This invention overcomes the shortcomings of the prior art and provides a smart home constant temperature control method and system.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is: a smart home constant temperature control method, comprising the following steps:

[0006] S1: Obtain the temperature sensing data packet with a timestamp, and calculate the age of the uplink information by combining it with the local clock;

[0007] S2: Calculate the current error signal based on the temperature value of the temperature sensing data packet and the preset target temperature;

[0008] S3: Determine whether the age of the uplink information exceeds the dynamic threshold; if so, generate a virtual error using the first-order inertial pure time delay model of the controlled object identified offline in advance, and reconstruct the differential term based on the virtual error and the current error signal; otherwise, calculate the differential term using the current error signal and the historical error signal stored in the previous control cycle.

[0009] S4: Calculate the integral forgetting factor based on the age of the uplink information, and update the integral accumulator using the integral forgetting factor and the mixed error signal under the trigger of a timer interrupt to generate an integral term;

[0010] S5: Superimpose the proportional, derivative, and integral terms and perform amplitude limiting to generate a control signal;

[0011] S6: Send the control signal to the actuator and adjust the integral forgetting factor based on the continuous absence of the downlink confirmation signal received from the actuator.

[0012] Preferably, in step S3, the dynamic threshold is set to 1.2 to 1.5 times the nominal sampling period; the transfer function of the first-order inertial pure time-delay model of the controlled object is expressed as follows: ,in The steady-state gain of the controlled object. The pure time delay of the controlled object. The time constant of the controlled object. For the Laplace operator.

[0013] Preferably, in step S3, generating virtual error using a first-order inertial pure time-delay model of the controlled object includes: calculating the number of virtual recursion steps. ,in The age is the information sent to the upstream supplier. The nominal sampling period is used; the first-order inertial pure time delay model of the controlled object is converted into a discrete state-space form, starting from the state vector corresponding to the historical error signal at that moment, and... Step size execution By iterating through the state, the virtual error is obtained.

[0014] Preferably, in step S4, the formula for calculating the integral forgetting factor is: ,in For the integral forgetting factor, The age is the information sent to the upstream supplier. For the nominal sampling period, The information age breakpoint is set at 4 times the nominal sampling period.

[0015] Preferably, in step S4, the method for selecting the mixed error signal is as follows: if the age of the uplink information is less than or equal to the dynamic threshold, the current error signal is selected as the mixed error signal; if the age of the uplink information is greater than the dynamic threshold, the virtual error is selected as the mixed error signal.

[0016] Preferably, in step S4, the recursive update formula for the integral accumulator is: ,in For integration accumulator, For the integral forgetting factor, It is a mixed error signal. The nominal sampling period is given; the integral term is calculated as follows: ,in Output the integral term. This is the integral gain.

[0017] Preferably, in step S3, when the age of the uplink information does not exceed the dynamic threshold, the formula for calculating the differential term is: When the age of the uplink information exceeds the dynamic threshold, the differential term is calculated as follows: ;in Output the differential term. For differential gain, This is the current error signal. This is a historical error signal. This is a virtual error. This is the nominal sampling period.

[0018] Preferably, in step S6, adjusting the integral forgetting factor includes: when the number of consecutive downlink confirmation failures exceeds a preset threshold, forcibly setting the integral forgetting factor to zero until a valid downlink confirmation signal is received again, and then restoring the integral forgetting factor calculated based on the uplink information age.

[0019] Preferably, the method for counting the number of consecutive downlink acknowledgment failures is as follows: start a timeout timer for each sent control command frame; if the corresponding Media Access Control layer acknowledgment frame is received before the timeout timer overflows, the consecutive acknowledgment failure counter is cleared to zero; if the corresponding Media Access Control layer acknowledgment frame is not received when the timeout timer overflows, the consecutive acknowledgment failure counter is incremented by 1.

[0020] Another technical solution provided by the present invention: a smart home constant temperature control system, used to implement the above method, comprising:

[0021] The smart sensor node is configured to collect temperature data at a fixed sampling period, generate a local timestamp, and send the temperature sensing data packet carrying the temperature value and the local timestamp through a wireless network.

[0022] The smart home gateway, connected to smart sensor nodes via a wireless network, includes: an information age assessment module for receiving temperature sensing data packets, parsing local timestamps, and calculating the age of uplink information using the gateway's local clock; a current error calculation module for acquiring temperature values ​​and calculating the current error signal using a preset target temperature; a differential term reconstruction module configured to determine whether the age of uplink information exceeds a dynamic threshold, and if so, generate a virtual error using a pre-identified offline first-order inertial pure time delay model of the controlled object to reconstruct the differential term; an integral term reconstruction module configured to calculate an integral forgetting factor based on the age of uplink information, and update the integral accumulator using the integral forgetting factor and a mixed error signal to generate an integral term under timed interrupt triggering; and a control signal generation module for superimposing and limiting the proportional, differential, and integral terms to generate a control signal.

[0023] The wireless air conditioner controller is connected to the smart home gateway via a wireless network. It is configured to receive control signals and convert them into air conditioner control commands, and to reply with a media access control layer confirmation frame for successfully received control signals.

[0024] The integral term reconstruction module is also configured to adjust the integral forgetting factor based on the continuous absence of confirmation frames from the media access control layer of the wireless air conditioning controller.

[0025] This invention explicitly incorporates the timeliness of temperature sensing data into the operational structure of the proportional-integral-derivative control law, and adaptively reconstructs the calculation basis of the derivative and integral terms in relation to the information age. This fundamentally compensates for the inconsistency in time scales among the operational stages in the control loop caused by the fluctuation of wireless network transmission delay, and has the following beneficial effects:

[0026] In step S3, when the age of the uplink information exceeds the dynamic threshold, the first-order inertial pure time-delay model of the controlled object, which was previously identified offline, is retrieved. Virtual state recursion is performed starting from the state space vector corresponding to the historical error signal and using the nominal sampling period as the step size, generating the virtual error corresponding to the nominal sampling time. Step S3 utilizes the dynamic characteristic of the controlled object's own thermal inertia dominating the room temperature evolution during periods without external control input changes. The error change component contributed by the zero-input response of the controlled object during long time delays is removed from the differential operation, restoring the output of the differential term to the error change rate mainly caused by external disturbances at the nominal sampling period scale. Compared to directly performing differential operations with the abnormally lengthened actual sampling interval, the reconstructed differential term avoids incorrectly identifying the system inertial response over long periods as an instantaneous change rate due to time base distortion, thereby suppressing the differential shock caused by sampling interval jumps.

[0027] In step S4, by switching the triggering timing of the integral accumulation operation from relying on data packet arrival events to a timed interrupt generated at a fixed period, the equal step size prerequisite necessary for discrete summation to approximate continuous-time integration is restored. Simultaneously, through the linear decay mapping relationship established between the uplink information age and the integral weight using the integral forgetting factor, the accumulation area of ​​the integrator at each step is proportionally compressed as the freshness of the temperature-sensing data decreases. When the uplink information age reaches the information age breakpoint, the integral accumulation operation is completely suspended, fundamentally preventing the unidirectional growth of integral energy caused by the continuous accumulation of outdated errors. Step S4 retains the ability of the integral stage to eliminate steady-state error while avoiding the destructive impact of integral saturation on control stability during long network delays.

[0028] In step S6, by continuously monitoring the reception status of confirmation frames from the media access control layer of the actuator, the integral forgetting factor is forcibly set to zero when the number of consecutive confirmation failures exceeds a preset threshold, thereby achieving coordination between the downlink communication domain state and the control domain integral energy management logic. Step S4 adjusts the integral accumulation intensity based on the freshness of uplink data, and step S6 provides independent integral latch-up protection when the downlink command is unreachable. Both steps constrain the integral energy from the two dimensions of uplink perception and downlink execution, forming a complete protection against bidirectional network uncertainty, enabling the control law to maintain stable regulation of the controlled temperature when wireless network communication conditions deteriorate. Attached Figure Description

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

[0030] Figure 1 This is a flowchart of a smart home constant temperature control method;

[0031] Figure 2 This is an architecture diagram of a smart home temperature control system. Detailed Implementation

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

[0033] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein. Therefore, the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0034] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the scope of protection of this application. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0035] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art will understand the specific meaning of the above terms in this application based on the specific circumstances.

[0036] Application Overview:

[0037] In feedback control systems based on wireless networks, network service quality degradation causes drastic time-varying and stochastic increases in the end-to-end delay of uplink sensor data and downlink control commands, transforming the control system, originally based on a fixed sampling interval, into a time-varying system. The standard proportional-integral-derivative (PID) algorithm's derivative and integral terms are both based on a constant time step. The derivative term approximates a continuous rate of change by the ratio of adjacent error differences to the nominal sampling period, while the integral term approximates continuous integration by discretely summing the error over an equal time step. When the actual information age is much larger than the nominal sampling period, the time base of the derivative operation becomes distorted, and the integral operation, in the absence of effective feedback, may accumulate errors in both direction and amplitude that deviate from the actual required error energy. These two types of distortion together lead to a structural deviation between the control output's corrective effect and the system's true requirements, potentially causing periodic low-frequency oscillations in the controlled temperature.

[0038] This invention combines the restoration of perceived data based on the age of reported information with integral forgetting. Within the proportional-integral-derivative control framework, it performs predictive compensation and reconstruction of the outdated error signal at the controller input based on the dynamic model of the controlled object, and applies a quantitative attenuation to the accumulated energy of the integral link that is related to the freshness of the data. Under the condition of network communication delay fluctuations, it maintains the time consistency of each operation link of the control law, thereby overcoming the problem of control loop instability caused by information age deterioration.

[0039] Exemplary method:

[0040] like Figure 1 As shown, a smart home thermostat control method includes the following steps:

[0041] S1: Obtain the temperature sensing data packet with a timestamp, and calculate the age of the uplink information by combining it with the local clock;

[0042] S2: Calculate the current error signal based on the temperature value of the temperature sensing data packet and the preset target temperature;

[0043] S3: Determine whether the age of the uplink information exceeds the dynamic threshold; if so, generate a virtual error using the first-order inertial pure time delay model of the controlled object identified offline in advance, and reconstruct the differential term based on the virtual error and the current error signal; otherwise, calculate the differential term using the current error signal and the historical error signal stored in the previous control cycle.

[0044] S4: Calculate the integral forgetting factor based on the age of the uplink information, and update the integral accumulator using the integral forgetting factor and the mixed error signal under the trigger of a timer interrupt to generate an integral term;

[0045] S5: Superimpose the proportional, derivative, and integral terms and perform amplitude limiting to generate a control signal;

[0046] S6: Send the control signal to the actuator and adjust the integral forgetting factor based on the continuous absence of the downlink confirmation signal received from the actuator.

[0047] The following is a detailed explanation of each step.

[0048] In step S1, a temperature sensing element deployed in the bedroom continuously collects analog data of the ambient air temperature at a fixed sampling period. The analog temperature signal is then converted into a discrete digital value by an on-chip analog-to-digital converter to generate the temperature value corresponding to the sampling time. The fixed sampling period is between 30s and 300s.

[0049] After generating the temperature value, the current time value of the high-precision clock source inside the temperature sensor is read and used as the local timestamp for this sampling. A one-to-one binding relationship is established between the local timestamp, the generated temperature value, and the sampling sequence number. The timing resolution of the local timestamp is 1 second. By synchronously latching the sampling time and the temperature value, each discrete temperature value carries a timestamp indicating the time of its generation, resulting in a sampling data unit with time-sensitive attributes.

[0050] After obtaining the sampling data unit, the temperature value bound to the same sampling sequence number, the local timestamp, and the sensor node address information are encapsulated into a temperature sensing data packet conforming to the protocol specification. This temperature sensing data packet is then sent to the smart home gateway's wireless transceiver interface via the sensor node's wireless transceiver interface. The effective payload length of the temperature sensing data packet does not exceed 128 bytes.

[0051] The smart home gateway's wireless transceiver interface continuously listens to the wireless channel, receiving temperature sensing data packets from the sensor nodes. It then performs protocol parsing and integrity verification on the received temperature sensing data packets. Upon successful verification, it extracts the temperature value corresponding to the sampling sequence number from the temperature sensing data packet. With local timestamp ,in is the sampling sequence number, which is a non-negative integer.

[0052] After extracting the temperature value and timestamp, read the current time value of the gateway's local clock at the moment the data packet parsing is completed. Calculate the age of the upstream information according to the following formula. : In the formula, Age is the information sent upstream, in seconds (s). The current time value of the gateway's local clock, in seconds; For the first The local timestamp of the sensor corresponding to each sample, in seconds.

[0053] By using linear interpolation, the total time interval between the sensor's generation of temperature sampling data and the gateway's reception is quantified into a scalar metric. This total time interval includes the sensor node's internal processing latency, the medium access layer's random backoff latency, and the wireless transmission latency. Through this calculation, the temperature value, which originally only represented the environmental state, is transformed into a scalar metric. It possesses a metric label that characterizes the freshness of its information, forming a binary pair containing a temperature value and the age of the upstream information. This completes the mapping from transmission latency in the communication domain to data freshness measurement in the control domain.

[0054] In practice, temperature sensor nodes are deployed on walls in bedrooms where there is no direct sunlight or heat source. An analog-to-digital converter integrated within the sensor node acquires and digitizes the room temperature analog signal, and a high-precision clock source provided by an on-chip temperature-compensated crystal oscillator generates a sampling timestamp. The temperature value and timestamp are encapsulated into a protocol data packet and sent to the smart home gateway via a wireless transceiver module. The smart home gateway's wireless transceiver interface is configured to use the same communication channel as the sensor node to receive the temperature sensing data packet. Within the gateway's processing unit, protocol parsing and integrity verification of the data packet are performed. Upon successful verification, the temperature value and timestamp are extracted, and the gateway's local real-time clock value, calibrated using a clock synchronization protocol, is read synchronously. The difference between the temperature value and the uplink information age is calculated within the processing unit. The generated temperature value and uplink information age tuple are stored in the gateway's memory buffer for subsequent steps.

[0055] In step S2, the tuple containing the temperature value and the uplink information age generated in step S1, generated in step S1, is read from the gateway's memory buffer. Extract the temperature value corresponding to this sampling from the binary tuple. .

[0056] After the temperature value is extracted, the pre-stored target temperature is retrieved from the gateway's non-volatile storage unit. , with target temperature The minuend is the temperature value extracted in this study. To subtract, perform the difference operation to generate the current error signal. Target temperature The settable temperature range is 16℃ to 30℃.

[0057] Current error signal The formula for calculation is: In the formula, This is the current error signal, in °C. The target temperature is expressed in °C. For the first The temperature value corresponding to each sample, in °C.

[0058] The difference operation converts the deviation between the actual state and the desired state of the controlled object into a signed scalar deviation value. The symbol indicates the direction in which room temperature deviates from the target value. The amplitude indicates the degree to which the room temperature deviates from the target value. Regardless of the age of the uplink information obtained in step S1. Within what range? These are all the latest direct measurements available at the current point in time that reflect the deviation between the actual temperature of the controlled object and the target temperature.

[0059] Generate current error signal Then, the pre-allocated error history buffer in memory is updated. The error history buffer is a fixed-length memory area used to store the error signals of the current control cycle and the previous control cycle. The update operation includes first moving the error value stored in the error history buffer from the previous control cycle to the historical error storage address, as the historical error signal. Then, the current error signal generated this time... Write the current error storage address to complete the buffer status refresh.

[0060] After this processing, the error history buffer maintained... and This constitutes a pair of temporally adjacent error signals, providing deviation data with a clear temporal dependency for subsequent differential term operations, and simultaneously providing the current deviation input for proportional term operations.

[0061] In practice, the binary data generated in step S1 is loaded into the memory buffer of the smart home gateway processing unit, and the temperature value is extracted from it. The target temperature is read from the gateway's non-volatile storage unit through the storage interface. The two sets of values, the current temperature and the target temperature, are loaded into the processing unit's arithmetic unit to perform a difference operation, generating a current error signal. Within the processing unit's address space, an atomic operation instruction accesses the pre-allocated error history buffer. First, the existing current error value in the buffer is transferred to the historical error storage unit. Then, the generated current error signal is written to the current error storage unit, completing the buffer's state update. The updated current error signal and the historical error signal are stored in a designated memory address for subsequent steps to access.

[0062] In step S3, the uplink information age obtained in step S1 is retrieved from the gateway's memory buffer. Simultaneously, it retrieves the preset dynamic threshold from the gateway's non-volatile storage unit. ,Will and Execute size comparison and determination. Dynamic threshold. The value is the nominal sampling period. 1.2 to 1.5 times.

[0063] Based on the comparison and judgment results, step S3 is performed in two ways to generate differential terms.

[0064] The first route, when This indicates that the uplink latency of the temperature sensing data packets is within a tolerable range, and the actual sampling interval is within the nominal sampling period. The deviation did not exceed the preset limit. At this time, the current error signal generated in step S2 is retrieved from the gateway's memory buffer. Compared with historical error signals Retrieve the preset differential gain from the non-volatile memory cell. After performing the following standard, the differential term is generated by the difference operation. :

[0065] In the formula, Output is the differential term, in °C; The differential gain is expressed in seconds (s). This is the current error signal, in °C. Historical error signal, unit: °C; The nominal sampling period is expressed in seconds (s).

[0066] Standard difference calculation is based on the ratio of the difference in error values ​​between two adjacent samples to the nominal sampling period, approximating the continuous rate of change of the error signal over a time period. When the actual sampling interval is... Deviation at Within the limits, the rate of change obtained by approximate calculation can reflect the true trend of error signal change, and the differential term output can provide the control loop with a correction component that matches the error change rate.

[0067] The second route, when This indicates that the temperature sensing data packet experienced an uplink delay exceeding the preset limit, and the actual sampling interval differed from the nominal sampling period. The deviation has led to the first The second sampling and the first The time span between samplings deviated significantly. If at this point we still use As a time base pair Performing a difference operation yields a result that reflects the average rate of change over a significantly lengthened time period between two sampling points, rather than the nominal sampling period. The instantaneous rate of change at the scale. Replacing the instantaneous rate of change with the average rate of change in the control law will cause a structural deviation between the magnitude of the differential term and the actual required correction.

[0068] Under these conditions, the first-order inertial pure time-delay model of the controlled object, pre-identified offline, is retrieved from the gateway's non-volatile storage unit. Its transfer function is expressed as:

[0069] In the formula, The Laplace domain transfer function for the controlled object; The steady-state gain of the controlled object is dimensionless. The pure time delay of the controlled object is expressed in seconds (s). The time constant of the controlled object, in seconds; For the Laplace operator.

[0070] The controlled object refers to the overall thermodynamic process consisting of the air conditioner actuator, the bedroom interior space and its internal air and wall heat capacity, and the indoor and outdoor heat exchange path. It receives the cooling or heating output of the air conditioner as input and responds to changes in the bedroom interior temperature.

[0071] In the initial deployment phase, the first-order inertial pure time-delay model of the controlled object was obtained offline using the least squares method by applying a step control input to the air conditioner and recording the room temperature response sequence. , , The data is stored in a non-volatile memory unit. The first-order inertial pure time-delay model of the controlled object describes the dynamic response characteristics of the room temperature under the action of the air conditioning control input. During the time period without changes in external active control input, the evolution of the room temperature is determined by the thermal inertia of the controlled object itself, and the dynamic characteristics of its own thermal inertia are determined by... and Characterized by two parameters.

[0072] After retrieving the model parameters, calculate the virtual recursion steps using the following formula. :

[0073] In the formula, The virtual recursion step number is dimensionless and is a non-negative integer. This is a floor function; Age is the information sent upstream, in seconds (s). The nominal sampling period is expressed in seconds (s).

[0074] The first-order inertial pure time-delay model of the controlled object is converted into a discrete state-space form to obtain the corresponding state-space representation. The historical error signal provided in step S2 is used as the basis for this representation. Taking the system state vector within the state-space representation at the corresponding time point as the starting point for recursion, and using the nominal sampling period... For the recursive step size, execute Step-by-step state recursion. During the recursion process, it is assumed that there are no new external control input changes within the time interval, meaning the controlled object's evolution is solely governed by its own thermal inertia. After the recursion is completed, the virtual error is obtained. Virtual error It is based on the dynamic characteristics of the controlled object itself, The predicted value of the error state that the controlled object should have at the end of the time period and the corresponding nominal sampling time.

[0075] Obtain virtual error Then, the differential gain is retrieved from the non-volatile memory cell. Combined with the current error signal generated in step S2 Perform the following reconstructed difference operation to generate the differential term. :

[0076] In the formula, Output is the differential term, in °C; The differential gain is expressed in seconds (s). This is the current error signal, in °C. The virtual error obtained from the model recursion is expressed in °C.

[0077] Reconstruct the difference operation with the current actual sampling error The virtual error that the controlled object should reach due to its own inertial evolution. The difference is used as the difference object, with the nominal sampling period. It uses a fixed time base. Because... Included The total contribution of the controlled object's own inertia to the error change within a time period, the difference. This corresponds to the error variation component primarily caused by external disturbances within the time period. The difference is... By performing the difference operation, the resulting rate of change approximately recovers the rate of change of error caused by external disturbances at the nominal sampling period scale, thus protecting the differential term output from the structural bias introduced by the abnormally long sampling interval.

[0078] After completing the differential term calculation for one of the two paths mentioned above, the current error signal used in this operation will be... Assigned to historical error signal The error history buffer maintained in step S2 completes the state update. Differential term It is written to the gateway's designated memory buffer and output to subsequent processing steps.

[0079] In practice, the uplink information age generated in step S1, along with the current and historical error signals generated in step S2, are loaded into the memory buffer of the processing unit. The preset dynamic threshold, differential gain, nominal sampling period, and controlled object model parameters obtained offline are retrieved from the non-volatile storage unit via the storage interface. , , The arithmetic unit of the processing unit executes first. and The comparison operation. When the comparison result is When the comparison result is... At that time, the virtual recursive step count is calculated in the arithmetic unit, using the system state vector inside the state space representation corresponding to the historical error signal as the initial value, and... The step size is determined by the state-space recursive solver. The process involves a step-by-step recursion, generating a virtual error and then performing a reconstruction difference operation to generate the differential term. After the differential term is generated, atomic operation instructions are used to update the contents of the error history buffer in memory, writing the differential term to a specified memory address for subsequent steps to access.

[0080] In step S4, the gateway's timer unit is configured, and the timer unit operates at a fixed period. Generate an interrupt request signal. The value is the same as the fixed sampling period in step S1. Each trigger of the interrupt request signal constitutes one execution opportunity for the integral accumulation operation, and the update step size of the integral accumulation operation is thus strictly consistent with the preset operation period of the control law. When the integral update is triggered by the arrival of the data packet, the update step size follows the age of the uplink information. The fluctuations in the integral make it a time-varying variable, thus violating the constant step-size assumption upon which discrete summation approximates continuous integrals rely. Anchoring the integral update to a timer interrupt restores the update step-size to a constant value. This allows discrete summation to re-establish an approximate relationship for continuous-time integrals.

[0081] The following process is executed each time an interrupt request signal is triggered.

[0082] Retrieve the uplink information age that was most recently updated and stored in step S1 from the gateway's memory buffer. Simultaneously, the preset nominal sampling period is retrieved from the gateway's non-volatile storage unit. Information age breakpoint Calculate the integral forgetting factor using the following formula. :

[0083] In the formula, is the integral forgetting factor, which is dimensionless and takes values ​​in the range [0,1]. Age is the information sent upstream, in seconds (s). The nominal sampling period is expressed in seconds (s). Information age breakpoint, in seconds. The value is .

[0084] The computational expression constructs a formula based on A linear decay mapping with independent variable and range [0,1]. When Approaching hour, Approaching 1; when In to When the interval is, It decays linearly from 1 to 0; when Greater than or equal to hour, The clamp is set to 0. The data freshness, represented by the age of the uplink information, is transformed into weighting coefficients for the integral accumulation operation through mapping. The longer the uplink delay experienced by the temperature sensing data packet, the weaker the ability of the carried temperature value to represent the true state of the currently controlled object; therefore, the contribution weight of the obtained error signal to the integral accumulation should be reduced accordingly. Pick This means that when the age of the uplink information reaches four times the nominal sampling period, the sampled data is considered to have lost its ability to effectively represent the current state, and the integration accumulation is completely suspended.

[0085] After completing the integral forgetting factor calculation, retrieve the most recently updated uplink information age from the gateway's memory buffer (step S1). The dynamic threshold used in step S3 Perform a size comparison. If Then select the current error signal generated in step S2. As a mixed error signal ;like Then select the virtual error generated in step S3. As a mixed error signal Dynamic threshold The value of is consistent with that in step S3, which is The integral and derivative inputs are 1.2 to 1.5 times higher than the original values. The selection operation keeps the integral and derivative inputs synchronized on the error baseline: when the data freshness is within a tolerable range, both integral and derivative operations are performed based on the actual measured current error signal; when the data freshness exceeds the threshold, both integral and derivative operations switch to operations based on the virtual error predicted by the controlled object model.

[0086] Select mixed error signal Then, the integral accumulator stored in the previous interrupt cycle is retrieved from the gateway's memory buffer. Historical values, retrieve integral forgetting factor Mixed error signals and nominal sampling period Perform the recursive update of the integral accumulator as follows:

[0087] In the formula, For integral accumulator, unit is ℃·s; For assignment / update operations; The integral forgetting factor is dimensionless. This is a mixed error signal, in °C. The nominal sampling period is expressed in seconds (s).

[0088] The above recursive formula is the continuous-time error integral. The weighted rectangular integral approximation. The standard rectangular integral accumulates within each time step. The area of ​​the rectangle. Introducing... Then, the area accumulated at each step is multiplied by a weighting coefficient determined by data freshness. This is done when network transmission conditions are normal. hour, The weighted rectangular integral degenerates into a standard rectangular integral, and the integrator accumulates the error area with a full step size. When As the data grows larger and becomes outdated, Attenuation occurs as the accumulated error area is proportionally compressed at each step, gradually diluting the existing accumulation in the integral accumulator. When achieve hour, With zero updates, the accumulator pauses its growth, fundamentally preventing the continuous one-way accumulation of points energy that may be caused by outdated data.

[0089] After completing the recursive update of the integral accumulator, the updated... Write back to the memory buffer, overwriting the existing historical value. Retrieve the preset integral gain from the gateway's non-volatile storage unit. Calculate the integral term using the following formula. :

[0090] In the formula, Output as an integral term, in °C; This is the integral gain, in units of s⁻¹; For the updated integral accumulator, the unit is °C·s.

[0091] The above linear proportional operation converts the accumulated error time in the integral accumulator into a correction component that matches the dimensions of other branches of the control law. Through this process, the integral stage completes the entire calculation from error input to integral correction output, and the integral term... It is written to the gateway's designated memory buffer and output to subsequent steps.

[0092] In practical implementation, the gateway's timer unit is configured to... Interrupt requests are periodically generated, and the interrupt service routine is configured with the highest preemptible priority of the processing unit. Each time an interrupt is triggered, within the interrupt service routine, the latest uplink information age updated and stored in step S1 is retrieved from the processing unit's memory buffer, and the nominal sampling period and information age breakpoint parameters are retrieved from the non-volatile storage unit. The calculation and clamping of the integral forgetting factor are then performed in the processing unit's arithmetic unit. Subsequently, the comparison result between the uplink information age and the dynamic threshold is retrieved, the corresponding mixed error signal is selected, the value of the integral accumulator stored in the previous cycle is read from memory, a weighted recursive update is performed, and the updated integral accumulator value is written back to the specified memory address. The integral gain is retrieved and multiplied with the updated integral accumulator value to generate an integral term, which is then written to the processing unit's output buffer for subsequent steps.

[0093] In step S5, the current error signal generated in step S2 is retrieved from the gateway's memory buffer. Simultaneously, a preset proportional gain is retrieved from the gateway's non-volatile storage unit. Calculate the proportional term using the following formula. :

[0094] In the formula, This is the proportional output, in Hz. This is the proportional gain, expressed in Hz / ℃. The current error signal generated in step S2 is expressed in °C.

[0095] The linear proportional operation described above converts the instantaneous deviation between the actual temperature and the target temperature of the controlled object at the current moment into an instantaneous correction component with the same dimensions as the control output. The amplitude of the proportional term output is proportional to the amplitude of the error signal, and the correction direction is opposite to the error deviation direction, forming the basic correction branch in the control law that provides an instantaneous response to the deviation.

[0096] After the proportional term calculation is completed, the differential term generated in step S3 is retrieved from the gateway's memory buffer. The integral term generated in step S4 , the proportional term Differential term With integral terms Perform a linear superposition and summation operation to generate the initial control quantity. :

[0097] In the formula, The original control quantity is expressed in Hz. This is the proportional output, in Hz. The output of the integral term generated in step S4, in Hz; The output of the differential term generated in step S3, in Hz.

[0098] The above linear superposition merges the correction branches of three independent operations into a single control output. (Proportional term) Provides immediate correction based on the current deviation, integral term Based on the time accumulation of error, a correction is provided to eliminate steady-state error; the differential term... The system provides corrections to suppress dynamic overshoot based on the trend of error changes. The three correction branches converge at a unified summation node to form a complete proportional-integral-derivative control law output.

[0099] Generate raw control quantity Then, the preset minimum operating frequency of the compressor is retrieved from the gateway's non-volatile storage unit. With maximum operating frequency For the original control quantity Perform saturation limiting processing to generate control signals. :

[0100] In the formula, For control signals, the unit is Hz; This is a saturation limiting function, defined as: when the input value is less than... The output is equal to When the input value is greater than The output is equal to When the input value is between and When the output equals the input value, the output value is equal to the input value. The original control quantity is expressed in Hz. The minimum permissible operating frequency of the compressor, in Hz; This is the maximum permissible operating frequency of the compressor, measured in Hz.

[0101] Saturation limiting processing maps the unconstrained raw control quantity to the allowable operating frequency range of the air conditioning compressor. When the raw control quantity is within... to When the control signal is within the range, the limiting function keeps the original control value unchanged; when the original control value exceeds the range, the limiting function truncates it to the corresponding boundary value to ensure the final output control signal. Always the operating frequency value at which the actuator can respond.

[0102] After this processing, the three independent correction branches, after being superimposed, fused, and constrained by boundaries, generate a frequency adjustment command that can be directly executed by the air conditioning actuator. Step S5 completes the full conversion from error signal to execution command. Control signal It is written to the gateway's designated memory buffer and output to subsequent steps.

[0103] In specific implementation, the current error signal generated in step S2, the differential term generated in step S3, and the integral term generated in step S4 are loaded into the processing unit's calculation buffer. Preset proportional gain, compressor minimum operating frequency, and maximum operating frequency parameters are retrieved from the non-volatile memory unit via the storage interface. In the processing unit's calculation unit, the proportional term is first multiplied, and then the proportional, differential, and integral terms are linearly superimposed and summed to generate the original control quantity. Based on the retrieved minimum and maximum operating frequency parameters, saturation limiting processing is performed on the original control quantity in the calculation unit, truncating values ​​exceeding the boundary range to the corresponding boundary values ​​to generate a control signal. This control signal is written into the processing unit's transmission buffer for subsequent steps.

[0104] In step S6, the control signal generated in step S5 is retrieved from the gateway's memory buffer. , control signal The non-decreasing instruction sequence number, gateway address, and target actuator address are encapsulated into a control instruction frame conforming to the protocol specification. This control instruction frame is then transmitted to the actuator via the gateway's wireless transceiver interface. The payload length of the control instruction frame does not exceed 64 bytes.

[0105] After the control command frame is sent, the gateway's wireless transceiver interface continuously monitors the Media Access Control (MAC) acknowledgment frames from the actuator. The MAC acknowledgment frame is a short frame sent by the actuator after successfully receiving and parsing the control command frame, indicating that the control command has been successfully received. The gateway starts a corresponding timeout timer for each sent control command frame, with the timeout timer duration set from 100ms to 500ms. If a MAC acknowledgment frame matching the corresponding command sequence number is received before the timeout timer expires, the value of the consecutive acknowledgment failure counter is reset to zero. If no MAC acknowledgment frame matching the corresponding command sequence number is received by the timeout timer expires, a downlink acknowledgment failure is recorded, and the value of the consecutive acknowledgment failure counter is incremented by 1.

[0106] Retrieve the preset consecutive acknowledgment failure threshold from the gateway's non-volatile storage unit. Add the current value of the consecutive failed confirmation counter to... Perform a comparison. Continuous confirmation failure threshold. The value ranges from 2 to 5.

[0107] When the value of the consecutive failed confirmation counter is less than At the same time, maintain the integral forgetting factor in step S4. The existing calculation method remains unchanged.

[0108] When the value of the consecutive failed confirmation counter is greater than or equal to This indicates that after sending multiple control commands consecutively, no confirmation response has been received from the actuator. The duration for which the control commands cannot reach the actuator has exceeded the preset range. During this period, the actuator continues to operate based on the previously received control signals, and the state evolution of the controlled object is unaffected by the currently generated control commands. Under this condition, the integral forgetting factor used in step S4 is... Forced to zero, regardless of the age of the current uplink information. Why is it worth it? After the integral forgetting factor is forcibly set to zero, the recursive update value of the integral accumulator in step S4 is... The integral accumulator becomes zero. The accumulation of error time stops, and the accumulated error time is no longer updated by new, potentially invalid error signals. This forced zeroing operation blocks the path for the integral element to continue accumulating correction energy based on error signals whose validity cannot be verified while the control command remains unacknowledged.

[0109] With the integration forgetting factor forcibly set to zero, the gateway continues to send subsequent control command frames and monitors the corresponding Media Access Control (MAC) acknowledgment frames. Upon receiving a valid MAC acknowledgment frame corresponding to any control command frame, the gateway immediately resets the consecutive acknowledgment failure counter to zero, thus releasing the integration forgetting factor. The forced zeroing state, recovery step S4 based on the age of the uplink information The complete logic of the integrator accumulator is updated by performing calculations and selecting a mixed error signal based on the comparison results. The receipt of a valid medium access control layer confirmation frame indicates that the control command has been successfully delivered to the actuator again, the control intent has resumed its effective action on the controlled object, and the integrator can resume error accumulation based on valid feedback.

[0110] In specific implementation, the control signal generated in step S5 is loaded into the transmission buffer of the processing unit. A non-decreasing instruction sequence number is assigned to each control instruction. The control instruction frame is encapsulated according to the protocol specification and sent to the actuator through the wireless transceiver interface. In the processing unit, a corresponding timeout timer is started for each transmitted control instruction frame. In the interrupt service routine or high-priority task, the Media Access Control Layer (MAC) acknowledgment frames received by the wireless transceiver interface are continuously parsed. After matching the instruction sequence number, the value of the continuous acknowledgment failure counter is updated. The continuous acknowledgment failure threshold is retrieved from the non-volatile storage unit, and a comparison operation between the continuous acknowledgment failure counter value and the threshold is performed in the arithmetic unit of the processing unit. When the comparison result meets the forced zeroing condition, the integral forgetting factor variable stored in memory is set to zero through an atomic operation instruction. In the forced zeroing state, the reception status of the MAC acknowledgment frames is continuously monitored. When a valid acknowledgment frame is received, the continuous acknowledgment failure counter is immediately cleared, the forced zeroing state of the integral forgetting factor is released through an atomic operation instruction, and the integral forgetting factor calculation logic in step S4 is restored.

[0111] Exemplary system:

[0112] like Figure 2 As shown, a smart home constant temperature control system for implementing the above method includes a smart sensor node, a smart home gateway, and a wireless air conditioner controller.

[0113] The smart sensor node is configured to collect temperature data at a fixed sampling period, generate a local timestamp, and send the temperature sensing data packet carrying the temperature value and the local timestamp through a wireless network.

[0114] A smart home gateway, which connects to smart sensor nodes via a wireless network, includes:

[0115] The information age assessment module is used to receive temperature sensing data packets, parse the local timestamp, and calculate the age of the uplink information in combination with the gateway's local clock.

[0116] The current error calculation module is electrically connected to the information age assessment module. It is used to obtain temperature values ​​from the information age assessment module, calculate the current error signal in combination with the preset target temperature, and maintain the historical error signals in the error history buffer.

[0117] The differential term reconstruction module is electrically connected to the information age assessment module and the current error calculation module. It is configured to determine whether the age of the uplink information exceeds the dynamic threshold. If it does not exceed the threshold, the differential term is calculated using the current error signal and the historical error signal. If it exceeds the threshold, a virtual error is generated using the first-order inertial pure time delay model of the controlled object identified offline in advance, and the differential term is reconstructed based on the virtual error and the current error signal.

[0118] The integral term reconstruction module is electrically connected to the information age assessment module, the differential term reconstruction module, and the current error calculation module. It is configured to calculate the integral forgetting factor based on the uplink information age, select the mixed error signal based on the comparison result of the uplink information age and the dynamic threshold under the trigger of a timed interrupt, and update the integral accumulator using the integral forgetting factor and the mixed error signal to generate the integral term.

[0119] The control signal generation module is electrically connected to the current error calculation module, the differential term reconstruction module, and the integral term reconstruction module. It is used to calculate the proportional term, superimpose the proportional term, differential term, and integral term, and perform saturation limiting processing to generate the control signal.

[0120] The wireless air conditioner controller is connected to the smart home gateway via a wireless network. It is configured to receive control signals and convert them into air conditioner control commands, and to send a media access control layer confirmation frame back to the smart home gateway for each successfully received control signal.

[0121] The integral term reconstruction module is also configured to receive and monitor the reception status of the media access control layer acknowledgment frames from the wireless air conditioning controller, and to forcibly set the current integral forgetting factor to zero when the number of consecutive downlink acknowledgment failures exceeds a preset threshold.

[0122] Based on the preferred embodiments of the present invention described above, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A smart home constant temperature control method, characterized in that, Includes the following steps: S1: Obtain the temperature sensing data packet with a timestamp, and calculate the age of the uplink information by combining it with the local clock; S2: Calculate the current error signal based on the temperature value of the temperature sensing data packet and the preset target temperature; S3: Determine whether the age of the uplink information exceeds a dynamic threshold; If so, a virtual error is generated using the first-order inertial pure time delay model of the controlled object identified offline in advance, and the differential term is reconstructed based on the virtual error and the current error signal; otherwise, the differential term is calculated using the current error signal and the historical error signal stored in the previous control cycle. S4: Calculate the integral forgetting factor based on the age of the uplink information, and update the integral accumulator using the integral forgetting factor and the mixed error signal under the trigger of a timed interrupt to generate an integral term; S5: Superimpose the proportional term, the derivative term, and the integral term, and perform amplitude limiting processing to generate a control signal; S6: Send the control signal to the actuator, and adjust the integral forgetting factor according to the continuous absence of the downlink confirmation signal received from the actuator.

2. The method according to claim 1, characterized in that, In step S3, the dynamic threshold is set to 1.2 to 1.5 times the nominal sampling period; the transfer function of the first-order inertial pure time-delay model of the controlled object is expressed as follows: ,in The steady-state gain of the controlled object. The pure time delay of the controlled object. The time constant of the controlled object. For the Laplace operator.

3. The method according to claim 2, characterized in that, In step S3, virtual errors are generated using the first-order inertial pure time-delay model of the controlled object, including: calculating the number of virtual recursion steps. ,in The age is the information sent to the upstream supplier. The nominal sampling period is used; the first-order inertial pure time-delay model of the controlled object is converted into a discrete state-space form, starting from the state vector at the corresponding moment of the historical error signal. Step size execution The virtual error is obtained by recursively calculating the state step by step.

4. The method according to claim 1, characterized in that, In step S4, the formula for calculating the integral forgetting factor is: ,in For the integral forgetting factor, The age is the information sent to the upstream supplier. For the nominal sampling period, The information age breakpoint is defined as 4 times the nominal sampling period.

5. The method according to claim 1, characterized in that, In step S4, the selection method of the mixed error signal is as follows: if the uplink information age is less than or equal to the dynamic threshold, the current error signal is selected as the mixed error signal; if the uplink information age is greater than the dynamic threshold, the virtual error is selected as the mixed error signal.

6. The method according to claim 1, characterized in that, In step S4, the recursive update formula for the integral accumulator is: ,in For integration accumulator, For the integral forgetting factor, It is a mixed error signal. The nominal sampling period is used; the integral term is calculated as follows: ,in Output the integral term. This is the integral gain.

7. The method according to claim 1, characterized in that, In step S3, when the age of the uplink information does not exceed the dynamic threshold, the formula for calculating the differential term is: ; When the age of the uplink information exceeds the dynamic threshold, the formula for calculating the differential term is: ;in Output as the differential term. For differential gain, This is the current error signal. This is a historical error signal. This is a virtual error. This is the nominal sampling period.

8. The method according to claim 1, characterized in that, In step S6, adjusting the integral forgetting factor includes: when the number of consecutive downlink confirmation failures exceeds a preset threshold, forcibly setting the integral forgetting factor to zero until a valid downlink confirmation signal is received again, and then restoring the calculation of the integral forgetting factor based on the uplink information age.

9. The method according to claim 8, characterized in that, The method for counting the number of consecutive downlink acknowledgment failures is as follows: a timeout timer is started for each sent control command frame. If the corresponding Media Access Control (MAC) acknowledgment frame is received before the timeout timer overflows, the consecutive acknowledgment failure counter is cleared to zero. If the corresponding MAC acknowledgment frame is not received when the timeout timer overflows, the consecutive acknowledgment failure counter is incremented by 1.

10. A smart home constant temperature control system, characterized in that, For implementing the method of any one of claims 1 to 9, comprising: The intelligent sensor node is configured to collect temperature data at a fixed sampling period, generate a local timestamp, and send a temperature sensing data packet carrying the temperature value and the local timestamp through a wireless network. A smart home gateway, connected to the smart sensor node via the wireless network, includes: an information age assessment module for receiving the temperature sensing data packet, parsing the local timestamp, and calculating the uplink information age using the gateway's local clock; a current error calculation module for acquiring the temperature value and calculating the current error signal using a preset target temperature; a differential term reconstruction module configured to determine whether the uplink information age exceeds a dynamic threshold, and if so, generate a virtual error using a pre-identified offline first-order inertial pure time delay model of the controlled object to reconstruct the differential term; an integral term reconstruction module configured to calculate an integral forgetting factor based on the uplink information age, and update the integral accumulator using the integral forgetting factor and a mixed error signal to generate an integral term under a timed interrupt trigger; and a control signal generation module for superimposing and limiting the proportional term, the differential term, and the integral term to generate a control signal. The wireless air conditioner controller is connected to the smart home gateway via the wireless network and is configured to receive the control signal and convert it into an air conditioner control command, and to reply with a media access control layer confirmation frame for successfully received control signals. The integral term reconstruction module is further configured to adjust the integral forgetting factor based on the continuous absence of media access control layer confirmation frames from the wireless air conditioner controller.