A computer vision-based home intelligent control method and system

By using a computer vision-based smart home system, K-Means clustering and LSTM+Attention models are employed to analyze and predict temperature and humidity data. This addresses the issues of insufficient matching of personalized user needs and poor hardware compatibility in existing systems, enabling advance control and a stable user experience.

CN120949870BActive Publication Date: 2026-03-17HENAN YONGTAI OPTOELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing smart home systems cannot accurately match users' personalized needs in temperature and humidity control. They have poor hardware compatibility, insufficient control stability, low prediction accuracy, and fail to achieve advance control, resulting in a poor user experience.

Method used

The K-Means clustering algorithm is used to remove timestamp features and cluster temperature and humidity data. The effectiveness is analyzed in combination with the hardware control capability range. A temperature and humidity heat map is constructed, and timestamp features are introduced to verify the reliability of clustering. The LSTM+Attention model is used to predict user preference intervals, and pre-control parameters are generated through double matching.

Benefits of technology

It enables users to enjoy a comfortable environment immediately before entering the scene, ensures that the control parameters are compatible with the hardware, avoids control failure and fluctuations, and improves the stability and accuracy of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120949870B_ABST
    Figure CN120949870B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of smart home systems, and provides a home intelligent control method and system based on computer vision, which comprises the following modules: a temperature and humidity data clustering and candidate cluster set generation module, which is used for obtaining a candidate temperature and humidity cluster set through K-Means clustering, hardware capability effectiveness analysis and hotspot map screening after eliminating time stamps; a candidate temperature and humidity cluster set reliability verification and reference cluster set determination module, which is used for verifying the reliability of the cluster set by introducing time stamps, and screening out a reference cluster set in combination with Min-Max normalization and Euclidean distance; and a user temperature and humidity preference prediction and pre-control parameter generation module, which is used for predicting a user preference interval through an LSTM+Attention model, generating pre-control parameters through double matching, and driving hardware to control in advance. The application realizes the precision, intelligence and foresight of temperature and humidity control, and improves user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart home system technology, specifically a home intelligent control method and system based on computer vision. Background Technology

[0002] With the rapid development of IoT technology, smart home systems have been widely used in home settings, and their temperature and humidity control function has become one of the core modules for improving the user's living experience.

[0003] However, existing smart home systems still have significant shortcomings in temperature and humidity control: First, most systems rely on manual user settings or fixed scene modes, failing to deeply mine user preferences in historical temperature and humidity data, resulting in inaccurate control matching of personalized user needs; Second, while some systems introduce data clustering analysis, they do not combine it with the actual control capabilities of hardware units, easily generating control parameters that exceed the hardware's execution capabilities, causing control failure; Third, the lack of time-dimensional reliability verification of clustering results may misjudge short-term, accidental temperature and humidity combinations as user preferences, leading to poor control stability; Fourth, user preference prediction models mostly use simple time-series algorithms with low prediction accuracy and are not linked to historical clustering results, making it difficult to achieve advance control and preventing users from immediately enjoying a comfortable environment upon entering the scene.

[0004] In summary, the existing system suffers from low intelligence, poor hardware adaptability, insufficient control stability, and limited prediction accuracy, and urgently needs optimization.

[0005] Therefore, the present invention provides a home intelligent control method and system based on computer vision. Summary of the Invention

[0006] In order to overcome the shortcomings of the prior art, at least one technical problem raised in the background art is solved.

[0007] The technical solution adopted by this invention to solve its technical problem is:

[0008] In one aspect, the present invention provides a computer vision-based smart home control method, comprising:

[0009] Step 1: Remove the timestamp features from the temperature and humidity data, use the K-Means clustering algorithm to perform cluster analysis on the temperature and humidity data respectively, and perform validity analysis on the cluster analysis results. Integrate the temperature clustering results and humidity clustering results to obtain a temperature and humidity heat map. Analyze the temperature and humidity heat map and select candidate temperature and humidity cluster sets.

[0010] Step 2: Introduce timestamp features to verify the reliability of the candidate temperature and humidity cluster sets. Based on the reliability verification results, calculate the similarity between the temperature and humidity data of the current smart home system's operating environment and the temperature and humidity cluster centers in the candidate temperature and humidity cluster sets to obtain the reference temperature and humidity cluster set.

[0011] Step 3: Construct a user preference prediction model to predict the user's preferred temperature and humidity range. Perform a double match between the predicted user preference temperature and humidity range and the reference temperature and humidity cluster set to obtain pre-regulation parameters, which are used to adjust the smart home system in advance.

[0012] As a further improvement of the present invention, the process of clustering temperature data and humidity data using the K-Means clustering algorithm is as follows:

[0013] After removing the timestamp features from the temperature and humidity data, the K-Means clustering algorithm is used to perform cluster analysis on the N temperature and humidity data respectively, and the clustering results are obtained, including: temperature data clusters, humidity data clusters, temperature cluster centers, and humidity cluster centers.

[0014] As a further improvement of the present invention, the specific process of performing validity analysis on the clustering results is as follows:

[0015] Obtain the preset temperature control range and preset humidity control range of the hardware unit. For the temperature data cluster and humidity data cluster obtained by cluster analysis, verify the validity of the temperature and humidity values ​​in the temperature data cluster and humidity data cluster respectively, and remove the temperature and humidity values ​​that are not within the control range of the hardware unit.

