Smart home equipment control method and device, equipment and medium

Through vectorization processing and local policy prediction, smart home devices can dynamically adjust control strategies, solving the problems of personalized user needs and intelligent response, and achieving efficient and personalized device control.

CN121454968APending Publication Date: 2026-02-03GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511428098.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Smart home devices lack a deep understanding of individual user behavior patterns, resulting in an inability to meet users' personalized needs, low levels of intelligence, and difficulty in responding efficiently.

Method used

By collecting real-time operation records, vectorizing them, generating the current behavior vector, comparing it with historical behavior vectors in the local vector database, and combining environmental parameters to predict strategies, the device control strategy is dynamically adjusted.

Benefits of technology

It enables personalized control of smart home devices, improves response speed, reduces reliance on cloud computing resources, lowers overall costs, and enhances the system's intelligence and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121454968A_ABST
    Figure CN121454968A_ABST
Patent Text Reader

Abstract

The invention provides a smart home equipment control method and device, equipment and a medium, and relates to the technical field of smart home, and the method comprises the steps: continuously collecting real-time operation records for smart home equipment, carrying out the vectorization of the real-time operation records, obtaining a corresponding current behavior vector, and carrying out the vectorization of the real-time operation records; the method comprises the steps of obtaining a current behavior vector, comparing the current behavior vector with historical behavior vectors in a local vector database corresponding to the smart home device, taking a target historical behavior vector meeting a condition as context information, then obtaining environment parameters of an environment where the smart home device is located, and performing strategy prediction according to the context information and the environment parameters. According to the method, the control strategy for the smart home equipment is obtained, the current demand of a user can be met, intelligent and personalized equipment control is realized, the response speed of the equipment is improved, the dependence of the equipment on cloud computing resources can be reduced, the overall cost is reduced through local optimization, and efficient operation of the smart home system is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home technology, and in particular to a control method for a smart home device, a control device for a smart home device, an electronic device, and a readable storage medium. Background Technology

[0002] With the development of smart home technology, smart home systems consist of various smart home devices. Different smart home devices can provide users with different smart home services to improve their convenience. However, in the process of providing smart home services, these devices lack a deep understanding and adaptability to individual user behavior patterns. This results in smart home devices failing to fully meet users' personalized needs, and their level of intelligence is not high, making it difficult to meet users' demands for intelligent and efficient responses. Summary of the Invention

[0003] This invention provides a control method, device, electronic device, and readable storage medium for smart home devices, in order to solve or partially solve the problems that smart home devices cannot meet users' personalized needs and are difficult to satisfy users' needs for intelligence and efficient response.

[0004] This invention discloses a control method for smart home devices, comprising:

[0005] Collect real-time operation records for smart home devices;

[0006] The real-time operation record is vectorized to obtain the corresponding current behavior vector;

[0007] The current behavior vector is compared with the historical behavior vectors in the local vector database corresponding to the smart home device, and the target historical behavior vector that meets the conditions is used as context information.

[0008] The system obtains environmental parameters of the environment in which the smart home device is located, and performs policy prediction based on the context information and the environmental parameters to obtain a control policy for the smart home device.

[0009] In some feasible implementations, the vectorization of the real-time operation record to obtain the corresponding current behavior vector includes:

[0010] Feature extraction is performed on the real-time operation records to obtain the corresponding real-time operation features;

[0011] The real-time operation features are converted into a first data code, and the first data code is reduced in dimensionality to obtain the current behavior vector corresponding to the real-time operation record.

[0012] In some feasible implementations, converting the real-time operation features into a first data code includes:

[0013] Obtain the data type corresponding to the real-time operation feature;

[0014] Obtain the conversion information corresponding to the data type, and convert the real-time operation feature into the corresponding first data code according to the conversion information.

[0015] In some feasible implementations, the real-time operation characteristics include at least one of the following: time characteristics, frequency, duration, operation type, operation object, operation parameters, and user identity.

[0016] In some feasible implementations, the first data encoding includes at least several features of different dimensions, and the step of dimensionality reduction of the first data encoding to obtain the current behavior vector corresponding to the real-time operation record includes:

[0017] Calculate the mean and standard deviation corresponding to each feature, and use the mean and standard deviation to transform the features in the first data encoding to obtain the standardized vector corresponding to the first data encoding;

[0018] Calculate the covariance matrix corresponding to the standardized vector;

[0019] The covariance matrix is ​​decomposed to obtain several eigenvalues ​​and eigenvectors corresponding to each eigenvalue, and the variance contribution rate corresponding to each eigenvalue is calculated based on the eigenvalues.

[0020] Determine the retention value corresponding to the variance contribution rate;

[0021] The feature vectors are sorted according to the magnitude of the feature values, and the corresponding target feature vectors are extracted from the feature vectors according to the retention values.

[0022] Each of the aforementioned features is mapped onto the target feature vector to obtain the current behavior vector corresponding to the real-time operation record.

[0023] In some feasible implementations, the step of using the target historical behavior vector that meets the conditions as context information includes:

[0024] Calculate the similarity between the current behavior vector and the historical behavior vector;

[0025] Use the target's historical behavior vector with a similarity greater than or equal to a preset threshold as context information.

[0026] Among some feasible implementation methods are:

[0027] Obtain the historical operation records corresponding to the smart home devices;

[0028] Feature extraction is performed on the historical operation records to obtain the corresponding historical operation features;

[0029] The historical operation features are converted into a second data code, and the second data code is dimensionality reduced to obtain the historical behavior vector corresponding to the historical operation record.

