A smart home remote control method based on space-time sequence prediction
Patent Information
- Application Number
- CN202610946195.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-09-25
AI Technical Summary
现有的控制方法仅能针对当前时刻、局部离散的传感器数值做出被动的“头痛医头、脚痛医脚”式响应,系统无法准确预判复杂的室内空间在未来一段时间内的全局环境状态演变趋势,导致控制策略具有严重的滞后性与被动性,极易引发室内环境参量的大幅震荡,并造成受控底层设备无效且频繁地启停切换,从而严重影响环境舒适度并产生大量的能源损耗;
[0021]1.本发明通过构建涵盖空间掩码张量与环境特征图层的受控空间特征图谱,并将其输入至设有物理滞后衰减门的时空序列预测模型中进行推演,将不同环境参量(如温湿度、空气质量)的固有物理惯性系数引入到历史特征信息的权重调节中,打破了传统控制系统仅基于当前离散数值进行局部被动响应的局限,主动预判复杂的室内物理空间在未来一段时间内的全局环境状态演变趋势,消除了传统规则触发机制中存在的严重滞后性与盲目性。
Smart Images

Figure CN122815938A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of process control technology, specifically to a smart home remote control method based on spatiotemporal sequence prediction. Background Technology
[0002] With the popularization of IoT and sensor technology, smart home systems have been widely used in modern residences, providing users with a convenient living environment management experience. Existing smart home environmental control systems typically rely mainly on threshold triggering mechanisms based on fixed rules or simple reactive feedback regulation. For example, when a temperature and humidity sensor at a certain location indoors detects that the environmental data deviates from a preset target value, the gateway directly sends an on or off command to the underlying execution device such as an air conditioner or humidifier;
[0003] However, the indoor physical environment is a highly complex spatiotemporal dynamic system. The diffusion of environmental parameters such as temperature, humidity, and air quality in the physical space exhibits significant delays, inertia, and regional coupling. Existing control methods can only provide passive, piecemeal responses to local, discrete sensor values at the current moment. The system cannot accurately predict the evolution of the complex global environmental state of the indoor space over a future period, resulting in severe lag and passivity in the control strategy. This easily leads to large fluctuations in indoor environmental parameters, causing the controlled underlying equipment to become ineffective and frequently start and stop, thus seriously affecting environmental comfort and generating significant energy consumption.
[0004] To address this, a smart home remote control method based on spatiotemporal sequence prediction is proposed. Summary of the Invention
[0005] The purpose of this invention is to provide a smart home remote control method based on spatiotemporal sequence prediction to solve the problems mentioned in the background.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A smart home remote control method based on spatiotemporal sequence prediction includes:
[0008] Collect time-series environmental data in the physical space of the smart home environment, and simultaneously acquire the operating status data of smart home execution devices in the controlled space, and upload them to the cloud via the smart home gateway;
[0009] The running status data is converted into a spatial mask tensor and injected into the environmental feature layer obtained by mapping the environmental time series data for feature fusion and spatiotemporal feature extraction to generate a controlled spatial feature map.
[0010] The controlled spatial feature map is input into a pre-trained spatiotemporal sequence prediction model to predict the state evolution sequence of the physical space of the smart home environment within a future set time window. The environment state evolution memory unit of the spatiotemporal sequence prediction model is equipped with a physical hysteresis decay gate to adjust the weight of retaining historical time step feature information. Based on the state evolution sequence, control scheduling calculation is performed to generate a smooth control sequence for the smart home execution device and send it to the smart home gateway.
[0011] The control strategy corresponding to the current time step in the smooth control sequence is extracted, parsed into a low-level device control data packet, and sent to the corresponding smart home execution device through the Internet of Things communication protocol.
[0012] Preferably, the environmental time-series data is a time-series numerical matrix constructed by aligning the continuous environmental parameters of each spatial node in the physical space of the smart home environment, which is equipped with environmental sensor devices, according to a unified timestamp within a historical time window; the continuous environmental parameters include the indoor temperature value, relative humidity value, and air quality parameter of the spatial node; the spatial node is a discrete entity location point in the physical space of the smart home environment where data is collected; the operating status data includes the real-time operating power of the smart home execution device under the time-series node corresponding to the unified timestamp and the discrete state code of the current operating mode.
[0013] Preferably, the process of converting the operating status data into a spatial mask tensor is as follows: mapping the spatial physical coordinates of each of the smart home execution devices to a preset discrete grid coordinate system to establish a basic position mask layer; and extracting the corresponding mask feature channel in the basic position mask layer according to the environmental parameter category identifier corresponding to the current operating mode in the operating status data.
[0014] Calculate the squared effective topological distance between each smart home execution device and all surrounding grid nodes (excluding its own) in the discrete grid coordinate system, taking into account the indoor physical partition features. Multiply the reciprocal of the squared effective topological distance by the real-time operating power in the operating status data to obtain the influence gradient quantization value of each surrounding grid node. Assign a preset maximum influence gradient quantization value to the grid node where the smart home execution device is located. Fill the corresponding grid node position in the mask feature channel with the influence gradient quantization value as a weight value and merge them to construct a spatial mask tensor. When there are multiple smart home execution devices, linearly superimpose the influence gradient quantization values of multiple smart home execution devices for any given grid node.
[0015] Preferably, the environmental feature layer is a multidimensional feature tensor constructed in the discrete grid coordinate system by interpolating the continuous environmental parameters of each spatial node within the historical time window according to the physical coordinates of each spatial node in the physical space of the smart home environment, and mapping them to the multidimensional feature tensor containing the time step dimension, the axial dimensions of each grid space, and the environmental parameter channel dimension; wherein, the environmental parameter channel dimension contains independent feature channels corresponding to the indoor temperature value, the relative humidity value, and the air quality parameter, respectively.
[0016] Preferably, the controlled spatial feature map is constructed by fusing the spatial mask tensor with the environmental feature layer features, mapping the grids in the discrete grid coordinate system to topological graph nodes, and mapping the spatial associations between adjacent grids to edges of the topological graph, thereby constructing an extracted spatial topological graph data structure. The nodes of the spatial topological graph data structure are each grid node in the discrete grid coordinate system, and the feature vector bound to each node contains the multidimensional hidden state values obtained by fusing the environmental parameters at the corresponding grid node position with the spatial mask tensor. The edges of the spatial topological graph data structure are the spatial association channels between the various grid nodes, and the weight value of each edge is calculated by the effective topological distance between adjacent grid nodes and the spatial diffusion adjacency of the physical environmental parameters.
[0017] Preferably, the spatiotemporal sequence prediction model includes a connected spatial graph attention encoder, an environmental state evolution memory unit, and a multi-step sequence decoder. The spatial graph attention encoder aggregates the spatial neighborhood features of the latent state features of each grid node based on the weight values of the edges in the controlled spatial feature graph. The environmental state evolution memory unit has a physical hysteresis decay gate in its gated loop mechanism. The physical hysteresis decay gate adjusts the retention weight of historical time step feature information according to the inherent physical inertia coefficient of different environmental parameters. The multi-step sequence decoder includes a graph deconvolution mapping layer, which is used to reconstruct the grid spatial dimension of the future latent state features output by the environmental state evolution memory unit, and combine it with an autoregressive mechanism to output a sequence prediction state surface, thus forming the state evolution sequence.
[0018] Preferably, the process of control scheduling calculation based on the state evolution sequence includes: calculating the temporal deviation between the predicted state surface of the sequence and the preset target environmental state, and extracting the gradient of environmental parameter changes in adjacent time steps as the state evolution trend; using the state evolution trend as the transition constraint, and minimizing the temporal deviation and the energy penalty for device state switching as the optimization objective, constructing a predictive control cost function; performing a temporal reverse solution on the predictive control cost function within the set future time window to obtain the optimal set of control variables for consecutive time steps, and splicing them in time sequence to form a smooth control sequence.
[0019] Preferably, the underlying device control data packet is a standard communication data packet generated by extracting the control strategy corresponding to the current time step, decomposing it into underlying control words according to the object model interface of the corresponding smart home execution device, combining the underlying control words with the communication identifier of the smart home execution device, and encapsulating them according to the message format of the Internet of Things communication protocol.
[0020] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0021] 1. This invention constructs a controlled spatial feature map encompassing a spatial mask tensor and an environmental feature layer, and inputs it into a spatiotemporal sequence prediction model with a physical hysteresis decay gate for deduction. The inherent physical inertia coefficients of different environmental parameters (such as temperature, humidity, and air quality) are introduced into the weight adjustment of historical feature information. This breaks the limitation of traditional control systems that only make local passive responses based on current discrete values, and actively predicts the evolution trend of the global environmental state of complex indoor physical spaces over a period of time in the future, eliminating the serious hysteresis and blindness existing in traditional rule-triggered mechanisms.
[0022] 2. This invention performs control scheduling calculations based on predicted state evolution sequences. When constructing the predictive control cost function, minimizing both timing deviations and energy penalties for device state transitions are simultaneously optimized objectives, and a time-reverse solution is performed to generate a smooth control sequence. This control mechanism directly intervenes in the control strategy of the underlying devices using strict mathematical constraints. This not only ensures that indoor environmental parameters gradually and smoothly approach the preset target, effectively avoiding large fluctuations in the environmental experience, but also, through the mathematical penalty for state transitions in the cost function, converges the divergence and abrupt changes in control commands, outputting smooth and stable underlying device control data packets, thus avoiding the defects of control logic falling into frequent flips and deadlocks.
[0023] 3. This invention successfully transforms the discrete operating states of home appliances into masked feature channels with continuous spatial physical field significance by mapping the spatial coordinates of the execution device to a discrete grid coordinate system and multiplying the inverse of the square of the effective topological distance combined with the indoor physical partition characteristics by the real-time operating power. This feature fusion method, which combines spatial topology with the physical diffusion decay law (inverse square law), endows the model with a strong three-dimensional global perception capability of the indoor thermodynamics and air fluid environment, filling the gap in existing technologies that cannot perceive the specific spatial location and physical influence range of cold / heat sources. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of a smart home remote control method based on spatiotemporal sequence prediction.
[0025] Figure 2This is a schematic diagram illustrating the process of converting runtime status data into a spatial mask tensor in this invention.
[0026] Figure 3 This is a schematic diagram of the underlying device control data packet parsing process of the present invention. Detailed Implementation
[0027] 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.
[0028] Please see Figure 1 This invention provides a smart home remote control method based on spatiotemporal sequence prediction, the technical solution of which is as follows:
[0029] A smart home remote control method based on spatiotemporal sequence prediction includes:
[0030] Collect time-series environmental data in the physical space of the smart home environment, and simultaneously acquire the operating status data of smart home execution devices in the controlled space, and upload them to the cloud via the smart home gateway;
[0031] The running status data is converted into a spatial mask tensor and injected into the environmental feature layer obtained by mapping the environmental time series data for feature fusion and spatiotemporal feature extraction to generate a controlled spatial feature map.
[0032] The controlled spatial feature map is input into a pre-trained spatiotemporal sequence prediction model to predict the state evolution sequence of the physical space of the smart home environment within a future set time window; the environment state evolution memory unit of the spatiotemporal sequence prediction model is equipped with a physical lag attenuation gate to attenuate the retention weight of historical time step feature information; based on the state evolution sequence, control scheduling calculation is performed to generate a smooth control sequence for the smart home execution device and send it to the smart home gateway.
[0033] The control strategy corresponding to the current time step in the smooth control sequence is extracted, parsed into a low-level device control data packet, and sent to the corresponding smart home execution device through the Internet of Things communication protocol.
[0034] Example 1:
[0035] Collect time-series environmental data in the physical space of the smart home environment, and simultaneously acquire the operating status data of smart home execution devices in the controlled space, and upload them to the cloud via the smart home gateway;
[0036] The environmental time-series data is a time-series numerical matrix constructed by aligning the continuous environmental parameters of each spatial node in the physical space of the smart home environment, which is equipped with environmental sensor devices, according to a unified timestamp within a historical time window. The continuous environmental parameters include the indoor temperature value, relative humidity value, and air quality parameter of the spatial node. The spatial node is a discrete entity location point in the physical space of the smart home environment where data is collected. The operating status data includes the real-time operating power of the smart home execution device under the time-series node corresponding to the unified timestamp and the discrete state code of the current operating mode.
[0037] Specifically, a three-dimensional contour boundary is obtained by scanning the physical space of the smart home environment with a laser ranging device. A three-dimensional rectangular coordinate system is established with the bottom geometric center of the three-dimensional contour boundary as the origin of the coordinate system. The three-dimensional coordinate values of each entity installation position where environmental sensor devices are deployed are recorded in the three-dimensional rectangular coordinate system. Each entity installation position with a unique three-dimensional coordinate value is marked as an independent spatial node.
[0038] The historical window construction process involves obtaining the current timestamp as the end point of the time window; continuously monitoring the air convection rate within the physical space of the smart home environment; combining this with the total volume of the space obtained from the three-dimensional contour boundary; dividing the total volume by the product of the air convection rate and the effective cross-sectional area of convection; calculating the shortest time period for the thermodynamic state of the space to complete one full diffusion exchange based on the air convection rate; determining the positive integer multiple of the shortest time period as the time window span; subtracting the time window span from the end point of the time window to obtain the start point of the time window; and constructing the historical time window from the start point to the end point of the time window. The effective cross-sectional area of convection is obtained by performing planar segmentation and feature extraction on the three-dimensional point cloud data of the physical space of the smart home environment acquired by the laser ranging device; identifying the non-closed connected regions existing within the spatial boundary plane; and calculating the sum of the projected areas of the non-closed connected regions on the corresponding boundary plane as the effective cross-sectional area of convection. The spatial boundary plane includes walls, and the non-closed connected regions include door frames and windows.
[0039] The sampling period and effective response time of each environmental sensor device are obtained, and a unified sampling period is determined according to the system configuration. The unified sampling period is not less than the upper limit of the effective response time of the environmental sensors participating in the alignment, or it is determined through sensor calibration configuration. Starting from the beginning of the historical time window, the time points are divided at equal intervals according to the sampling interval step size until the end of the time window, generating a sequence composed of multiple discrete time points. Each discrete time point in the sequence is used as a unified timestamp to form a unified timestamp sequence corresponding to the historical time window.
[0040] The continuous environmental parameters include the indoor temperature, relative humidity, and air quality parameters of the spatial node. Specifically, the air quality parameters are at least one of PM2.5 concentration, carbon dioxide concentration, or TVOC concentration. The collected raw environmental parameters are time-aligned based on the unified timestamp sequence. The implementation logic for time alignment is as follows: For any target unified timestamp in the unified timestamp sequence, in the raw environmental parameter sequence collected at a specific spatial node, the first sampled data with a sampling time earlier than the target unified timestamp and the smallest time difference, and the second sampled data with a sampling time later than the target unified timestamp and the smallest time difference, are extracted. A linear interpolation algorithm is used to calculate the estimated values of each environmental parameter of the spatial node under the target unified timestamp. The specific interpolation calculation logic satisfies the following formula:
[0041]
[0042] in, Indicates the target unified timestamp The environmental parameters (i.e., indoor temperature, relative humidity, or air quality parameters) are calculated below. and These represent the actual hardware sampling timestamps corresponding to the first and second sampled data, respectively. and They are respectively represented in the and The original environmental parameter values are actually read at each moment; the above interpolation calculation is performed by traversing all spatial nodes and all unified timestamps in sequence to obtain all aligned environmental parameters;
[0043] A multidimensional numerical matrix is constructed, mapping its row dimension to each time-series node in the unified timestamp sequence, and its column dimension to each spatial node in the spatial node set. The indoor temperature, relative humidity, and air quality parameters obtained through interpolation are filled into the corresponding row and column intersection cells of the multidimensional numerical matrix according to their corresponding timestamps and spatial coordinates, forming the time-series numerical matrix characterizing the full spatial environmental features within a historical time window. The size of the time-series numerical matrix is... ,in To standardize the sequence length of timestamps, This represents the total number of spatial nodes. Representing three environmental parameters;
[0044] At each time node fully synchronized with the unified timestamp, the instantaneous current and voltage values at the power supply interface of the smart home actuator are read by a power sensor, and the corresponding real-time operating power value is calculated by multiplying the two values. Simultaneously, the operating status machine code in the status register of the smart home actuator's microcontroller is read to generate a discrete state code for the current operating mode. The generation logic of the discrete state code is as follows: all independent operating modes supported by the smart home actuator are statistically analyzed, and a system is established that includes… A pattern classification dictionary of 1 running pattern item; construct a dictionary of length 1. The zero vector is used to retrieve the mode ranking number corresponding to the working state machine code in the mode classification dictionary. The element value of the dimension position corresponding to the ranking number in the zero vector is modified to the value 1, while the element values of the other dimension positions are kept to the value 0, so as to obtain the discrete state code of the current operating mode. The real-time operating power value under the same unified timestamp is concatenated with the discrete state code to form the operating state data.
[0045] The running status data is converted into a spatial mask tensor and injected into the environmental feature layer obtained by mapping the environmental time series data for feature fusion and spatiotemporal feature extraction to generate a controlled spatial feature map.
[0046] The process of converting the operating status data into a spatial mask tensor is as follows: mapping the spatial physical coordinates of each smart home execution device to a preset discrete grid coordinate system to establish a basic position mask layer; and extracting the corresponding mask feature channel in the basic position mask layer according to the environmental parameter category identifier corresponding to the current operating mode in the operating status data.
[0047] Calculate the squared effective topological distance between each smart home execution device and all surrounding grid nodes (excluding its own) in the discrete grid coordinate system, taking into account the indoor physical partition features. Multiply the reciprocal of the squared effective topological distance by the real-time operating power in the operating status data to obtain the quantized influence gradient value of the surrounding grid nodes. Assign a preset maximum quantized influence gradient value to the grid node where the smart home execution device is located. Fill the corresponding grid node position in the mask feature channel with the quantized influence gradient value as a weight value and merge them to construct a spatial mask tensor. When there are multiple smart home execution devices, linearly superimpose the quantized influence gradient values of multiple smart home execution devices for any given grid node. The quantized influence gradient value is used to characterize the empirical spatial influence weight of the execution device in the discrete grid space.
[0048] The environmental feature layer is constructed by interpolating the continuous environmental parameters of each spatial node within the historical time window according to the physical coordinates of each spatial node in the physical space of the smart home environment, and mapping them to a multidimensional feature tensor in the discrete grid coordinate system, which includes the time step dimension, the dimensions of each axis of the grid space, and the environmental parameter channel dimension; wherein, the environmental parameter channel dimension includes independent feature channels corresponding to the indoor temperature value, the relative humidity value, and the air quality parameter respectively.
[0049] See Figure 2 Specifically, the three-dimensional boundary contour size data of the physical space of the smart home environment is obtained, and the side length of the minimum space control unit determined by the control accuracy requirements is obtained as the grid division step size; the three-dimensional boundary contour size data is divided by the grid division step size, and the continuous space in which the physical space of the smart home environment is located is discretized into a three-dimensional matrix to establish a three-dimensional discrete grid coordinate system containing row index, column index and height index;
[0050] The actual three-dimensional physical coordinates of each smart home execution device in the physical space of the smart home environment are obtained. The three-axis components of the actual three-dimensional physical coordinates are divided by the mesh division step size and rounded down to calculate the three-dimensional index of the specific mesh node corresponding to each smart home execution device in the three-dimensional discrete mesh coordinate system. The base position mask layer is established by setting the value at the three-dimensional index of the specific mesh node as the feature activation value in a three-dimensional all-zero tensor with the same dimension as the three-dimensional discrete mesh coordinate system.
[0051] The operating status data is parsed to extract the discrete state code of the current operating mode; the underlying device protocol mapping table is queried to obtain the environmental parameter category identifier bound to the discrete state code. In the basic location mask layer, based on the obtained environmental parameter category identifier, a single-dimensional feature channel that perfectly matches the identifier is activated and extracted from the feature channel set containing indoor temperature, relative humidity, and air quality dimensions, and used as the mask feature channel;
[0052] The system acquires 3D point cloud mapping data of the indoor building of the smart home environment, extracts the 3D coordinates of solid obstructions such as walls and closed doors and windows, and marks the corresponding coordinates as impassable obstacle nodes in the 3D discrete grid coordinate system. Using the grid node where each smart home execution device is located as the starting search node, it traverses all surrounding grid nodes in the 3D discrete grid coordinate system except the starting search node as target nodes. In the 3D discrete grid coordinate system containing the impassable obstacle nodes, a graph search-based shortest path planning algorithm (such as Dijkstra's algorithm or A* pathfinding algorithm) is used to calculate the actual connected path length to each target node, avoiding the impassable obstacle nodes, and uses this as the effective topological distance. If a target node is completely blocked by an impassable obstacle node and cannot be reached, its effective topological distance is set to infinity.
[0053] The corresponding real-time operating power value is obtained by parsing the operating status data. For each of the surrounding grid nodes, the calculation formula is as follows:
[0054]
[0055] in, For the first The quantized value of the influence gradient of each surrounding grid node, The extracted real-time operating power, The corresponding effective topological distance is calculated. Through the above calculations, the quantized values of the influence gradients of all surrounding grid nodes are obtained.
[0056] For the grid node where the smart home execution device is located, the grid division step size value is extracted, and half of the grid division step size value is used as the simulated internal decay constant; the reciprocal of the square of the simulated internal decay constant is calculated and multiplied by the real-time running power, and the result of the product is used as the maximum influence gradient quantization value and assigned to the grid node where it is located.
[0057] The maximum influence gradient quantization value corresponding to the grid node where the device is located, and the influence gradient quantization values corresponding to each of the surrounding grid nodes, are replaced and written into the corresponding positions in the mask feature channel according to the three-dimensional index coordinates of the grid node. When there are multiple smart home execution devices in the controlled space, for any grid node with the same index position in the three-dimensional discrete grid coordinate system, the influence gradient quantization value calculated individually by each smart home execution device for that grid node is extracted. The extracted influence gradient quantization values are then linearly superimposed by algebraic summation, and the summation result is used as the final weighted value of that grid node. After completing the traversal filling and superposition operations, the spatial mask tensor containing spatial influence weights is output.
[0058] The environmental feature layer construction process involves extracting the actual three-dimensional physical coordinates of the environmental sensor devices deployed in each spatial node, and converting them into sensor reference grid nodes in the three-dimensional discrete grid coordinate system according to the same grid division step size. Continuous environmental time-series data within the historical time window is extracted, and the data is truncated into frames according to the fixed time interval of system sampling to construct sampling frames corresponding to each discrete time step.
[0059] In a single sampling frame, for each grid node to be determined in the three-dimensional discrete grid coordinate system, the spatial gridding interpolation is performed using an inverse distance weighted interpolation algorithm. The specific interpolation process is as follows: The actual connected path length between the grid node to be determined and each sensor reference grid node is calculated as the topological distance, calculated in the same way as the shortest path planning algorithm described above for graph search; It is determined whether the topological distance is zero: if it is zero, it means that the grid node to be determined completely overlaps with a certain sensor reference grid node in spatial location, and the actual continuous environmental parameter values collected on the sensor reference grid node are directly used as the continuous environmental parameter interpolation result of the grid node to be determined, and subsequent weight calculations for the current grid node to be determined are skipped; if it is not zero, the grid division step size value determined in the previous steps is extracted, and one ten-thousandth of the square of the grid division step size is used as a small smoothing constant to prevent division by zero; the small smoothing constant is added to the square of each topological distance. The values are then multiplied by their respective weighting coefficients. The continuous environmental parameter values actually collected at each sensor reference grid node are multiplied by their corresponding weighting coefficients and summed. The sum is then divided by the cumulative sum of all weighting coefficients to obtain the interpolation result of the continuous environmental parameter at the desired grid node. All nodes in the three-dimensional discrete grid coordinate system are traversed to construct a full-space continuous environmental parameter matrix. Rows represent each independent grid node in the three-dimensional discrete grid coordinate system after one-dimensional flattening, and the total number of rows equals the total number of three-dimensional grid nodes in the full space. Columns represent different continuous environmental parameter categories, specifically including three independent data feature columns: indoor temperature, relative humidity, and air quality parameters calculated through interpolation at the grid node corresponding to the current row.
[0060] Perform a dimension reconstruction operation on the interpolated full-space continuous environmental parameter matrix. Obtain the total number of sampling frames and construct the time step dimension as the first dimension; obtain the maximum row index, maximum column index, and maximum height index of the three-dimensional discrete grid coordinate system and construct the axial dimensions of the grid space as the second, third, and fourth dimensions; construct a fifth dimension, namely the environmental parameter channel dimension, which includes independent indoor temperature feature channels, independent relative humidity feature channels, and independent air quality feature channels. Fill the full-space continuous environmental parameter matrix under all time steps within the historical time window into the independent feature channels corresponding to the fifth dimension according to the corresponding environmental parameter categories, map them to the grid positions of the second, third, and fourth dimensions according to their three-dimensional spatial coordinates, and arrange and merge them into the time step sequence of the first dimension in chronological order, generating and outputting the multidimensional feature tensor containing the above five dimensions, namely the environmental feature layer;
[0061] By introducing an effective topological distance that incorporates the characteristics of indoor physical partitions, the physical laws governing the non-uniform diffusion of smart home device operation effects in real three-dimensional space are restored, overcoming the errors caused by traditional straight-line distance evaluation. At the same time, the inverse distance weighted interpolation algorithm is used to transform sparse discrete sensor data into a continuous matrix in the entire space and reconstruct it into a five-dimensional environmental feature layer containing time steps, three-dimensional space, and multi-parameter channels. This not only eliminates spatial data blind spots but also achieves spatiotemporal alignment of heterogeneous physical parameters.
[0062] The controlled spatial feature map is constructed by fusing the spatial mask tensor with the environmental feature layer features, mapping the grids in the discrete grid coordinate system to topological graph nodes, and mapping the spatial associations between adjacent grids to edges in the topological graph, thus constructing an extracted spatial topological graph data structure. The nodes of the spatial topological graph data structure are each grid node in the discrete grid coordinate system, and the feature vector bound to each node contains the multidimensional hidden state values of the environmental parameters and the fused spatial mask tensor at the corresponding grid node position. The edges of the spatial topological graph data structure are the spatial association channels between the various grid nodes, and the weight value of each edge is calculated by the effective topological distance between adjacent grid nodes and the spatial diffusion adjacency of the physical environmental parameters.
[0063] Specifically, the total number of frames in the time step of the environmental feature layer in the first dimension is obtained; the spatial mask tensor is extracted, and the spatial mask tensor is copied and stacked along the time step dimension to construct an extended mask tensor sequence with the same number of frames as the total number of time steps, so that the extended tensor is strictly consistent with the environmental feature layer in the time step dimension, the dimensions of each axis of the grid space, and the dimensions of the environmental parameter channels. Before feature fusion, normalization processing based on training sample statistics is performed on each environmental parameter channel in the environmental feature layer and the influence weight channel in the spatial mask tensor; after normalization, element-wise numerical addition is performed according to the corresponding grid space coordinates and environmental parameter channels to complete feature fusion and generate a full-space fused feature tensor.
[0064] For the full-space fusion feature tensor, each 3D spatial grid position in the discrete grid coordinate system is extracted, and the maximum total number of column indices and the maximum total number of height indices in the 3D discrete grid coordinate system are extracted. For each 3D spatial grid position in the full-space fusion feature tensor, its current row coordinate index, column coordinate index, and height coordinate index are obtained. A 3D-to-1D dimensionality reduction and flattening algorithm is used to assign a unique integer index to this grid position. The specific index calculation formula is as follows:
[0065]
[0066] in, A unique integer sequence number assigned to this grid location. This is the current row coordinate index for this grid position. For the current column coordinate index, Index of the current height coordinates, The maximum number of column indexes, The maximum height index total number; the calculated unique integer sequence number is used as the global vertex identifier of the underlying graph structure and mapped to the topology graph node of the spatial topology graph data structure;
[0067] Extract all environmental parameter channel values corresponding to each grid position in the full-space fusion feature tensor to form an initial feature vector; construct a fully connected mapping network layer, configuring the number of input nodes of the fully connected mapping network layer to be equal to the total channel dimension of the initial feature vector, and configuring the number of output nodes to be a predetermined hidden state dimension; input each of the initial feature vectors into the fully connected mapping network layer to perform feature linear mapping and dimension compression, and use the output compressed vector as the multidimensional hidden state value and bind it to the corresponding topology graph node for feature weighting;
[0068] When constructing the edges of the spatial topology map data structure, taking any non-obstacle grid node in the discrete grid coordinate system as the center node, all grid nodes in the twenty-six connected spatial neighborhoods coplanar, sharing edges, and sharing vertices with it in three-dimensional space are searched as target adjacent nodes; the coordinates of impassable obstacle nodes in the three-dimensional point cloud mapping data of the indoor building are extracted, and the three-dimensional Bressenham line generation algorithm is used to calculate and extract the set of all discrete grid coordinate points traversed by the straight line connecting the center node and each target adjacent node; the set of discrete grid coordinate points is traversed, and it is compared to determine whether the set contains the coordinates of the impassable obstacle node; if it contains it, it is determined that the straight line connects through the obstacle, and it is determined that there is no spatial association; if it does not pass through, it is determined that there is a spatial association, and the spatial association between the adjacent grids is mapped to the edge connecting the center node and the target adjacent node in the spatial topology map data structure, that is, the spatial association channel;
[0069] For each generated edge, the 3D coordinate indices of the corresponding center node and the target adjacent node are extracted. The Euclidean distance between the two nodes in the 3D coordinate system is calculated, and this Euclidean distance is multiplied by the grid partitioning step size of the discrete grid coordinate system to obtain the effective topological distance between adjacent grid nodes. Simultaneously, the indoor temperature, relative humidity, and air quality parameters bound to the multidimensional hidden state values of the center node and the target adjacent node are extracted. The absolute value of the numerical difference between the two nodes under the same environmental parameter category is calculated, and the absolute values of the numerical differences under all environmental parameter categories are summed. The summation result is converted into the spatial diffusion adjacency degree of the physical environmental parameter using the natural exponential function. For each edge, the weight value is calculated using the following formula:
[0070]
[0071] in, For the first The central node and the first The weight values of the edges between adjacent nodes of each target, The effective topological distance between the two nodes is calculated. This represents an index of environmental parameter categories, with values covering indoor temperature, relative humidity, and air quality. and The first The central node and the first The target neighboring nodes in the th Actual values of environmental parameters. The exponential function is based on the natural constant, and the exponential function part represents the spatial diffusion adjacency of the physical environment parameter. Before participating in the calculation of the spatial diffusion adjacency, the difference of each environmental parameter is divided by the scale factor of the corresponding parameter or the standard deviation of the training samples to obtain a dimensionless difference value. The spatial diffusion adjacency is calculated based on the weighted sum of the dimensionless difference values.
[0072] By traversing all grid nodes in the discrete grid coordinate system, the construction of all topological graph nodes and their bound multidimensional hidden state values is completed. Based on the above judgment logic and formula, the calculation of all spatial association channels and their weight values is completed, and a controlled spatial feature map is constructed.
[0073] The controlled spatial feature map is input into a pre-trained spatiotemporal sequence prediction model to predict the state evolution sequence of the physical space of the smart home environment within a set time window in the future; the environment state evolution memory unit of the spatiotemporal sequence prediction model is equipped with a physical lag decay gate to adjust the weight of the retention of historical time step feature information.
[0074] The spatiotemporal sequence prediction model includes a connected spatial graph attention encoder, an environmental state evolution memory unit, and a multi-step sequence decoder. The spatial graph attention encoder aggregates the spatial neighborhood features of the latent state features of each grid node based on the weight values of the edges in the controlled spatial feature graph. The environmental state evolution memory unit has a physical hysteresis decay gate in its gated loop mechanism. The physical hysteresis decay gate adjusts the retention weight of historical time step feature information according to the inherent physical inertia coefficient of different environmental parameters. The multi-step sequence decoder includes a graph deconvolution mapping layer, which is used to reconstruct the grid spatial dimension of the future latent state features output by the environmental state evolution memory unit, and combine it with an autoregressive mechanism to output a sequence prediction state surface, thus forming the state evolution sequence.
[0075] Specifically, the spatial graph attention encoder of the spatiotemporal sequence prediction model receives the controlled spatial feature map and performs spatial neighborhood feature aggregation based on the feature vectors of each grid node in the spatial topology graph data structure and the weight values of the edges between nodes. Specifically, for any grid node, its multidimensional hidden state values with those of its neighboring grid nodes are extracted and concatenated into a vector. After multiplying by a feature transformation matrix, a structural bias mapped by the weight values of the corresponding edges is added. This vector is then input into a leaky modified linear unit to calculate the attention correlation coefficient. The mapping process involves inputting the weight values of the corresponding edges into one or more fully connected networks, expanding their dimensions through a learnable parameter matrix, and outputting a structural bias vector with the same dimensions as the feature-transformed vector. The correlation coefficients of all neighboring grid nodes are globally normalized using a normalized exponential function to obtain the attention weights. The attention weights are then linearly weighted and summed with the feature transformation results of each neighboring grid node to output the aggregated spatial neighborhood feature matrix.
[0076] The spatial neighborhood feature matrix is used as input data for the current time step and passed to the environmental state evolution memory unit. The environmental state evolution memory unit adopts a gated loop mechanism including an update gate, a reset gate, and a physical hysteresis decay gate. First, the inherent physical inertia coefficients of different environmental parameters in the physical space of the smart home environment are obtained; for indoor temperature values, the inherent physical inertia coefficient is calculated by dividing the total equivalent heat capacity of the controlled space by the total equivalent thermal resistance; for air quality parameters, the inherent physical inertia coefficient is calculated by dividing the volume of the controlled space by the ventilation rate; the total equivalent heat capacity, total equivalent thermal resistance, total equivalent humidity capacity, volume, and ventilation rate of the controlled space are all obtained by extracting building information model data or sensor calibration configuration of the smart home environment; the inherent physical inertia coefficient participates in the update in the form of a constrained parameter during training, and its value is restricted to positive numbers and within a preset calibration range to maintain the monotonic decay meaning of the physical hysteresis decay gating vector.
[0077] During the internal state update process of the environmental state evolution memory unit, the computational logic for the physical hysteresis decay gate is constructed. Let the time interval between the current time step and the previous time step be... The inherent physical inertia coefficient corresponding to a certain environmental parameter is Then the physical hysteresis attenuation gating vector corresponding to this environmental parameter The calculation formula is:
[0078]
[0079] The natural exponent operation is performed; the historical hidden state vector of the previous time step is element-wise multiplied with the forgetting retention ratio output by the update gate, and then a second element-wise multiplication is performed with the physical hysteresis decay gating vector to force the retention of more historical feature information for parameters with greater physical inertia; the decay-adjusted historical information is superimposed with the candidate state matrix of the current time step to complete the feature evolution of the environmental state evolution memory unit and output the future hidden state features. The state update calculation logic of the environmental state evolution memory unit can be expressed as follows:
[0080]
[0081]
[0082]
[0083]
[0084] in, The spatial neighborhood feature matrix passed in at the current time step. This is the historical hidden state vector from the previous time step. The output features of the future hidden state (i.e., the hidden state of the current step). To update the forgetting retention ratio of the gate output, To reset the gate output vector, The candidate state matrix, , , The learnable weight matrix corresponding to each gating unit. , , For each gated unit, there is a learnable bias term. For the Sigmoid activation function, The hyperbolic tangent activation function is used. This is the Hadamard product (elemental dot product). For splicing operations;
[0085] The multi-step sequence decoder receives the future hidden state features. The multi-step sequence decoder includes a graph propagation decoding layer and a grid backfilling layer. The graph propagation decoding layer performs neighborhood propagation of the future hidden state features based on the adjacency matrix. The grid backfilling layer backfills the output features of each node to the corresponding grid position based on the mapping relationship between graph nodes and 3D discrete grid coordinates. Specifically, the future hidden state feature matrix is multiplied sequentially by the inverse of the degree matrix and the adjacency matrix of the spatial topology graph data structure, and then multiplied by the learnable weight matrix corresponding to the deconvolution layer. The formula for calculating the structural inverse mapping is:
[0086]
[0087] in, For the reconstructed mesh features, It is the inverse of the degree matrix of the spatial topology graph data structure. The adjacency matrix is a spatial topology graph data structure. The feature matrix of the future hidden state received by the multi-step sequence decoder. The learnable weight matrix for the graph deconvolution mapping layer;
[0088] The highly compressed graph node features are re-diffused to each grid position in the discrete grid coordinate system through structural inverse mapping. The reconstructed grid features are input into the autoregressive mechanism, which uses the predicted state surface obtained from decoding the current time step as the auxiliary input for decoding the next time step. The mechanism iteratively predicts the three-dimensional state matrix of the physical space of the smart home environment for multiple consecutive time steps within a set future time window, thus forming the state evolution sequence.
[0089] The pre-training process of the spatiotemporal sequence prediction model involves using historically collected, anomaly-removed, and normalized full-space environmental parameters and synchronized equipment operating status data. A sliding window mechanism is employed to segment the data along the time axis, constructing a supervised learning sample set containing historical observation sequences as input and future real-state evolution sequences as labels. This sample set is then randomly divided into training and validation sets. The conventional network weights within the spatial graph attention encoder, environmental state evolution memory unit, and multi-step sequence decoder are initialized. The inherent physical inertia coefficients of different environmental parameters calculated in the previous stage are injected into the model as initial values for trainable parameters during training. In each iteration, batch... The training set input data is fed into the model to perform forward propagation, outputting a predicted state surface sequence within a future set time window. The loss function is constructed by calculating the mean squared reconstruction error between the predicted sequence and the true label sequence at all grid positions and parameter dimensions. The gradient of the loss with respect to each parameter is calculated using the time backpropagation algorithm. The network weight matrix and bias term are updated using the gradient descent optimizer, and the inherent physical inertia coefficient is adaptively fine-tuned during model backpropagation. After each training epoch, the generalization ability of the current model is evaluated in real time using the validation set. When the validation set loss no longer decreases significantly over several consecutive epochs, an early stopping mechanism is triggered, stopping the iteration and saving the optimal network parameters.
[0090] By constructing a spatiotemporal sequence prediction model, a deep integration of physical mechanisms and deep learning was achieved. A physical hysteresis decay gate based on the inherent physical inertia coefficient was introduced, forcing the model to strictly follow the laws of indoor thermodynamics and fluid dynamics. At the same time, by combining spatial graph attention aggregation and graph deconvolution inverse reconstruction mechanism, the state evolution of the complex three-dimensional physical space of the whole house was restored.
[0091] Based on the state evolution sequence, control scheduling calculation is performed to generate a smooth control sequence for the smart home execution device and send it to the smart home gateway.
[0092] The process of control scheduling calculation based on the state evolution sequence includes: calculating the temporal deviation between the predicted state surface of the sequence and the preset target environmental state, and extracting the gradient of environmental parameter changes in adjacent time steps as the state evolution trend; using the state evolution trend as the transition constraint, and minimizing the temporal deviation and the energy penalty for equipment state switching as the optimization objective, constructing a predictive control cost function; performing a temporal reverse solution on the predictive control cost function within the set future time window to obtain the optimal set of control variables for consecutive time steps, and splicing them in time sequence to form a smooth control sequence.
[0093] Specifically, the expected values of various environmental parameters given by the user through the smart home terminal interface are obtained. Spatial grid dimension data from the controlled spatial feature map are extracted. The expected values are then copied and expanded across the entire spatial dimension according to the discrete grid coordinate system to construct a target state multidimensional tensor with a three-dimensional spatial and parameter channel dimension that is strictly consistent with the predicted state surface of the sequence. This tensor is used as the preset target environmental state. For each time step in the state evolution sequence, the predicted state surface of the sequence output at that time step is subtracted from the element at the corresponding position of the tensor of the preset target environmental state. The sum of squared differences between all grid nodes and environmental parameter channels is calculated to obtain the temporal deviation. Simultaneously, the predicted state surface of the current time step in the state evolution sequence is extracted and subtracted from the predicted state surface of the previous time step to obtain a parameter difference matrix. The parameter difference matrix is divided by the time interval step size between adjacent time steps to obtain the discrete gradient of the environmental parameter changes. This gradient tensor is defined as the state evolution trend representing the physical evolutionary inertia of the environmental state.
[0094] Using the state evolution trend as the transition constraint and minimizing the timing deviation and device state switching energy penalty as the optimization objective, the predictive control cost function is constructed. The construction logic of the transition constraint is as follows: extract the control action sequence of the smart home execution device as the independent variable; require that the rate of change of the theoretical environment caused by any control action input must be in the same direction as the gradient direction of the state evolution trend, and the difference in the rate of change is limited to the physical hysteresis envelope range corresponding to the rated output power of the device. The specific calculation method for the physical hysteresis envelope range is: based on the rated output power of the smart home execution device... Calculate the maximum theoretical rate of change using the heat capacity constant of the controlled space. A step response experiment was conducted on the smart home execution device to obtain the device's response hysteresis time constant. The physical hysteresis envelope range is defined as follows:
[0095]
[0096] in, The environmental change rate when the device is operating at its minimum power is determined by extracting the rated minimum operating power parameter of the smart home device and combining it with the inherent physical properties of the controlled space (such as space volume and air specific heat capacity at constant pressure) to calculate the theoretical minimum change rate using thermodynamic or fluid dynamic equations. The constraint is that the difference between the actual theoretical environmental change rate and the gradient of the state evolution trend must fall within this range.
[0097] The calculation logic for the energy penalty for device state switching is as follows: Extract the absolute difference between the candidate control variable value at the current time step and the actual control variable value at the previous time step. Multiply this absolute difference by the rated operating power of the corresponding smart home execution device to quantify the energy loss value caused by the device's start-up, shutdown, or gear shift. Extract historical high-quality environmental control record data, use maximum likelihood estimation for parameter fitting, and calibrate the deviation weight coefficient and penalty weight coefficient. Weight the timing deviation and the device state switching energy penalty for all time steps within the future set time window using the weight coefficients to complete the construction of the predictive control cost function. The specific mathematical calculation formula is as follows:
[0098]
[0099] in, Let be the predictive control cost function. Set the total number of time steps to include in the future time window. Index for the current time step, To fit the calibrated bias weighting coefficients, the cumulative time-series bias and state-switching penalty data of historical high-quality environmental control samples are extracted, and the extreme points of the cost objective function are determined based on maximum likelihood estimation. In time step The timing deviation calculated below, The penalty weight coefficients, which are fitted to the calibration, are determined by a normalization constraint that the sum of the weights is 1 (i.e., 1 minus the aforementioned deviation weight coefficients). In time step The energy penalty for equipment state switching is calculated below; before constructing the predictive control cost function, the deviations of each environmental parameter are made dimensionless according to the allowable deviation of the corresponding parameter or the standard deviation of the training sample, and the energy penalty for equipment state switching is normalized according to the rated energy consumption of the equipment; the predictive control cost function is composed of a weighted sum of the dimensionless time series deviation term and the dimensionless equipment switching penalty term.
[0100] The predictive control cost function is solved in reverse time series within the predetermined future time window. Specifically, a dynamic programming algorithm is used, starting from the last time step of the predetermined future time window. Begin backwards to the current time step; at each time step of the backwards backtracking... In this process, based on the Bellman optimization principle, and under the premise of satisfying the aforementioned transition constraints, we seek to find the optimal value from time step […]. Time to step Cumulative predictive control cost function Minimize the candidate control variables; recursively backtrack to the current time step to obtain the optimal set of control variables that minimizes the global cost in consecutive time steps; rearrange and splice the optimal set of control variables in forward chronological order from near to far, and output the smooth control sequence with continuous instructions and no high-frequency oscillations or sudden changes in the time series.
[0101] By introducing state evolution trends as transition constraints, the control commands are ensured to follow the laws of real physical response, effectively avoiding ineffective work by the equipment and system instability. At the same time, by constructing a predictive control cost function that comprehensively considers timing deviations and state switching energy penalties, and combining dynamic programming algorithms for global optimization of timing in reverse, the frequent start-up and shutdown of the equipment and high-frequency gear shifting are effectively suppressed.
[0102] The control strategy corresponding to the current time step in the smooth control sequence is extracted, parsed into a low-level device control data packet, and sent to the corresponding smart home execution device through the Internet of Things communication protocol.
[0103] See Figure 3 The underlying device control data packet is a standard communication data packet generated by extracting the control strategy corresponding to the current time step, decomposing it into underlying control words according to the object model interface of the corresponding smart home execution device, combining the underlying control words with the communication identifier of the smart home execution device, and encapsulating them according to the message format of the Internet of Things communication protocol.
[0104] Specifically, the smooth control sequence issued from the cloud is extracted, and time-series slices are performed according to a unified time axis to extract a set of single-step control instructions that are strictly aligned with the real-time timestamp of the current system. The set of single-step control instructions is parsed to separate the control dimension features of the target controlled environment parameters and the corresponding target running state values. These are then combined and transformed into a control vector with fixed dimensions, which serves as the control strategy.
[0105] The system reads the device registration routing table stored in the local memory of the smart home gateway. Based on the node serial number registered by the smart home execution device in the local area network, it extracts the corresponding hardware type feature code. It then sends a structured form request carrying the hardware type feature code to the cloud server to download the corresponding device object model structured data table. This table records the correspondence between each control dimension feature and the underlying register address, as well as a mapping dictionary between the target operating state value and the hexadecimal machine opcode. The system iterates through each element in the control vector, performs a key-value comparison search in the device object model structured data table, retrieves the corresponding underlying register address and the corresponding hexadecimal machine opcode, and concatenates the underlying register address and the corresponding hexadecimal machine opcode according to the word length standard of the target device, padding with zeros and aligning them to bytes to generate the underlying control word.
[0106] The device registration routing table is accessed again to extract the hexadecimal network physical address assigned by the network coordination node during the initial network configuration phase of the smart home execution device, and this network physical address is used as the communication identifier.
[0107] A contiguous data frame buffer is allocated in the running memory. Following the sequence of the protocol frame structure, the starting synchronization frame header, the communication identifier representing the data transmission target, the total byte span value of the underlying control word used to define the data length, and the core underlying control word itself are sequentially pushed into the data frame buffer. For all byte sequences already pushed into the data frame buffer, a cyclic redundancy check (CRC) calculation is performed using binary polynomial division, and the remainder during the calculation is used as the data checksum. The calculated data checksum and the ending frame tail representing the message termination are sequentially appended to the end of the data frame buffer, thus completing the linear concatenation of all byte sequences. This generates the standard communication data packet, which is modulated into a radio electromagnetic wave signal by the radio frequency transmission module of the smart home gateway and sent to the corresponding smart home execution device.
[0108] In the instruction decomposition stage, the register address and opcode are strictly padded with zeros and byte-aligned for splicing, eliminating the risk of data truncation caused by cross-device word length differences and ensuring the physical-level accuracy of cross-layer instruction translation. In addition, a rigorous protocol frame structure with cyclic redundancy check mechanism is used for full closed-loop encapsulation, which effectively intercepts communication errors caused by spatial electromagnetic interference.
[0109] Example 2:
[0110] This application applies a smart home remote control method based on spatiotemporal sequence prediction to a smart living room environment in winter. The living room has three dimensions: 8 meters long, 6 meters wide, and 3 meters high. A smart air conditioner (as a heat source) is deployed near the corner of the window, and a smart humidifier (as a humidity source) is deployed at the coffee table in the center of the living room. Four temperature and humidity sensors are evenly distributed in the four corners of the room. The target desired environment is an indoor temperature of 24°C and a relative humidity of 50%.
[0111] Collect environmental time-series data and device operating status data in the physical space of the smart living room: Four temperature and humidity sensors synchronously collect the current indoor temperature (e.g., current average 16℃) and relative humidity (e.g., current average 35%) every minute, and construct a time-series numerical matrix by time-series alignment according to a unified timestamp; At the same time, the power sensor and microcontroller synchronously read the current real-time operating power of the smart air conditioner (e.g., 2000W heating mode) and the real-time operating power of the smart humidifier (e.g., 50W humidification mode), generate discrete status codes corresponding to the current operating mode, and concatenate and splice them with the power values before uploading them to the cloud server via the smart home gateway;
[0112] The device operating status data is converted into a spatial mask tensor and fused with the environmental feature layer to generate a controlled spatial feature map. The living room is divided into a three-dimensional discrete grid coordinate system with a grid size of 0.5 meters. The actual three-dimensional physical coordinates of the air conditioner and humidifier are mapped to specific grid nodes. The operating status data is parsed, and the discrete state code of the current operating mode is extracted. By querying the underlying device protocol mapping table, the discrete state code of the smart air conditioner's "heating mode" is mapped to an indoor temperature category identifier, and the corresponding temperature mask feature channel is extracted in the basic location mask layer. Simultaneously, the discrete state code of the smart humidifier's "humidification mode" is mapped to a relative humidity category identifier, and the corresponding humidity mask feature channel is extracted in the basic location mask layer. Based on the real-time operating power of the air conditioner (2000W) and the humidifier (50W), and combined with the inverse relationship of the effective topological distance square, the gradient quantization values of their influence on the surrounding grid are calculated respectively. The calculated influence gradient quantization values are used as weight values and filled into the corresponding grid node positions within the temperature and humidity mask feature channels to construct a spatial mask tensor. The sparse temperature and humidity data collected by four sensors are expanded into a continuous feature tensor in the whole space using the inverse distance weighted interpolation algorithm. The expanded spatial mask tensor is then added element by element to the environmental feature layer to construct a controlled spatial feature map containing multidimensional hidden state values of each grid and spatial topological correlation edges.
[0113] A pre-trained spatiotemporal sequence prediction model predicts the state evolution sequence and solves the smooth control sequence: The controlled spatial feature map is input into the cloud-based spatiotemporal sequence prediction model. Due to the significant influence of wall heat capacity on temperature conduction and rapid humidity diffusion, the physical hysteresis attenuation gate inside the model adjusts the weight of historical feature retention differently based on the inherent physical inertia coefficients of temperature and humidity, predicting the spatiotemporal evolution and spread trend of temperature and humidity in each grid of the living room within the next 30 minutes. The control scheduling solution uses this evolution trend as the transition constraint condition. While pursuing the temperature and humidity targets of 24℃ and 50%, a dynamic programming algorithm is used to work backward from 30 minutes later to the current moment to calculate the optimal set of control variables that minimizes the total cost of "time series deviation" and "energy penalty for switching the start and stop states of the air conditioner / humidifier". This generates a smooth control sequence with continuous instructions, such as guiding the air conditioner to smoothly reduce from 2000W to 1200W and maintain it, rather than directly shutting down after reaching 24℃ and causing frequent restarts later.
[0114] The control strategy is parsed into underlying device control data packets and sent for execution: The specific control strategy corresponding to the current time step (e.g., "set the air conditioner's heating power to 1200W") is extracted from the smoothed control sequence mentioned above. The hardware type feature code of the smart air conditioner is read from the device registration routing table on the gateway and matched against the structured data table of the device object model downloaded from the cloud. Key-value comparisons are performed on the features and status values of each dimension in the control strategy within the data table. The retrieved data is then assembled bit-wise to generate the corresponding underlying register address and hexadecimal machine operation code (i.e., the underlying control word). Combining this with the network physical address assigned to the air conditioner during network configuration, the synchronization frame header, network identifier, control word length, and core underlying control word are sequentially pushed into the data frame buffer. A CRC checksum and end frame tail are appended after binary polynomial division calculation, encapsulated into a standard communication data packet, and sent to the air conditioner for execution via the gateway's RF module.
[0115] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for remote control of smart homes based on spatiotemporal sequence prediction, characterized in that, include: Collect time-series environmental data in the physical space of the smart home environment, and simultaneously acquire the operating status data of smart home execution devices in the controlled space, and upload them to the cloud via the smart home gateway; The running status data is converted into a spatial mask tensor and injected into the environmental feature layer obtained by mapping the environmental time series data for feature fusion and spatiotemporal feature extraction to generate a controlled spatial feature map. The controlled spatial feature map is input into a pre-trained spatiotemporal sequence prediction model to predict the state evolution sequence of the physical space of the smart home environment within a future set time window; the environment state evolution memory unit of the spatiotemporal sequence prediction model is equipped with a physical lag attenuation gate to attenuate the retention weight of historical time step feature information; based on the state evolution sequence, control scheduling calculation is performed to generate a smooth control sequence for the smart home execution device and send it to the smart home gateway. The control strategy corresponding to the current time step in the smooth control sequence is extracted, parsed into a low-level device control data packet, and sent to the corresponding smart home execution device through the Internet of Things communication protocol.
2. The smart home remote control method based on spatiotemporal sequence prediction according to claim 1, characterized in that, The environmental time-series data is a time-series numerical matrix constructed by aligning the continuous environmental parameters of each spatial node in the physical space of the smart home environment, which is equipped with environmental sensor devices, according to a unified timestamp within a historical time window. The continuous environmental parameters include the indoor temperature value, relative humidity value, and air quality parameter of the spatial node. The spatial node is a discrete entity location point in the physical space of the smart home environment where data is collected. The operating status data includes the real-time operating power of the smart home execution device under the time-series node corresponding to the unified timestamp and the discrete state code of the current operating mode.
3. The smart home remote control method based on spatiotemporal sequence prediction according to claim 2, characterized in that, The process of converting the operating status data into a spatial mask tensor is as follows: mapping the spatial physical coordinates of each smart home execution device to a preset discrete grid coordinate system to establish a basic position mask layer; and extracting the corresponding mask feature channel in the basic position mask layer according to the environmental parameter category identifier corresponding to the current operating mode in the operating status data. Calculate the squared effective topological distance between each smart home execution device and all surrounding grid nodes (excluding its own grid node) in the discrete grid coordinate system, taking into account the indoor physical partition characteristics. Multiply the reciprocal of the squared effective topological distance by the real-time operating power in the operating status data to obtain the influence gradient quantization value of each surrounding grid node. Assign a preset maximum influence gradient quantization value to the grid node where the smart home execution device is located. The influence gradient quantization value is used as a weight value to fill the corresponding grid node position in the mask feature channel, and the spatial mask tensor is constructed by merging. When there are multiple smart home execution devices, the influence gradient quantization values of multiple smart home execution devices are linearly superimposed for any grid node.
4. The smart home remote control method based on spatiotemporal sequence prediction according to claim 3, characterized in that, The environmental feature layer is constructed by spatially interpolating the continuous environmental parameters of each spatial node within the historical time window according to the physical coordinates of each spatial node in the physical space of the smart home environment, and mapping them to a multidimensional feature tensor in the discrete grid coordinate system, which includes the time step dimension, the dimensions of each axis of the grid space, and the environmental parameter channel dimension; wherein, the environmental parameter channel dimension includes independent feature channels corresponding to the indoor temperature value, the relative humidity value, and the air quality parameter respectively.
5. The smart home remote control method based on spatiotemporal sequence prediction according to claim 4, characterized in that, The controlled spatial feature map is constructed by fusing the spatial mask tensor with the environmental feature layer features, mapping the grids in the discrete grid coordinate system to topological graph nodes, and mapping the spatial associations between adjacent grids to edges in the topological graph, thus constructing the extracted spatial topological graph data structure. The nodes of the spatial topological graph data structure are each grid node in the discrete grid coordinate system, and the feature vector bound to each node contains the multidimensional hidden state values obtained by fusing the environmental parameters and the spatial mask tensor at the corresponding grid node position. The edges of the spatial topological graph data structure are the spatial association channels between the various grid nodes, and the weight value of each edge is calculated by the effective topological distance between adjacent grid nodes and the spatial diffusion adjacency of the physical environmental parameters.
6. The smart home remote control method based on spatiotemporal sequence prediction according to claim 1, characterized in that, The spatiotemporal sequence prediction model includes a connected spatial graph attention encoder, an environmental state evolution memory unit, and a multi-step sequence decoder; the spatial graph attention encoder performs spatial neighborhood feature aggregation on the hidden state features of each grid node based on the weight values of the edges in the controlled spatial feature graph. The environmental state evolution memory unit is equipped with a physical hysteresis decay gate in the gated loop mechanism. The physical hysteresis decay gate adjusts the retention weight of historical time step feature information according to the inherent physical inertia coefficient of different environmental parameters. The multi-step long sequence decoder includes a graph deconvolution mapping layer, which is used to reconstruct the grid space dimension of the future hidden state features output by the environmental state evolution memory unit, and combine it with the autoregressive mechanism to output the sequence to predict the state surface, thus forming the state evolution sequence.
7. The smart home remote control method based on spatiotemporal sequence prediction according to claim 1, characterized in that, The process of control scheduling calculation based on the state evolution sequence includes: calculating the temporal deviation between the predicted state surface of the sequence and the preset target environmental state, and extracting the gradient of environmental parameter changes in adjacent time steps as the state evolution trend; using the state evolution trend as the transition constraint, and minimizing the temporal deviation and the energy penalty for equipment state switching as the optimization objective, constructing a predictive control cost function; performing a temporal reverse solution on the predictive control cost function within the set future time window to obtain the optimal set of control variables for consecutive time steps, and splicing them in time sequence to form a smooth control sequence.
8. The smart home remote control method based on spatiotemporal sequence prediction according to claim 1, characterized in that, The underlying device control data packet is generated by extracting the control strategy corresponding to the current time step, decomposing it into underlying control words according to the object model interface of the corresponding smart home execution device, combining the underlying control words with the communication identifier of the smart home execution device, and encapsulating them into a standard communication data packet according to the message format of the Internet of Things communication protocol.