[0016] If any temperature value in the temperature data cluster is outside the preset temperature control range, the temperature value is determined to be invalid and is then removed.

[0017] If any humidity value in the humidity data cluster is outside the preset humidity control range, the humidity value is determined to be invalid and is then removed.

[0018] As a further improvement of the present invention, the specific process of obtaining the temperature and humidity heat map is as follows:

[0019] A two-dimensional coordinate system is constructed using the temperature and humidity data clusters after validity analysis. The X-axis is defined as the temperature value in the temperature data cluster, and the Y-axis is defined as the humidity value in the humidity data cluster. The temperature and humidity values ​​in the temperature and humidity data clusters after validity analysis are plotted on the two-dimensional coordinate system to obtain a temperature and humidity heat map.

[0020] As a further improvement of the present invention, the specific process of obtaining the candidate temperature and humidity cluster set is as follows:

[0021] Based on the constructed temperature and humidity heat map, naturally formed high-density clustering areas are identified in the heat map; the high-density clustering areas are located by using the color gradient features of the heat map, and the boundaries of the high-density clustering areas are defined to determine the temperature and humidity ranges corresponding to the high-density clustering areas.

[0022] If there are multiple discrete high-density clustered regions in the temperature and humidity hotspot map, then each of the high-density clustered regions is marked as candidate core region 1, candidate core region 2, ..., to form a set of candidate core regions;

[0023] In the candidate core area set, the proportion of the sample number of each candidate core area to the total sample number of the temperature data cluster and humidity data cluster after validity analysis is counted, and the samples are sorted in descending order of the sample proportion to obtain the candidate temperature and humidity cluster set.

[0024] As a further improvement of the present invention, the specific process of performing reliability verification on the candidate temperature and humidity cluster set is as follows:

[0025] Obtain the original timestamp information that corresponds one-to-one with the candidate temperature and humidity cluster samples;

[0026] Date-marking is performed on the original timestamp information corresponding to the candidate temperature and humidity cluster samples to determine the specific date to which each sample belongs; based on the date-marking results, the maximum consecutive date unit to which the candidate temperature and humidity cluster samples belong is calculated, that is, the maximum duration of the consecutive date segment, measured in days;

[0027] Calculate the proportion of the number of samples covered by the largest consecutive date unit to the total number of samples in the corresponding temperature and humidity cluster set, and record this proportion as the proportion of consecutive date samples;

[0028] If the proportion of consecutive date samples in any candidate core area of ​​the candidate temperature and humidity cluster is greater than the preset threshold for consecutive date samples, then the temperature and humidity cluster is determined to be reliable.

[0029] If the proportion of consecutive date samples in any candidate core region of the candidate temperature and humidity cluster is less than or equal to the consecutive date sample threshold, then the temperature and humidity cluster is determined to be unreliable, and the candidate core region is removed from the candidate temperature and humidity cluster.

[0030] As a further improvement of the present invention, the specific process of obtaining the reference temperature and humidity cluster set is as follows:

[0031] The system collects temperature and humidity data from the environment in which the smart home system is currently in use.

[0032] Obtain the temperature cluster centers and humidity cluster centers from the clustering results corresponding to all candidate core regions in the candidate temperature and humidity cluster set after reliability verification;

[0033] Preset temperature control range and preset humidity control range are introduced, and the temperature and humidity data in the current smart home system usage environment are normalized using the Min-Max normalization method.

[0034] A preset temperature control range and a preset humidity control range are introduced, and the temperature cluster centers and humidity cluster centers are normalized using the Min-Max normalization method.

[0035] For the normalized temperature data, humidity data, and temperature and humidity cluster centers, the Euclidean distance formula is used to calculate the similarity between the temperature data and humidity data in the current smart home system usage environment and the temperature and humidity cluster centers in the clustering results corresponding to the candidate core area.

[0036] If the similarity between the temperature and humidity data in the current smart home system's operating environment and the temperature and humidity cluster centers in the clustering results corresponding to the candidate core area is greater than or equal to the similarity threshold, then the candidate core area will be removed from the candidate temperature and humidity cluster set.

[0037] All the calculated similarities are sorted from smallest to largest to obtain the reference temperature and humidity cluster set.

[0038] As a further improvement of the present invention, the specific process of predicting the user's preferred temperature and humidity range is as follows:

[0039] Historical temperature data, humidity data, and timestamp association data corresponding to each candidate core area in the candidate temperature and humidity cluster set are obtained as model training data; real-time temperature data, humidity data, and timestamp association data in the current smart home system usage environment are collected as model validation dataset.

[0040] A user preference prediction model is constructed using a Long Short-Term Memory (LSTM) network combined with an attention mechanism. Let the model output the predicted user preference temperature and humidity range as... The actual temperature and humidity range corresponding to the verification dataset is: The number of samples is n;

[0041] Then RMSE is defined as: This is used to measure the degree of deviation between the model's predicted values ​​and the actual values. The training objective is to make the RMSE < 5%.

[0042] The Adam optimizer is used to train a user preference prediction model. The model is trained through steps such as first-order moment estimation, second-order moment estimation, momentum update, adaptive learning rate update, bias correction, and parameter update until RMSE < 5%. The model then outputs the predicted values ​​for the user's preferred temperature and humidity range.

[0043] As a further improvement of the present invention, the specific process of performing double matching to obtain the pre-regulation parameters is as follows:

[0044] Temperature range output based on user preference prediction model Temperature and humidity range Calculate and predict the temperature center Predicting humidity center Based on the reference temperature and humidity cluster, the temperature range of each candidate core region is obtained. Humidity range Calculate the candidate temperature center Candidate humidity center ;

[0045] Determine the temperature range of the model output Temperature and humidity range Clustering of temperature ranges with reference temperature and humidity Humidity range Are there any overlapping areas?

[0046] Temperature overlap condition: and If so, then the two temperature ranges overlap;

[0047] Humidity overlap conditions: and If so, the two humidity ranges overlap;

[0048] If any candidate core region satisfies both the temperature overlap condition and the humidity overlap condition, the candidate core region is considered a match; otherwise, it is considered a mismatch and is removed from the reference temperature and humidity cluster set.

[0049] For candidate core regions that satisfy both temperature and humidity overlap conditions, calculate the two-dimensional Euclidean distance between the center of the predicted temperature and humidity interval and the temperature and humidity center of the candidate core region: ,in, To predict the temperature center, To predict the humidity center, As a candidate temperature center, As a candidate humidity center, Used as a reference distance;

[0050] If the reference distance of any candidate core region that satisfies both the temperature and humidity overlap conditions is greater than or equal to the reference distance threshold, it is determined to be a mismatch and the candidate core region is removed from the reference temperature and humidity cluster.

[0051] If the reference distance of any candidate core region that satisfies both the temperature and humidity overlap conditions is less than the reference distance threshold, it is determined to be a match, and the pre-regulation parameters are obtained.

[0052] On the other hand, the present invention provides a computer vision-based smart home control system, comprising:

[0053] Temperature and humidity data clustering and candidate cluster set generation module: Remove the timestamp features of temperature and humidity data, use the K-Means clustering algorithm to perform cluster analysis on temperature and humidity data respectively, perform validity analysis on the cluster analysis results, integrate the temperature clustering results and humidity clustering results to obtain temperature and humidity heat map, analyze the temperature and humidity heat map, and filter to obtain candidate temperature and humidity cluster sets;

[0054] The module for verifying the reliability of candidate temperature and humidity cluster sets and determining the reference cluster set introduces timestamp features to verify the reliability of candidate temperature and humidity cluster sets. Based on the reliability verification results, it calculates the similarity between the temperature and humidity data of the current smart home system's operating environment and the temperature and humidity cluster centers in the candidate temperature and humidity cluster sets, thus obtaining the reference temperature and humidity cluster set.

[0055] User temperature and humidity preference prediction and pre-regulation parameter generation module: Constructs a user preference prediction model to predict the user's preferred temperature and humidity range. The predicted user preferred temperature and humidity range is matched twice with a reference temperature and humidity cluster set to obtain pre-regulation parameters, which are used to adjust the smart home system in advance.

[0056] The beneficial effects of this invention are as follows:

[0057] 1. This invention uses K-Means clustering to mine high-density clustered regions in historical temperature and humidity data, combines LSTM+Attention model to predict user preferred temperature and humidity ranges, and then generates pre-regulation parameters through interval overlap + center distance double matching. Temperature and humidity can be adjusted before the user enters the target scene, ensuring that the user can enjoy a comfortable environment that suits their habits without waiting, thus solving the problems of lagging regulation and low preference matching in existing systems.

[0058] 2. During the data clustering stage, validity analysis is used to remove values ​​in temperature and humidity data that exceed the control capabilities of the hardware units, ensuring that the generated candidate cluster sets are compatible with the actual execution capabilities of hardware such as air conditioners and humidifiers, and avoiding control failures caused by control parameters exceeding hardware limits.

[0059] 3. Introduce timestamp features to verify the reliability of candidate cluster sets. By statistically analyzing the sample proportion corresponding to the largest consecutive date unit, short-term and occasional temperature and humidity combinations are eliminated, and only stable and continuous clustering results in the time dimension are retained as references to avoid control fluctuations caused by accidental data and ensure the stability of long-term control effects. Attached Figure Description

[0060] The invention will now be further described with reference to the accompanying drawings.

[0061] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0062] Figure 2 This is a schematic diagram of the system modules of the present invention. Detailed Implementation

[0063] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments. Example 1

[0064] like Figure 1 As shown in the embodiment of the present invention, a home intelligent control method based on computer vision includes:

[0065] Step 1: Remove the timestamp features from the temperature and humidity data, use the K-Means clustering algorithm to perform cluster analysis on the temperature and humidity data respectively, and perform validity analysis on the cluster analysis results. Integrate the temperature clustering results and humidity clustering results to obtain a temperature and humidity heat map. Analyze the temperature and humidity heat map and select candidate temperature and humidity cluster sets.

[0066] Cluster analysis of historical temperature and humidity data reveals distribution patterns and potential characteristics, providing a foundation for subsequent analysis.

[0067] Specifically, the process of removing the timestamp feature from temperature and humidity data is as follows:

[0068] The system retrieves timestamp information associated with temperature and humidity data from historical databases. The original data in the historical database is stored in a fixed association combination of temperature data, humidity data, and timestamp. Through data cleaning, the timestamp field in the dataset is removed, leaving only the two core numerical features: temperature data and humidity data. The temperature and humidity data are simplified into scattered data without timestamp association, severing the correlation between temperature and humidity data on timestamps. This results in a set of temperature data and a set of humidity data that contain only temperature data and humidity data, respectively, without any time association attributes.