[0030] A local vector database corresponding to the smart home device is constructed by using at least one of the historical operation features, the second data encoding, and the historical behavior vector.

[0031] This invention also discloses a control device for smart home devices, comprising:

[0032] The data collection module is used to collect real-time operation records of smart home devices;

[0033] The vector processing module is used to perform vectorization processing on the real-time operation record to obtain the corresponding current behavior vector;

[0034] The vector comparison module is used to compare the current behavior vector with the historical behavior vectors in the local vector database corresponding to the smart home device, and use the target historical behavior vector that meets the conditions as context information.

[0035] The strategy prediction module is used to obtain environmental parameters of the environment in which the smart home device is located, and to perform strategy prediction based on the context information and the environmental parameters to obtain a control strategy for the smart home device.

[0036] In some feasible implementations, the vector processing module is specifically used for:

[0037] Feature extraction is performed on the real-time operation records to obtain the corresponding real-time operation features;

[0038] The real-time operation features are converted into a first data code, and the first data code is reduced in dimensionality to obtain the current behavior vector corresponding to the real-time operation record.

[0039] In some feasible implementations, the vector processing module is specifically used for:

[0040] Obtain the data type corresponding to the real-time operation feature;

[0041] Obtain the conversion information corresponding to the data type, and convert the real-time operation feature into the corresponding first data code according to the conversion information.

[0042] In some feasible implementations, the real-time operation characteristics include at least one of the following: time characteristics, frequency, duration, operation type, operation object, operation parameters, and user identity.

[0043] In some feasible implementations, the first data encoding includes at least several features of different dimensions, and the vector processing module is specifically used for:

[0044] Calculate the mean and standard deviation corresponding to each feature, and use the mean and standard deviation to transform the features in the first data encoding to obtain the standardized vector corresponding to the first data encoding;

[0045] Calculate the covariance matrix corresponding to the standardized vector;

[0046] The covariance matrix is ​​decomposed to obtain several eigenvalues ​​and eigenvectors corresponding to each eigenvalue, and the variance contribution rate corresponding to each eigenvalue is calculated based on the eigenvalues.

[0047] Determine the retention value corresponding to the variance contribution rate;

[0048] The feature vectors are sorted according to the magnitude of the feature values, and the corresponding target feature vectors are extracted from the feature vectors according to the retention values.

[0049] Each of the aforementioned features is mapped onto the target feature vector to obtain the current behavior vector corresponding to the real-time operation record.

[0050] In some feasible implementations, the vector comparison module is specifically used for:

[0051] Calculate the similarity between the current behavior vector and the historical behavior vector;

[0052] Use the target's historical behavior vector with a similarity greater than or equal to a preset threshold as context information.

[0053] Among some feasible implementation methods are:

[0054] The history record module is used to obtain the historical operation records corresponding to the smart home devices;

[0055] The feature extraction module is used to extract features from the historical operation records to obtain the corresponding historical operation features;

[0056] The conversion module is used to convert the historical operation features into a second data code, and to reduce the dimensionality of the second data code to obtain the historical behavior vector corresponding to the historical operation record.

[0057] The database construction module is used to construct a local vector database corresponding to the smart home device by using at least one of the historical operation features, the second data encoding, and the historical behavior vector.

[0058] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0059] The memory is used to store computer programs;

[0060] When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.

[0061] This invention also discloses a readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the method described in this invention.

[0062] The embodiments of the present invention have the following advantages:

[0063] In this embodiment of the invention, during the process of smart home devices providing smart home services to users, real-time operation records of the smart home devices can be continuously collected. These records can then be vectorized to obtain the corresponding current behavior vector. This current behavior vector is compared with historical behavior vectors in the local vector database corresponding to the smart home device. Target historical behavior vectors that meet certain conditions are used as context information. Then, environmental parameters of the smart home device's environment are obtained, and policy prediction is performed based on the context information and environmental parameters to obtain a control strategy for the smart home device. Thus, through vectorization, user operation records are converted into vectors for model optimization, which is beneficial for analyzing user behavior patterns. Simultaneously, based on the constructed vector database, the current behavior vector is compared with historical behavior vectors. Based on the comparison results and the real-time environment, the control strategy of the smart home device is dynamically adjusted. This not only meets the user's current needs but also enables intelligent and personalized device control, improves device response speed, reduces the device's dependence on cloud computing resources, lowers overall costs through local optimization, and achieves efficient operation of the smart home system. Attached Figure Description

[0064] Figure 1 This is a flowchart illustrating the steps of a control method for a smart home device provided in an embodiment of the present invention;

[0065] Figure 2 This is a schematic diagram of the model optimization process provided in the embodiments of the present invention;

[0066] Figure 3 This is a structural block diagram of a control device for a smart home device provided in an embodiment of the present invention. Detailed Implementation

[0067] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0068] As an example, smart home devices lack a deep understanding and adaptability to individual user behavior patterns when providing smart home services. This results in smart home devices failing to fully meet users' personalized needs, and the devices' level of intelligence is not high, making it difficult to meet users' demands for intelligence and efficient response.

[0069] In this invention, during the process of smart home devices providing smart home services to users, real-time operation records of the smart home devices can be continuously collected. These records are then vectorized to obtain the corresponding current behavior vector. This current behavior vector is compared with historical behavior vectors in the local vector database corresponding to the smart home device. Target historical behavior vectors that meet certain conditions are used as context information. Environmental parameters of the smart home device's environment are then obtained, and policy prediction is performed based on the context information and environmental parameters to obtain a control strategy for the smart home device. Thus, through vectorization, user operation records are converted into vectors for model optimization, which is beneficial for analyzing user behavior patterns. Furthermore, based on the constructed vector database, the current behavior vector is compared with historical behavior vectors. Based on the comparison results and the real-time environment, the control strategy of the smart home device is dynamically adjusted. This not only meets the user's current needs but also enables intelligent and personalized device control, improves device response speed, reduces the device's dependence on cloud computing resources, lowers overall costs through local optimization, and achieves efficient operation of the smart home system.

[0070] Reference Figure 1 The diagram illustrates a flowchart of a control method for a smart home device provided in an embodiment of the present invention, which may specifically include the following steps:

[0071] Step 101: Collect real-time operation records for smart home devices;

[0072] In the field of smart homes, interactions between smart home devices are frequent and diverse. Each smart home device can be equipped with a corresponding device control model. Based on this model, the smart home device can be effectively controlled to perform corresponding operations, thereby providing users with corresponding smart home services and improving the quality and intelligence of these services.

[0073] For smart home systems, they can provide corresponding data collection capabilities. By embedding corresponding sensors and recording corresponding logs in various smart home devices, they can collect user operation records of smart home devices, so as to analyze the user's "preferences" based on the operation records, and then provide personalized smart home services based on the analysis results.

[0074] For example, for lighting control, smart home devices can record the time when users turn lights on and off, brightness conditions, and color selections; for temperature adjustment, they can collect information such as the user-set temperature, usage time period, and frequency of changes; for security systems, they can monitor the alarm status, access time, and usage frequency set by the user. Furthermore, after collecting user operation records, the corresponding edge computing modules of smart home devices can perform preprocessing to remove noise and abnormal data, ensuring data accuracy and quality.

[0075] In the process of smart home devices providing smart home services to users, such as lighting devices providing lighting services and air conditioning devices providing temperature regulation services, smart home devices can continuously collect real-time operation records of user input. Based on these real-time operation records, the device control model of the smart home device can be fine-tuned to better adapt to user habits. This enables a lightweight inference engine, allowing the smart home device to perform model optimization in real time, ensuring that the device can quickly respond to changes in user behavior and improve the user experience.

[0076] In addition, real-time operation records can be used to record user actions on smart home devices, such as the on / off status, on / off time, and brightness adjustment value of lights, as well as the temperature control settings of air conditioning devices. Smart home devices can record each operation record so that corresponding features can be extracted from the operation records and further constructed into corresponding behavior vectors.

[0077] Step 102: Vectorize the real-time operation record to obtain the corresponding current behavior vector;

[0078] For smart home devices, the device control model configured can be a personalized optimization model based on user operation records. Optionally, during the model training process, the model can be trained by combining the user behavior vector as an additional input with the training dataset, so that the device control model can make more personalized control decisions based on the user's usage habits.

[0079] For example, the training dataset can be the current state (such as the current temperature, current light intensity, current time, and the working status of the device). Under normal circumstances, the device control model can provide control strategies that are adapted to the current state, but it cannot meet the personalized needs of users. Based on this, by adding user behavior vectors, the device control model can make more personalized control decisions by combining the user's usage habits.

[0080] Since the device control model has already been optimized using user behavior vectors, the smart home device can vectorize the real-time operation records collected by the smart home device locally to obtain the corresponding current behavior vector. This allows for the extraction of key features that effectively represent user behavior through vectorization, and also effectively reduces the amount of data processing and improves response speed by converting the data into vectors.

[0081] In some feasible implementations, features can be extracted from the real-time operation records to obtain the corresponding real-time operation features and identify key features that can be used to describe user behavior patterns. Then, the real-time operation features are converted into a first data code and the first data code is dimensionality reduced to obtain the current behavior vector corresponding to the real-time operation record. Thus, through vectorization, the data can be effectively simplified and the response speed of smart home devices can be improved while retaining the user's main behavior model information.

[0082] Based on the differences in the types of smart home devices, the extracted real-time operation features include at least one of the following: time features, frequency, duration, operation type, operation object, operation parameters, and user identity. During the feature conversion process, the data type corresponding to the real-time operation feature can be obtained, followed by the conversion information corresponding to the data type. The real-time operation feature is then converted into the corresponding first data code according to the conversion information. This unifies the conversion of data of various formats into the first data code, giving the data a standardized format, which is convenient for subsequent processing and analysis. At the same time, the converted data code is more regular in data structure, which can effectively improve the speed and efficiency of data processing.

[0083] In a specific implementation, data encoding can involve converting extracted operational features into numerical representations, enabling them to be processed by the device control model of smart home devices. During this conversion process, categorical data can be converted into numerical data, and corresponding time-series data can be processed. For example, timestamps can be represented as numerical features using hours, operation types can be converted into numerical vectors using one-hot encoding, brightness values ​​can be used directly, and color values ​​can be encoded using one-hot encoding, etc. This invention does not impose any limitations on these aspects.

[0084] In some examples, taking operation types as an example, in a smart lighting system, common operation types can include turning on the light, turning off the light, adjusting brightness, and adjusting color. These operation types can be encoded into different numerical vectors, such as turning on the light → [1, 0, 0, 0], turning off the light → [0, 1, 0, 0], adjusting brightness → [0, 0, 1, 0], and changing color → [0, 0, 0, 1], etc., so that smart home devices can recognize the operation performed by the user.