[0069] For example, in a historical database, a single original data entry exists in the form of a combination of timestamp T1 + temperature value 22.5℃ + humidity value 53.2%, timestamp T2 + temperature value 23.1℃ + humidity value 52.8%, etc. After processing, the information such as timestamps T1 and T2 is completely removed, and only pure temperature and humidity values ​​such as 22.5℃ and 53.2%, 23.1℃ and 52.8% are retained. In addition, the trend of temperature value with timestamp and the temporal correspondence between humidity value and temperature value in the original data are cut off, and finally, independent and scattered temperature and humidity value datasets are obtained.

[0070] By using the timestamp features of temperature and humidity data, the correlation between temperature and humidity data is broken, making it easier for K-Means to directly perform cluster analysis on temperature and humidity data, thus reducing the amount of computation.

[0071] In addition, the process of clustering temperature data and humidity data using the K-Means clustering algorithm is as follows:

[0072] The K-Means clustering algorithm is used to perform cluster analysis on the temperature data and humidity data respectively, and the clustering results are obtained. The clustering results include: temperature data clusters, humidity data clusters, temperature cluster centers, and humidity cluster centers.

[0073] Secondly, the specific process of conducting validity analysis on the clustering results is as follows:

[0074] Obtain the preset temperature control range and preset humidity control range of the hardware unit. For the temperature data cluster and humidity data cluster obtained by cluster analysis, verify the validity of the temperature and humidity values ​​in the temperature data cluster and humidity data cluster respectively, and remove the temperature and humidity values ​​that are not within the control range of the hardware unit.

[0075] Right now:

[0076] If any temperature value in the temperature data cluster is outside the preset temperature control range, the temperature value is determined to be invalid and is then removed.

[0077] If any humidity value in the humidity data cluster is outside the preset humidity control range, the humidity value is determined to be invalid and is then removed.

[0078] For example, taking the temperature control capability range of a hardware unit as an example, if the preset temperature control capability range of the hardware unit is 16℃~32℃, that is, the lower limit of temperature control is 16℃ and the upper limit of temperature control is 32℃, and the temperature value distribution range of a certain temperature data cluster defined after cluster analysis is 28℃~37℃, then the temperature values ​​in the temperature data cluster are checked one by one, and all temperature values ​​that exceed the upper limit of the hardware unit's temperature control of 32℃, that is, temperature values ​​in the 32℃~37℃ range, are removed, and only the temperature values ​​in the 28℃~32℃ range of the high temperature cluster that conform to the hardware temperature control capability range are retained; the screening process for humidity data clusters is similar. Based on the preset humidity control capability range of the hardware unit, such as 30%RH~70%RH, humidity values ​​in the humidity data cluster that exceed this range are removed, and finally, a temperature and humidity data cluster that matches the hardware control capability is obtained.

[0079] By combining the K-Means clustering algorithm with the control capabilities of the hardware unit, temperature and humidity values ​​that are outside the control capabilities of the hardware unit can be directly eliminated. This avoids having to screen temperature and humidity data one by one in a massive historical database, reducing data processing complexity and providing valuable data for subsequent analysis.

[0080] The specific process of integrating temperature clustering results and humidity clustering results to obtain a temperature and humidity heat map is as follows:

[0081] A two-dimensional coordinate system is constructed using the temperature and humidity data clusters after validity analysis. The X-axis is defined as the temperature value in the temperature data cluster, and the Y-axis is defined as the humidity value in the humidity data cluster. The temperature and humidity values ​​in the temperature and humidity data clusters after validity analysis are plotted on the two-dimensional coordinate system to obtain a temperature and humidity heat map.

[0082] The specific process of analyzing temperature and humidity heat maps and selecting candidate temperature and humidity cluster sets is as follows:

[0083] Based on the constructed temperature and humidity heat map, identify naturally formed high-density clustering areas in the heat map; locate the high-density clustering areas through the color gradient features of the heat map, define the boundaries of the high-density clustering areas, determine the temperature and humidity ranges corresponding to the high-density clustering areas, and ensure that the boundaries of the high-density clustering areas cover more than 90% of the data samples in the area.

[0084] If there are multiple discrete high-density clustered regions in the temperature and humidity hotspot map, then each of the high-density clustered regions is marked as candidate core region 1, candidate core region 2, ..., to form a set of candidate core regions;

[0085] In the candidate core area set, the proportion of the sample number of each candidate core area to the total sample number of the temperature data cluster and humidity data cluster after validity analysis is counted, and the samples are sorted in descending order of the sample proportion to obtain the candidate temperature and humidity cluster set.

[0086] It should be noted that the high-density clustered areas represent the most common temperature and humidity combinations, and best characterize the user's temperature and humidity preferences.

[0087] Step 2: Introduce timestamp features to verify the reliability of the candidate temperature and humidity cluster sets. Based on the reliability verification results, calculate the similarity between the temperature and humidity data of the current smart home system's operating environment and the temperature and humidity cluster centers in the candidate temperature and humidity cluster sets to obtain the reference temperature and humidity cluster set.

[0088] Specifically, the process of introducing timestamp features to verify the reliability of candidate temperature and humidity cluster sets is as follows:

[0089] Obtain the original timestamp information that corresponds one-to-one with the candidate temperature and humidity cluster samples;