[0085] Furthermore, a real-time operation record can include several features of different dimensions, such as time features, device type, operation type, parameter values, and environmental context. Dimensionality reduction can then be applied to reduce the high-dimensional feature vector to a low-dimensional vector, reducing computational complexity while retaining important information. Optionally, the mean and standard deviation of each feature can be calculated, and the features in the first data encoding can be transformed using these values ​​to obtain a standardized vector. Then, the covariance matrix corresponding to the standardized vector is calculated, and the covariance matrix is ​​decomposed to obtain several eigenvalues ​​and their corresponding eigenvectors. The variance contribution rate of each eigenvalue is calculated, and the retained value corresponding to the variance contribution rate is determined. The eigenvectors are then sorted according to the size of the eigenvalues, and the corresponding target eigenvectors are extracted from the eigenvectors according to the retained values. Finally, each feature is mapped to the target eigenvector to obtain the current behavior vector corresponding to the real-time operation record. Thus, through the feature dimensionality reduction process, important information can be retained while effectively reducing data complexity.

[0086] For example, for a real-time operation record (e.g., "Monday evening 7:30, adjust the brightness of the main living room light to 60%), the smart home device can extract and encode its features to obtain a "first data encoding" vector X_raw = [x1, x2, x3, ..., xN] containing N features.

[0087] The vector may include at least:

[0088] Time characteristics: time of day (19.5), day of week (1).

[0089] Device type: Living room main light (unique thermal encoding, such as [1,0,0]).

[0090] Operation type: Adjust brightness (one-hot encoding, such as [0,1,0]).

[0091] Parameter value: Brightness value (60).

[0092] Environmental context: Ambient light intensity (300 lux).

[0093] For the original N-dimensional encoding, dimensionality reduction can be used to extract the core features that best represent user behavior patterns. The relevant process may include:

[0094] First, the data can be standardized to eliminate the influence of differences in the dimensions and numerical ranges among multiple feature variables on the analysis results, and to prevent certain features from dominating the subsequent analysis due to their large numerical magnitude. For example, there is a significant difference in the numerical range between the time feature value (19.5) and the brightness feature value (60). Standardization can make them comparable. Specifically, the arithmetic mean (μ) and standard deviation (σ) of each feature dimension can be calculated separately. Then, based on the calculation results, each data point can be transformed X_standardized[i]=(x_i-μ_i) / σ_i, thus obtaining a standardized vector X=[x1',x2',x3',...,xN'], where the mean of all features is 0 and the standard deviation is 1, which are on the same order of magnitude.

[0095] Next, the covariance matrix corresponding to the data can be calculated to analyze the linear relationship between the standardized features. This covariance matrix effectively reveals the tendency of each feature, such as a tendency to change simultaneously (positive correlation) or to change in opposite directions (negative correlation). Specifically, assuming a dataset containing M user operation records has been constructed, and each record has been standardized, this dataset can be constructed as an M*N matrix. Then, the NxN-dimensional covariance matrix Σ of this matrix is ​​calculated. The matrix element Σ(i, j) represents the covariance between the i-th feature and the j-th feature.

[0096] After obtaining the covariance matrix, the corresponding principal component directions can be obtained by decomposing the covariance matrix. Specifically, by performing eigenvalue decomposition on the covariance matrix Σ, a set of eigenvalues ​​λ1,λ2,...,λN and corresponding eigenvectors v1,v2,...,vN can be obtained. This allows for further selection of the most important principal components that can retain most of the data information, thus achieving dimensionality reduction.

[0097] Specifically, the magnitude of the eigenvalue λ_i represents the variance of the data along the direction of its corresponding eigenvector v_i, i.e., the "importance" of the principal component. Therefore, the eigenvalues ​​can be sorted from largest to smallest: λ1>λ2>...>λN. Simultaneously, the number K of principal components to be retained can be determined by calculating the percentage of the sum of the top K eigenvalues ​​relative to the total sum of eigenvalues. For example, we choose the smallest K such that (λ1+λ2+...+λK) / (sum of all eigenvalues)>=95%. Finally, the top K most important eigenvectors [v1,v2,...,vK] can be selected as the new coordinate axis basis. Optionally, K < <N。

[0098] Finally, the original N-dimensional data points can be transformed into a new K-dimensional principal component space to obtain the dimensionality-reduced representation, i.e., the current behavior vector. During this mapping process, for the first data encoding requiring dimensionality reduction, projection (dot product) calculation can be performed with the selected K feature vectors. The calculation method can be: current behavior vector = [X·v1, X·v2, ..., X·vK], where · represents the dot product operation of vectors. Based on the calculation result, the N-dimensional "first data encoding" X can be transformed into a K-dimensional current behavior vector [p1, p2, ..., pK]. Thus, through the feature dimensionality reduction process, the complexity of the data can be effectively reduced while retaining important information.

[0099] Step 103: Compare the current behavior vector with the historical behavior vectors in the local vector database corresponding to the smart home device, and use the target historical behavior vector that meets the conditions as context information;

[0100] In this embodiment of the invention, after the real-time operation record is converted into the corresponding current behavior vector, the current behavior vector can be compared with the historical behavior vector in the local vector database corresponding to the smart home device. Based on the comparison result, the target historical behavior vector is selected from the historical behavior vector as context information so as to predict the control strategy based on the context information. Thus, based on vector comparison, the historical records corresponding to the current behavior vector can be quickly retrieved from the vector database, and "similar behavior patterns" can be identified so as to trigger dynamic adjustment when similar historical behaviors are identified.

[0101] In the process of vector comparison, smart home devices can calculate the similarity between the current behavior vector and the historical behavior vector, and then use the target historical behavior vector with a similarity greater than or equal to a preset threshold as context information. For example, if the similarity can be cosine similarity, then the historical behavior vector with a preset similarity greater than or equal to 0.85 can be used as the target historical behavior vector for further prediction of control strategies.

[0102] It should be noted that for the vector database, the historical operation records corresponding to the smart home devices can be obtained. Then, the historical operation records are used to extract features to obtain the corresponding historical operation features. The historical operation features are then converted into a second data code, and the second data code is dimensionality reduced to obtain the historical behavior vector corresponding to the historical operation record. Finally, at least one of the historical operation features, the second data code, and the historical behavior vector is used to construct the local vector database corresponding to the smart home devices.

[0103] In some examples, the collected raw data can be transformed into high-dimensional vectors for further analysis and model optimization. The vectorization process includes the following steps:

[0104] 1. Feature Extraction

[0105] Feature extraction involves identifying key features from raw user operation records that can be used to describe user behavior patterns. These features typically include time, frequency, duration, and operation type. For example, in a smart lighting system, user operation records may include timestamps, operation types (such as turning on the light, turning off the light, adjusting brightness, changing color), brightness values, and colors. From these records, smart home devices can extract features such as operation time, operation frequency, brightness preferences, and color preferences.

[0106] 2. Data Encoding

[0107] Data encoding is the process of transforming extracted features into numerical representations that can be processed by machine learning models. This typically involves converting categorical data into numerical data and processing time-series data. For example, timestamps can be represented as numerical features using hours, operation types can be converted into numerical vectors using one-hot encoding, brightness values ​​can be used directly, and color is represented using one-hot encoding. For instance, in a smart lighting system, common operation types include: turning lights on, turning lights off, adjusting brightness, and changing color.

[0108] These operation types are encoded into different numerical vectors, such as: turn on the light → [1, 0, 0, 0], turn off the light → [0, 1, 0, 0], adjust the brightness → [0, 0, 1, 0], and change the color → [0, 0, 0, 1], so that smart home devices can accurately identify the control operations performed by the user.

[0109] 3. Dimensionality reduction

[0110] Dimensionality reduction uses techniques such as Principal Component Analysis (PCA) or t-SNE to reduce the dimensionality of high-dimensional feature vectors, thereby reducing computational complexity while retaining important information. For example, in a smart lighting system, the generated high-dimensional feature vectors can be reduced to a lower dimension using PCA, simplifying computation and preserving key behavioral pattern information. Yes, here, the high-dimensional feature vector refers to the result after data encoding.

[0111] For example, a user's operation record in a lighting system may include information such as time, frequency, brightness, and color. This information is encoded into multi-dimensional vectors to form a high-dimensional representation.

[0112] 4. Construction of Vector Database

[0113] Through the steps described above, users' historical control records are transformed into structured numerical vectors, and these vectors are used to build an efficient vector database. During database construction, a database type suitable for storing high-dimensional vectors (such as a NoSQL database) can be used, and indexing technologies such as LSH can be employed to support fast similarity queries. Furthermore, a distributed database architecture can be used to improve storage capacity and access speed, ensuring system performance under high concurrency environments.

[0114] Through the above process, user history control records can be transformed into high-dimensional vectors, and a vector database can be built to support local model tuning. The core is to transform users' "unstructured operational behaviors" into "structured behavioral semantics" in a computable, comparable, and learnable vector form, thereby providing high-value personalized input for the local large model and realizing deep recognition and dynamic adaptation of user behavior patterns.

[0115] It should be noted that the processing of historical behavior vectors can be referred to the processing of current behavior vectors in the aforementioned embodiments, and will not be repeated here.

[0116] Step 104: Obtain the environmental parameters of the environment in which the smart home device is located, and perform policy prediction based on the context information and the environmental parameters to obtain a control strategy for the smart home device.

[0117] Once a smart home device retrieves a target historical behavior vector similar to the current behavior vector from the vector database, it can trigger the dynamic adjustment mechanism of the device control model. By using the matched target historical behavior vector as context information and combining it with the acquired environmental parameters for real-time inference, the device control model no longer relies on general rules but can generate personalized control strategies based on the user's historical preferences. Then, based on the control strategy, the corresponding device operation is executed, such as automatically turning on the lights and setting them to 60% brightness, automatically setting the air conditioner to 26℃ and switching to sleep mode, and automatically putting the security system into "nighttime arming" mode. Through vectorization, the user's operation records are converted into vectors for model optimization, which is beneficial for analyzing user behavior patterns. At the same time, based on the constructed vector database, the current behavior vector is compared with the historical behavior vector. Based on the comparison results and the real-time environment, the control strategy of the smart home device is dynamically adjusted. This not only meets the user's current needs but also enables intelligent and personalized device control, improves device response speed, reduces the device's dependence on cloud computing resources, reduces overall costs through local optimization, and achieves efficient operation of the smart home system.

[0118] Furthermore, the lightweight inference engine deployed in the smart home system supports real-time model updates and policy generation on the device side. Model parameters are fine-tuned based on new input vectors (e.g., through gradient descent or incremental learning) without retraining; the adjusted control policy takes effect immediately. Additionally, the newly generated control policy is recorded as a new historical operation, and a new behavior vector is generated and stored in the database. This vector can then participate in subsequent pattern recognition, forming a complete closed loop of "behavior acquisition—vectorization—matching—policy generation—new behavior recording—re-optimization." Consequently, as user frequency increases, the system's accuracy in recognizing user behavior patterns and the rationality of control policies continuously improve.

[0119] Through the above process, smart home systems can significantly improve personalization capabilities and response speed, providing users with more intelligent and user-friendly services. This vectorization processing method is not only applicable to lighting systems, but can also be extended to other smart home devices, such as temperature control systems and security systems, by extracting and encoding relevant features to build a personalized control model for each device.

[0120] It should be noted that the embodiments of the present invention include, but are not limited to, the examples described above. It is understood that those skilled in the art can make further settings according to actual needs under the guidance of the ideas in the embodiments of the present invention, and the present invention does not limit such settings.

[0121] In this embodiment of the invention, during the process of smart home devices providing smart home services to users, real-time operation records of the smart home devices can be continuously collected. These records can then be vectorized to obtain the corresponding current behavior vector. This current behavior vector is compared with historical behavior vectors in the local vector database corresponding to the smart home device. Target historical behavior vectors that meet certain conditions are used as context information. Then, environmental parameters of the smart home device's environment are obtained, and policy prediction is performed based on the context information and environmental parameters to obtain a control strategy for the smart home device. Thus, through vectorization, user operation records are converted into vectors for model optimization, which is beneficial for analyzing user behavior patterns. Simultaneously, based on the constructed vector database, the current behavior vector is compared with historical behavior vectors. Based on the comparison results and the real-time environment, the control strategy of the smart home device is dynamically adjusted. This not only meets the user's current needs but also enables intelligent and personalized device control, improves device response speed, reduces the device's dependence on cloud computing resources, lowers overall costs through local optimization, and achieves efficient operation of the smart home system.

[0122] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following examples are provided for illustrative purposes:

[0123] As an example, refer to Figure 2 This diagram illustrates a model optimization process provided in an embodiment of the present invention. In the field of smart homes, user interactions with devices are frequent and diverse. To effectively optimize the device control model, historical control records of users can be systematically collected and vectorized. This process can include at least data collection, feature extraction, data encoding, dimensionality reduction, and the construction of a vector database and local model optimization. The corresponding implementation process can be shown below:

[0124] A smart home system first needs to have strong data collection capabilities. Each device records user behavior through embedded sensors and logs. The collected operation records can be preliminarily processed by the device's edge computing module to remove noise and abnormal data, ensuring the accuracy and quality of the data.

[0125] Based on the collected raw data, it needs to be transformed into high-dimensional vectors for further analysis and model optimization. Vectorization includes the following steps:

[0126] 1. Feature Extraction

[0127] Feature extraction involves identifying key features from raw user operation records that can be used to describe user behavior patterns. These features typically include time, frequency, duration, and operation type. For example, in a smart lighting system, a user's operation record might include timestamps, operation type (such as turning on the light, turning off the light, adjusting brightness, changing color), brightness value, and color. From these records, we can extract features such as operation time, operation frequency, brightness preference, and color preference.

[0128] 2. Data Encoding

[0129] Data encoding is the process of transforming extracted features into numerical representations that can be processed by machine learning models. This typically involves converting categorical data into numerical data and processing time-series data. For example, timestamps can be represented as numerical features using hours, operation types can be converted into numerical vectors using one-hot encoding, brightness values ​​can be used directly, and color is represented using one-hot encoding.

[0130] 3. Dimensionality reduction

[0131] Dimensionality reduction uses techniques such as Principal Component Analysis (PCA) or t-SNE to reduce the dimensionality of high-dimensional feature vectors, thereby reducing computational complexity while preserving important information. For example, in a smart lighting system, the generated high-dimensional feature vectors can be reduced to a lower dimension using PCA, simplifying computation and retaining key behavioral pattern information.

[0132] 4. Construction of Vector Database

[0133] Through the steps described above, we transform users' historical control records into structured numerical vectors and use these vectors to build an efficient vector database. The database design must consider suitable database types for storing high-dimensional vectors (such as NoSQL databases) and employ indexing techniques such as LSH (Locality-Sensitive Hashing) to support fast similarity queries. Furthermore, a distributed database architecture is used to improve storage capacity and access speed, ensuring system performance under high concurrency environments.

[0134] By converting user history control records into high-dimensional vectors and building a vector database to support local model optimization, the user's "unstructured operational behavior" is transformed into "structured behavioral semantics" through a computable, comparable, and learnable vector form. This provides high-value personalized input for the local large model, enabling deep recognition and dynamic adaptation of user behavior patterns.

[0135] Specifically, within the technical framework of this invention, the process achieves precise capture of behavioral patterns through the following three steps:

[0136] 1. From raw operation records to computable vectors: Constructing "digital fingerprints" of user behavior:

[0137] In the preferred embodiment of this invention, the system first collects structured user operation records on devices such as lighting, temperature control, and security systems, including timestamps, operation types (on / off / brightness adjustment / temperature adjustment), parameter values ​​(brightness value, temperature setting), and usage frequency. This raw data, after preprocessing by the edge computing module, enters the vectorization processing flow.

[0138] Feature extraction: For intelligent lighting systems, key features such as "operation time", "operation frequency", "brightness preference" and "color preference" are extracted; for temperature control systems, behavioral features such as "set temperature", "usage time period" and "number of frequent adjustments" are extracted.

[0139] Data encoding: The operation type is converted into a numerical vector through one-hot encoding (e.g., "turn on the light" → [1,0,0]); the timestamp is encoded in hours or periodic sine waves (e.g., cos(2π×hours / 24)); continuous values ​​such as brightness and temperature are normalized (e.g., [0,100] → [0,1]).

[0140] Dimensionality reduction: Principal component analysis is used to reduce the dimensionality of the high-dimensional feature vectors, retaining the top 50-200 principal components with the highest variance contribution rate, and generating low-dimensional but information-dense user behavior vectors.

[0141] For example, if a user turns on their lights every Wednesday and Friday between 8 PM and 10 PM, maintaining a brightness of around 60%, their behavior is encoded as a vector with clear time preferences, brightness preferences, and frequency characteristics. This vector is the user's "behavioral fingerprint" in a specific scenario, possessing uniqueness and comparability.

[0142] Based on user behavior data in a vector database, smart home devices can dynamically optimize their control models.

[0143] Model fine-tuning: Using transfer learning techniques, user behavior vectors are used as additional inputs to fine-tune the device's control model, making it better suited to user habits.

[0144] Real-time updates: Implement a lightweight inference engine that can perform model updates and optimizations in real time on the device, ensuring that the device can quickly respond to changes in user behavior.

[0145] Personalized strategy: Based on the user's historical records, dynamically adjust the device's control strategy, such as automatically adjusting light brightness and temperature settings, to enhance the user experience.

[0146] The dynamic adjustment process is as follows:

[0147] 1. Behavior vector generation and history matching:

[0148] The system continuously collects user operation records on smart home devices (such as light on / off times, brightness adjustment values, temperature control settings, etc.); it extracts features from each record (time, frequency, operation type, parameter values, etc.), and generates a high-dimensional user behavior vector after data encoding (one-hot encoding, normalization) and dimensionality reduction processing (such as PCA); this vector is stored in a local vector database and compared with historical behavior vectors; when a new operation occurs, the system uses indexing technologies such as LSH to quickly retrieve historical records in the database whose cosine similarity to the current behavior vector exceeds a preset threshold (such as 0.85), thus identifying "similar behavior patterns".

[0149] For example, if a user turns on the lights at 7:30 PM every Monday to Friday and sets them to 60% brightness, this behavior is encoded into a vector and stored in clusters. When the system detects that the current time matches this pattern, it determines it as "identified behavior".

[0150] 2. Triggering model fine-tuning and policy generation:

[0151] Once similar historical behaviors are identified, the system triggers a dynamic adjustment mechanism for the local model. During the inference phase, the local large model (such as a lightweight Transformer or CNN) uses the matched historical behavior vectors as context input, combined with the current environmental conditions (such as room temperature, lighting, and time), to perform real-time inference. The model output no longer relies on general rules, but generates personalized control strategies based on the user's historical preferences, such as: automatically turning on the lights and setting them to 60% brightness; automatically setting the air conditioner to 26°C and switching to sleep mode; and automatically putting the security system into "nighttime arming" mode. Thus, this process does not rely on the cloud and is completed entirely on the device, ensuring response speed and privacy.

[0152] 3. The lightweight inference engine supports real-time updates:

[0153] The system deploys a lightweight inference engine, supporting real-time model updates and policy generation on the device.

[0154] The model parameters are fine-tuned based on the new input vector (e.g., through gradient descent or incremental learning) without retraining; the adjusted control strategy takes effect immediately.

[0155] 4. Closed-loop feedback and strategy optimization:

[0156] The newly generated control strategy is recorded as a new historical operation, and a behavior vector is generated again and stored in the database. This vector participates in subsequent pattern recognition, forming a complete closed loop of "behavior acquisition - vectorization - matching - strategy generation - new behavior record - re-optimization". As the frequency of user use increases, the system's recognition accuracy of user behavior patterns and the rationality of control strategies continue to improve.

[0157] This approach significantly enhances the personalization capabilities and responsiveness of smart home systems, providing users with more intelligent and user-friendly services. This vectorization method is not only applicable to lighting systems but can also be extended to other smart home devices, such as temperature control and security systems, by extracting and encoding relevant features to build a personalized control model for each device.

[0158] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0159] Reference Figure 3The diagram illustrates a structural block diagram of a control device for a smart home device provided in an embodiment of the present invention, which may specifically include the following modules:

[0160] The data acquisition module 301 is used to collect real-time operation records of smart home devices.

[0161] Vector processing module 302 is used to perform vectorization processing on the real-time operation record to obtain the corresponding current behavior vector;

[0162] The vector comparison module 303 is used to compare the current behavior vector with the historical behavior vectors in the local vector database corresponding to the smart home device, and use the target historical behavior vector that meets the conditions as context information.

[0163] The strategy prediction module 304 is used to obtain environmental parameters of the environment in which the smart home device is located, and to perform strategy prediction based on the context information and the environmental parameters to obtain a control strategy for the smart home device.

[0164] In some feasible implementations, the vector processing module 302 is specifically used for:

[0165] Feature extraction is performed on the real-time operation records to obtain the corresponding real-time operation features;

[0166] The real-time operation features are converted into a first data code, and the first data code is reduced in dimensionality to obtain the current behavior vector corresponding to the real-time operation record.

[0167] In some feasible implementations, the vector processing module 302 is specifically used for:

[0168] Obtain the data type corresponding to the real-time operation feature;

[0169] Obtain the conversion information corresponding to the data type, and convert the real-time operation feature into the corresponding first data code according to the conversion information.

[0170] In some feasible implementations, the real-time operation characteristics include at least one of the following: time characteristics, frequency, duration, operation type, operation object, operation parameters, and user identity.

[0171] In some feasible implementations, the first data encoding includes at least several features of different dimensions, and the vector processing module 302 is specifically used for:

[0172] Calculate the mean and standard deviation corresponding to each feature, and use the mean and standard deviation to transform the features in the first data encoding to obtain the standardized vector corresponding to the first data encoding;

[0173] Calculate the covariance matrix corresponding to the standardized vector;

[0174] The covariance matrix is ​​decomposed to obtain several eigenvalues ​​and eigenvectors corresponding to each eigenvalue, and the variance contribution rate corresponding to each eigenvalue is calculated based on the eigenvalues.

[0175] Determine the retention value corresponding to the variance contribution rate;

[0176] The feature vectors are sorted according to the magnitude of the feature values, and the corresponding target feature vectors are extracted from the feature vectors according to the retention values.

[0177] Each of the aforementioned features is mapped onto the target feature vector to obtain the current behavior vector corresponding to the real-time operation record.

[0178] In some feasible implementations, the vector comparison module 303 is specifically used for:

[0179] Calculate the similarity between the current behavior vector and the historical behavior vector;

[0180] Use the target's historical behavior vector with a similarity greater than or equal to a preset threshold as context information.

[0181] Among some feasible implementation methods are:

[0182] The history record module is used to obtain the historical operation records corresponding to the smart home devices;