[0090] Using days as the smallest time unit, the original timestamp information corresponding to the samples in the candidate temperature and humidity cluster is date-marked to determine the specific date to which each sample belongs; based on the date-marking results, the maximum consecutive date unit to which the samples in the candidate temperature and humidity cluster belong is calculated, that is, the maximum duration of consecutive date segments, measured in days;

[0091] Then, the proportion of the number of samples covered by the largest consecutive date unit to the total number of samples in the corresponding temperature and humidity cluster set is calculated, and this proportion is recorded as the proportion of consecutive date samples.

[0092] The reliability of the candidate temperature and humidity cluster sets was verified, and the verification process is as follows:

[0093] If the proportion of consecutive date samples in any candidate core area of ​​the candidate temperature and humidity cluster is greater than the preset threshold for consecutive date samples, then the temperature and humidity cluster is determined to be reliable.

[0094] If the proportion of consecutive date samples in any candidate core region of the candidate temperature and humidity cluster is less than or equal to the consecutive date sample threshold, then the temperature and humidity cluster is determined to be unreliable, and the candidate core region is removed from the candidate temperature and humidity cluster.

[0095] It should be noted that the continuous date sample threshold is a reference value determined by those skilled in the art based on industry historical practice experience, and is used to determine the reliability of the temperature and humidity cluster set.

[0096] For example, the first temperature and humidity cluster set contains 200 valid samples (based on previous analysis, the cluster set corresponds to a temperature of 23℃~26℃ and a humidity of 45%RH~55%RH, which initially points to the comfortable temperature and humidity range that users frequently encounter).

[0097] Extract the original timestamp information corresponding to each of the 200 samples, and perform date marking operation on the timestamp of each sample with the day as the smallest time unit to determine the specific date distribution of each sample within the time range of July 1, 2024 to July 31, 2024 (a total of 31 days);

[0098] Based on the date stamping results, it can be found that the samples in the first temperature and humidity cluster belong to a continuous date segment with a maximum consecutive date unit of 12 days (e.g., July 10, 2024 to July 21, 2024), and the number of samples covered in this continuous date segment is 120.

[0099] Then calculate the percentage of samples from consecutive dates: ;

[0100] If a person skilled in the art sets a threshold of 50% for continuous date samples based on industry historical practice experience, and since 60% > 50%, the first temperature and humidity cluster is determined to be reliable. That is, the temperature and humidity combination of "temperature 23℃~26℃, humidity 45%RH~55%RH" shows a stable and continuous distribution characteristic in the time dimension and can be used as an effective clustering result that reflects the user's long-term temperature and humidity preferences.

[0101] In addition, the specific process of calculating the similarity between the temperature and humidity data of the current smart home system's operating environment and the temperature and humidity cluster centers in the candidate temperature and humidity cluster sets to obtain the reference temperature and humidity cluster set is as follows:

[0102] The system collects temperature and humidity data from the environment in which the smart home system is currently in use.

[0103] Obtain the temperature cluster centers and humidity cluster centers from the clustering results corresponding to all candidate core regions in the candidate temperature and humidity cluster set after reliability verification;

[0104] Preset temperature control range and preset humidity control range are introduced, and the temperature and humidity data in the current smart home system usage environment are normalized using the Min-Max normalization method.

[0105] A preset temperature control range and a preset humidity control range are introduced, and the temperature cluster centers and humidity cluster centers are normalized using the Min-Max normalization method.

[0106] For the normalized temperature data, humidity data, and temperature and humidity cluster centers, the Euclidean distance formula is used to calculate the similarity between the temperature data and humidity data in the current smart home system usage environment and the temperature and humidity cluster centers in the clustering results corresponding to the candidate core area.

[0107] For example, in a smart home system, the preset temperature control range of the hardware unit is 16℃~32℃, and the preset humidity control range is 30%RH~70%RH.

[0108] The temperature data for the current smart home system's operating environment is 23.5℃ and the humidity data is 48%RH.

[0109] Obtain the temperature cluster center and humidity cluster center from the clustering results corresponding to any candidate core region in the candidate temperature and humidity cluster set that has been verified for reliability. The temperature cluster center is 24℃ and the humidity cluster center is 50%RH.

[0110] Using the Min-Max normalization method, with the hardware's preset control range as the benchmark (temperature 16–32℃, humidity 30%–70%RH), dimension differences are eliminated, and all data are mapped to the [0,1] interval. The normalization formula is: ;

[0111] Where x is the original value, x min To preset the lower limit of the control range, x max The upper limit of the preset control range;

[0112] Current temperature normalized value: ;

[0113] Current humidity normalized value: ;

[0114] Normalized temperature cluster centers: ;

[0115] Normalized values ​​of humidity cluster centers: ;

[0116] The normalized current temperature and humidity data ( , ) and cluster center ( , Substituting into the two-dimensional Euclidean distance formula, we can calculate the similarity between the two. The formula is: Calculations yielded ;

[0117] If the similarity between the temperature and humidity data in the current smart home system's operating environment and the temperature and humidity cluster centers in the clustering results corresponding to the candidate core area is greater than or equal to the similarity threshold, then the candidate core area will be removed from the candidate temperature and humidity cluster set.

[0118] All the calculated similarities are sorted from smallest to largest to obtain the reference temperature and humidity cluster set;

[0119] Step 3: Construct a user preference prediction model to predict the user's preferred temperature and humidity range. Perform a double match between the predicted user preference temperature and humidity range and the reference temperature and humidity cluster set to obtain pre-regulation parameters, which are used to adjust the smart home system in advance.

[0120] Specifically, the process of building a user preference prediction model to predict the user's preferred temperature and humidity range is as follows:

[0121] Historical temperature-humidity-timestamp correlation data (including original temperature data, original humidity data, and timestamp features corresponding to each candidate core area in the candidate temperature and humidity cluster set) is obtained and used as model training data. At the same time, real-time temperature-humidity-timestamp correlation data (including current environmental temperature data, humidity data, and timestamp features) is collected from the current smart home system usage environment and used as model validation dataset.

[0122] A user preference prediction model is constructed using a Long Short-Term Memory (LSTM) network combined with an attention mechanism. Let the model output the predicted temperature and humidity range for user preferences. The actual temperature and humidity range corresponding to the verification dataset is: The number of samples is n;

[0123] Then RMSE is defined as: This is used to measure the degree of deviation between the model's predicted values ​​and the actual values. The training objective is to make the RMSE < 5%.

[0124] The Adam optimizer is used to train the user preference prediction model. The model is constructed by going through the steps of first moment estimation, second moment estimation, momentum update, adaptive learning rate update, bias correction, and parameter update until RMSE < 5%. The model outputs the predicted value of the user's preferred temperature and humidity range.

[0125] Secondly, the process of performing a double match between the predicted user preference temperature and humidity range and the reference temperature and humidity cluster set to obtain the pre-regulation parameters is as follows:

[0126] Temperature range output based on user preference prediction model Temperature and humidity range Calculate and predict the temperature center Predicting humidity center Based on the reference temperature and humidity cluster, the temperature range of each candidate core region is obtained. Humidity range Calculate the candidate temperature center Candidate humidity center ;

[0127] Determine the temperature range of the model output Temperature and humidity range Clustering of temperature ranges with reference temperature and humidity Humidity range Are there any overlapping areas?

[0128] Temperature overlap condition: and If so, then the two temperature ranges overlap;

[0129] Humidity overlap conditions: and If so, the two humidity ranges overlap;

[0130] If any candidate core region satisfies both the temperature overlap condition and the humidity overlap condition, the candidate core region is considered a match; otherwise, it is directly judged as a mismatch and removed from the reference temperature and humidity cluster set.

[0131] For candidate core regions that satisfy both temperature and humidity overlap conditions, calculate the two-dimensional Euclidean distance between the center of the predicted temperature and humidity interval and the temperature and humidity center of the candidate core region: ,in, To predict the temperature center, To predict the humidity center, As a candidate temperature center, As a candidate humidity center, Used as a reference distance;

[0132] If the reference distance of any candidate core region that satisfies both the temperature and humidity overlap conditions is greater than or equal to the reference distance threshold, it is determined to be a mismatch and the candidate core region is removed from the reference temperature and humidity cluster.

[0133] If the reference distance of any candidate core region that satisfies both the temperature and humidity overlap conditions is less than the reference distance threshold, it is determined to be a match, and the pre-regulation parameters are obtained.

[0134] Finally, the specific process for pre-adjusting the smart home system is as follows:

[0135] Based on any set of pre-regulation parameters determined through double matching, the smart home server generates and issues corresponding temperature and humidity control commands. After the control commands are received and executed by the hardware control units (air conditioner, humidifier, dehumidifier) ​​in the smart home system, they drive the hardware control units to adjust the temperature and humidity of the current smart home system's usage environment. This ensures that the temperature and humidity data of the current environment meet the temperature overlap condition and humidity overlap condition, respectively (i.e., the current ambient temperature data falls within the temperature overlap range of the user's preferred temperature range associated with the pre-regulation parameters and the reference temperature and humidity cluster set, and the current ambient humidity data falls within the humidity overlap range of the user's preferred humidity range associated with the pre-regulation parameters and the reference temperature and humidity cluster set). Ultimately, this achieves advance control of the smart home system, ensuring that when the user enters the preset target usage scenario, the ambient temperature and humidity already meet their preferred needs.

[0136] Example 2

[0137] Based on the above embodiments, referring to Figure 2 As shown in the figure, this embodiment of a computer vision-based smart home control system includes:

[0138] Temperature and humidity data clustering and candidate cluster set generation module: Remove the timestamp features of temperature and humidity data, use the K-Means clustering algorithm to perform cluster analysis on temperature and humidity data respectively, perform validity analysis on the cluster analysis results, integrate the temperature clustering results and humidity clustering results to obtain temperature and humidity heat map, analyze the temperature and humidity heat map, and filter to obtain candidate temperature and humidity cluster sets;

[0139] The module for verifying the reliability of candidate temperature and humidity cluster sets and determining the reference cluster set introduces timestamp features to verify the reliability of candidate temperature and humidity cluster sets. Based on the reliability verification results, it calculates the similarity between the temperature and humidity data of the current smart home system's operating environment and the temperature and humidity cluster centers in the candidate temperature and humidity cluster sets, thus obtaining the reference temperature and humidity cluster set.

[0140] User temperature and humidity preference prediction and pre-regulation parameter generation module: Constructs a user preference prediction model to predict the user's preferred temperature and humidity range. The predicted user preferred temperature and humidity range is matched twice with a reference temperature and humidity cluster set to obtain pre-regulation parameters, which are used to adjust the smart home system in advance.

[0141] This system can adjust the temperature and humidity before the user enters the target environment, ensuring that the user can enjoy a comfortable environment that suits their habits without waiting. It solves the problems of lagging regulation and low preference matching in existing systems, ensures that the generated candidate cluster set is compatible with the actual execution capabilities of hardware such as air conditioners and humidifiers, avoids regulation failure caused by regulation parameters exceeding hardware limits, avoids regulation fluctuations caused by random data, and ensures stable long-term regulation effects.

[0142] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A computer vision-based smart home control method, characterized by: The application comprises the following steps: Step 1: remove the timestamp features of the temperature data and humidity data, respectively perform clustering analysis on the temperature data and humidity data by using a K-Means clustering algorithm, and perform effectiveness analysis on the clustering analysis results, integrate the temperature clustering results and humidity clustering results to obtain a temperature and humidity hotspot map, analyze the temperature and humidity hotspot map, and screen to obtain a candidate temperature and humidity clustering set; Step 2: introduce the timestamp feature, verify the reliability of the candidate temperature and humidity clustering set, based on the reliability verification result, calculate the similarity between the temperature data and humidity data of the current smart home system use environment and the temperature clustering center and humidity clustering center in the candidate temperature and humidity clustering set, and obtain a reference temperature and humidity clustering set; The specific process of verifying the reliability of the candidate temperature and humidity clustering set is as follows: obtain the original timestamp information corresponding to the samples in the candidate temperature and humidity clustering set; date mark the original timestamp information corresponding to the samples in the candidate temperature and humidity clustering set, determine the specific date to which each sample belongs; based on the date marking result, count the maximum continuous date unit of the date to which the samples in the candidate temperature and humidity clustering set belong, that is, the maximum length of the continuously appearing date section, in days as the unit of measurement; calculate the proportion of the number of samples covered by the maximum continuous date unit to the total number of samples in the corresponding temperature and humidity clustering set, and record the proportion as the continuous date sample proportion; if the continuous date sample proportion of any candidate core area in the candidate temperature and humidity clustering set is greater than a preset continuous date sample threshold, it is determined that the temperature and humidity clustering set is reliable; if the continuous date sample proportion of any candidate core area in the candidate temperature and humidity clustering set is less than or equal to the continuous date sample threshold, it is determined that the temperature and humidity clustering set is unreliable, and the candidate core area is removed from the candidate temperature and humidity clustering set; Step 3: construct a user use preference prediction model, predict a user preferred temperature and humidity interval, perform double matching between the predicted user preferred temperature and humidity interval and the reference temperature and humidity clustering set, and obtain a pre-control parameter for pre-controlling the smart home system. 2.The computer vision-based home intelligent control method of claim 1, wherein: The process of respectively performing clustering on the temperature data and humidity data by using the K-Means clustering algorithm is as follows: remove the timestamp features of the temperature data and humidity data, respectively perform clustering analysis on the N temperature data and humidity data by using the K-Means clustering algorithm, obtain clustering results, and the clustering results comprise: temperature data clusters, humidity data clusters, temperature clustering centers, and humidity clustering centers. 3.The computer vision-based home intelligent control method of claim 2, wherein: The specific process of performing effectiveness analysis on the clustering results is as follows: obtain the preset temperature control ability range and the preset humidity control ability range of the hardware unit, respectively perform effectiveness verification on the temperature values and humidity values in the temperature data clusters and humidity data clusters in the clustering results obtained by clustering analysis, and remove the temperature values and humidity values in the temperature data clusters and humidity data clusters that are not within the control ability range of the hardware unit; if any temperature value in the temperature data clusters is not within the preset temperature control ability range, it is determined that the temperature value is an invalid value, and the invalid value is removed. If any humidity value in the humidity data cluster is not within the preset humidity control ability range, it is determined that the humidity value is an invalid value, and the invalid value is removed. 4.The computer vision-based home intelligent control method of claim 1, wherein: The specific process of obtaining the temperature and humidity hotspot map is as follows: A two-dimensional coordinate system is constructed using the temperature data cluster and the humidity data cluster after effectiveness analysis, the X-axis is defined as the temperature value in the temperature data cluster, the Y-axis is defined as the humidity value in the humidity data cluster, the temperature value and the humidity value in the temperature data cluster and the humidity data cluster after effectiveness analysis are plotted in the two-dimensional coordinate system, and a temperature and humidity hotspot map is obtained. 5.The computer vision-based home intelligent control method of claim 1, wherein: The specific process of obtaining the candidate temperature and humidity clustering set is as follows: Based on the constructed temperature and humidity hotspot map, a high-density aggregation area naturally formed in the temperature and humidity hotspot map is identified; the high-density aggregation area is located and the boundary of the high-density aggregation area is defined through the color gradient characteristics of the hotspot map, and the temperature range and the humidity range corresponding to the high-density aggregation area are determined; If there are multiple discrete high-density aggregation areas in the temperature and humidity hotspot map, each high-density aggregation area is marked as a candidate core area 1, a candidate core area 2, and so on, to form a candidate core area set; In the candidate core area set, the proportion of the sample quantity of each candidate core area in the total sample quantity of the temperature data cluster and the humidity data cluster after effectiveness analysis is calculated, and the candidate core areas are sorted in descending order of sample proportion to obtain a candidate temperature and humidity clustering set. 6.The computer vision-based home intelligent control method of claim 1, wherein: The specific process of obtaining the reference temperature and humidity clustering set is as follows: Through the smart home system, temperature data and humidity data in the current smart home system use environment are collected; The temperature clustering center and the humidity clustering center in the clustering result corresponding to all candidate core areas in the candidate temperature and humidity clustering set after reliability verification are obtained; The preset temperature control ability range and the preset humidity control ability range are introduced, and the temperature data and the humidity data in the current smart home system use environment are normalized by Min-Max normalization method; The preset temperature control ability range and the preset humidity control ability range are introduced, and the temperature clustering center and the humidity clustering center are normalized by Min-Max normalization method; The similarity degree between the temperature data and the humidity data in the current smart home system use environment and the temperature clustering center and the humidity clustering center in the clustering result corresponding to the candidate core area is calculated by using the Euclidean distance formula; If the similarity degree between the temperature data and the humidity data in the current smart home system use environment and the temperature clustering center and the humidity clustering center in the clustering result corresponding to the candidate core area is greater than or equal to the similarity degree threshold, the candidate core area is removed from the candidate temperature and humidity clustering set; All the calculated similarity degrees are sorted from small to large to obtain a reference temperature and humidity clustering set. 7.The computer vision-based home intelligent control method of claim 1, wherein: The specific process of predicting the user preference temperature and humidity interval is as follows: Obtain the historical temperature data-humidity data-time stamp associated data corresponding to each candidate core area in the alternative temperature and humidity clustering set as model training data; collect real-time temperature data-humidity data-time stamp associated data in the current smart home system use environment as model validation data set; A long short-term memory network (LSTM) combined with an attention mechanism (Attention) is used to construct a user use preference prediction model, and the predicted value of the user preference temperature and humidity interval output by the model is , the actual temperature and humidity interval corresponding to the verification data set is , and the sample number n; The RMSE is defined as: , to measure the deviation degree of the model prediction value and the actual value, and the training target is to make RMSE < 5%. Train the user use preference prediction model using the Adam optimizer, through the first moment estimation, second moment estimation, momentum update, adaptive learning rate update, bias correction, and parameter update steps, until RMSE<5%, to construct the user use preference prediction model and output the predicted value of the user preference temperature and humidity interval. 8.The computer vision-based home intelligent control method of claim 1, wherein: The specific process of performing double matching to obtain the pre-regulation parameter is: Temperature interval output by a user usage preference prediction model , temperature and humidity interval , calculate predicted temperature center , predicted humidity center , based on each candidate core area in the reference temperature and humidity clustering set, obtain its temperature interval , humidity interval , calculate candidate temperature center , candidate humidity center ; temperature interval output by the determination model , temperature interval temperature interval in the reference temperature and humidity cluster , humidity interval whether there is an overlapping area Temperature overlap condition: and then the two temperature intervals have an intersection; Humidity overlap condition: and then the two humidity intervals intersect; If any candidate core area meets the temperature overlap condition and the humidity overlap condition, the candidate core area is matched, otherwise, it is determined as not matched, and the candidate core area is removed from the reference temperature and humidity clustering set; For the candidate core region satisfying the temperature overlap condition and the humidity overlap condition, a two-dimensional Euclidean distance between a predicted temperature and humidity interval center and a candidate core region temperature and humidity center is calculated: wherein, is a predicted temperature center, is a predicted humidity center, is a candidate temperature center, is a candidate humidity center, is a reference distance; If the reference distance of any candidate core area meeting the temperature overlap condition and the humidity overlap condition is greater than or equal to the reference distance threshold, it is determined as not matched, and the candidate core area is removed from the reference temperature and humidity clustering set; If the reference distance of any candidate core area meeting the temperature overlap condition and the humidity overlap condition is less than the reference distance threshold, it is determined as matched, and the pre-regulation parameter is obtained.

9. A computer vision-based home intelligent control system, characterized in that, The system is used to execute the smart home control method of any one of claims 1-8, comprising: The temperature and humidity data clustering and alternative clustering set generation module: remove the time stamp features of the temperature data and humidity data, use the K-Means clustering algorithm to perform clustering analysis on the temperature data and humidity data respectively, and perform effectiveness analysis on the clustering analysis results, integrate the temperature clustering results and humidity clustering results to obtain the temperature and humidity hotspot map, analyze the temperature and humidity hotspot map, and screen to obtain the alternative temperature and humidity clustering set; The alternative temperature and humidity clustering set reliability verification and reference clustering set determination module: introduce the time stamp feature, perform reliability verification on the alternative temperature and humidity clustering set, based on the reliability verification result, calculate the similarity between the temperature data and humidity data of the current smart home system use environment and the temperature clustering center and humidity clustering center in the alternative temperature and humidity clustering set, to obtain the reference temperature and humidity clustering set; The user temperature and humidity preference prediction and pre-regulation parameter generation module: construct a user use preference prediction model, predict the user preference temperature and humidity interval, perform double matching between the predicted user preference temperature and humidity interval and the reference temperature and humidity clustering set, and obtain the pre-regulation parameter for pre-regulation of the smart home system.

Citation Information

Patent Citations

  • Service platform for predicting future event

    CN101344953A

  • Intrusion detection method and device, computer equipment and storage medium

    CN109064694A