[0183] The feature extraction module is used to extract features from the historical operation records to obtain the corresponding historical operation features;

[0184] The conversion module is used to convert the historical operation features into a second data code, and to reduce the dimensionality of the second data code to obtain the historical behavior vector corresponding to the historical operation record.

[0185] The database construction module is used to construct a local vector database corresponding to the smart home device by using at least one of the historical operation features, the second data encoding, and the historical behavior vector.

[0186] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0187] In addition, this invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described control method embodiments for smart home devices and achieves the same technical effects. To avoid repetition, it will not be described again here.

[0188] This invention also provides a readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the control method embodiments of the smart home device described above, achieving the same technical effects. To avoid repetition, it will not be described again here. The readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0189] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0190] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, EEPROM, Flash, and eMMC, etc.) containing computer-usable program code.

[0191] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0192] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0194] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0195] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0196] The control method and control device for a smart home device provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of ​​the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A control method for a smart home device, characterized in that, include: Collect real-time operation records for smart home devices; The real-time operation record is vectorized to obtain the corresponding current behavior vector; The current behavior vector is compared with the historical behavior vectors in the local vector database corresponding to the smart home device, and the target historical behavior vector that meets the conditions is used as context information. The system obtains environmental parameters of the environment in which the smart home device is located, and performs policy prediction based on the context information and the environmental parameters to obtain a control policy for the smart home device.

2. The method according to claim 1, characterized in that, The step of vectorizing the real-time operation record to obtain the corresponding current behavior vector includes: Feature extraction is performed on the real-time operation records to obtain the corresponding real-time operation features; The real-time operation features are converted into a first data code, and the first data code is reduced in dimensionality to obtain the current behavior vector corresponding to the real-time operation record.

3. The method according to claim 2, characterized in that, The step of converting the real-time operation features into a first data code includes: Obtain the data type corresponding to the real-time operation feature; Obtain the conversion information corresponding to the data type, and convert the real-time operation feature into the corresponding first data code according to the conversion information.

4. The method according to claim 2 or 3, characterized in that, The real-time operation characteristics include at least one of the following: time characteristics, frequency, duration, operation type, operation object, operation parameters, and user identity.

5. The method according to claim 2 or 3, characterized in that, The first data encoding includes at least several features of different dimensions. The step of reducing the dimensionality of the first data encoding to obtain the current behavior vector corresponding to the real-time operation record includes: Calculate the mean and standard deviation corresponding to each feature, and use the mean and standard deviation to transform the features in the first data encoding to obtain the standardized vector corresponding to the first data encoding; Calculate the covariance matrix corresponding to the standardized vector; The covariance matrix is ​​decomposed to obtain several eigenvalues ​​and eigenvectors corresponding to each eigenvalue, and the variance contribution rate corresponding to each eigenvalue is calculated based on the eigenvalues. Determine the retention value corresponding to the variance contribution rate; The feature vectors are sorted according to the magnitude of the feature values, and the corresponding target feature vectors are extracted from the feature vectors according to the retention values. Each of the aforementioned features is mapped onto the target feature vector to obtain the current behavior vector corresponding to the real-time operation record.

6. The method according to claim 1, characterized in that, The step of using the target historical behavior vector that meets the conditions as context information includes: Calculate the similarity between the current behavior vector and the historical behavior vector; Use the target's historical behavior vector with a similarity greater than or equal to a preset threshold as context information.

7. The method according to claim 1, characterized in that, Also includes: Obtain the historical operation records corresponding to the smart home devices; Feature extraction is performed on the historical operation records to obtain the corresponding historical operation features; The historical operation features are converted into a second data code, and the second data code is dimensionality reduced to obtain the historical behavior vector corresponding to the historical operation record. A local vector database corresponding to the smart home device is constructed by using at least one of the historical operation features, the second data encoding, and the historical behavior vector.

8. A control device for a smart home device, characterized in that, include: The data collection module is used to collect real-time operation records of smart home devices; The vector processing module is used to perform vectorization processing on the real-time operation record to obtain the corresponding current behavior vector; The vector comparison module is used to compare the current behavior vector with the historical behavior vectors in the local vector database corresponding to the smart home device, and use the target historical behavior vector that meets the conditions as context information. The strategy prediction module is used to obtain environmental parameters of the environment in which the smart home device is located, and to perform strategy prediction based on the context information and the environmental parameters to obtain a control strategy for the smart home device.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-7.

10. A readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Smart home control method and device, embedded industrial control equipment and medium

    CN116165911A

  • Terminal equipment-oriented intelligent scene generation method and smart home system

    CN118444620A

  • Smart home generation strategy optimization system based on adaptive learning

    CN120215271A

  • Method and apparatus for controlling smart home appliance, control device and storage medium

    WO2021000791A1