A method and system for controlling sensor data

By acquiring real-time environmental data and user identifiers, and combining anomaly detection and weighted fusion algorithms, the user activity context is inferred, solving the problem of mismatched lighting settings in traditional intelligent lighting control methods. This enables personalized and intelligent lighting control and improves the user experience.

CN120583570BActive Publication Date: 2026-01-13SHENZHEN SMART LINKS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510731034.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2026-01-13
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

Traditional smart lighting control methods cannot provide matching lighting settings based on users' specific activities and personalized needs, resulting in frequent manual adjustments by users and affecting the smart home experience.

Method used

By acquiring real-time environmental data, identifying user identifiers, searching for similar historical records in the behavior pattern library, inferring the user's activity context, and selecting appropriate lighting control strategies from the preset strategy library, personalized lighting control is achieved by combining anomaly data detection and weighted fusion algorithms to optimize context inference.

Benefits of technology

It reduces the frequency of users manually adjusting lighting settings, improves user satisfaction with smart home systems, and provides an automated lighting experience that better meets user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120583570B_ABST
    Figure CN120583570B_ABST
Patent Text Reader

Abstract

The application provides a kind of sensing data control method and system, it is related to lighting control technical field.The method includes the following steps: obtaining the real-time environment data set of current residential environment;Identify the user identification of current active user;According to user identification, find the highest similarity historical behavior mode record of real-time environment data set in behavior mode library;According to historical behavior mode record, infer the activity context of current active user;According to the inferred activity context, select corresponding lighting control strategy, and send control instruction to lighting controller.The method of the application overcomes the shortcomings of traditional lighting control method, which is not humanized and intelligent, by accurately inferring the current activity context of the user and dynamically adjusting the lighting settings based on it, thereby achieving highly personalized automatic lighting control, significantly reducing manual intervention, and improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of lighting control technology, and more specifically, to a sensor data control method and system. Background Technology

[0002] In a modern residential environment, the deployment of smart home platforms is becoming increasingly common. These platforms typically connect and control multiple devices, including several lighting controllers, to adjust lighting settings in different areas of the home, such as brightness, color temperature, and on / off status. Simultaneously, the platform integrates or receives data streams from various types of sensors. Homes often house multiple family members, each with different schedules and personalized lighting habits. For example, at any given time, one member might be preparing meals in the kitchen in the morning, requiring bright, cool-toned functional lighting for clear operation and safety; while another member might be reading in the living room, preferring softer, warmer-toned background or task lighting to create a comfortable reading atmosphere. As evening approaches, family members might gather in the dining room for dinner, requiring warm, conversation-friendly ambient lighting; after dinner, the same dining space might be used for children doing homework, at which point the lighting needs shift to ample, glare-free lighting suitable for prolonged focused study.

[0003] Smart home platforms continuously receive real-time sensor data streams from various locations, which form the basis for understanding the environment and user status. Common sensor types include: presence or motion sensors installed at room entrances, hallways, or main activity areas to detect human activity in specific areas; ambient light sensors deployed near windows or in the center of the room to sense the intensity of natural indoor light or the overall ambient brightness level; in addition, the platform may also receive operational status information from other smart devices, such as smart TVs (e.g., whether they are turned on and what content they are playing), smart speakers (e.g., whether they are playing music and what content they are playing), and even, provided that user authorization and privacy regulations are followed, the network connection status or application usage status of specific user devices (e.g., whether they are using reading apps, games, etc.).

[0004] However, traditional smart lighting control methods primarily rely on preset static condition triggering rules. For example, a typical rule might be: "When the presence sensor in the living room detects someone's presence, and the ambient light sensor reading is below a set threshold, turn on the main living room lighting and set it to the default brightness." This triggering method, based on simple conditions (such as "someone is here" and "dim light"), falls short when faced with the complex and ever-changing user needs in the aforementioned scenarios. When the platform detects that "someone is here" and "dim light" in the living room, it cannot distinguish whether the user needs bright reading light or dim ambient lighting for watching a movie, as this depends on the user's specific activity. If the platform mechanically executes the fixed "turn on lights when it's dark" rule, it might suddenly turn on the bright main light while the user is enjoying a movie, severely impacting the viewing experience; or when the user needs sufficient light for reading or working, the provided lighting brightness might be insufficient, forcing the user to interrupt their activity and manually adjust the lighting settings to meet their needs. This frequent manual intervention not only reduces the intelligent experience of the smart home system but may also cause negative emotions for the user. Summary of the Invention

[0005] The purpose of this invention is to provide a sensor data control method and system that overcomes the shortcomings of traditional lighting control methods in terms of being less user-friendly and intelligent. By accurately inferring the user's current activity context and dynamically adjusting the lighting settings accordingly, it achieves highly customized automated lighting control that meets user needs, significantly reduces manual intervention by the user, and improves the user experience.

[0006] In a first aspect, the present invention provides a sensor data control method applied to a residential intelligent lighting control system, comprising the following steps:

[0007] Acquire a real-time environmental data set of the current residential environment; the real-time environmental data set includes human presence sensor readings, ambient light sensor readings, smart device operating status information, and time information;

[0008] Identify the user ID of the currently active user;

[0009] Based on the user identifier, search the behavior pattern library for the historical behavior pattern record with the highest similarity to the real-time environment data set; the behavior pattern record includes the historical environment data set, the user identifier, and the lighting settings manually adjusted by the user.

[0010] Based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user, the activity context of the current active user can be inferred.

[0011] Based on the inferred activity context, select the corresponding lighting control strategy from the preset lighting strategy library;

[0012] Based on the selected lighting control strategy, control commands are sent to the lighting controller to adjust the lighting settings of the current residential environment.

[0013] This invention provides a sensor data control method. The core of this method lies in constructing a personalized behavior pattern library by recording user manual lighting adjustment behaviors under specific environmental data combinations. In real-time, by matching the current environmental data with the behavior pattern library based on similarity, the method infers the user's current activity context or lighting intention. Then, it selects and executes the lighting control strategy that best meets the user's expectations from a preset or learned, optimized strategy library. This method can comprehensively utilize multiple types of information to deeply understand user needs, thereby achieving smarter and more personalized automated lighting and significantly reducing the frequency of manual adjustments by users.

[0014] Furthermore, the step of searching the behavior pattern record in the behavior pattern library with the highest similarity to the real-time environment data set based on the user identifier includes:

[0015] An anomaly detection model is established, which is based on statistical analysis or machine learning algorithms and is used to evaluate the rationality of users manually adjusting lighting settings in historical behavior pattern records by considering the correlation between historical environmental data sets and lighting settings.

[0016] When multiple historical behavior pattern records with the same similarity are found, the anomaly detection model is used to evaluate each historical behavior pattern record to obtain an anomaly score corresponding to each historical behavior pattern record; the anomaly score reflects the degree of deviation between the lighting settings manually adjusted by the user and the corresponding historical environmental data set.

[0017] Based on the abnormal scores, all historical behavior pattern records are filtered out, and those records with abnormal scores exceeding a preset threshold are removed from the behavior pattern library; the preset threshold is dynamically adjusted according to the distribution of abnormal scores in the historical behavior pattern records.

[0018] Furthermore, the steps for inferring the activity context of the current active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user include:

[0019] A context feature vector is constructed, which integrates historical environmental data sets with lighting settings manually adjusted by the user, and a weighted fusion algorithm is used to assign weights based on the contribution of different data sources to context inference.

[0020] Using time series analysis, the changing trend of the context feature vector over time is analyzed to predict the user's activity context in the future, and the prediction results are used as initial context hypotheses, which include the predicted activity context and the corresponding probability values.

[0021] An activity context inference model based on Bayesian networks is established. The Bayesian network uses the probability values ​​in the initial context assumptions as prior probabilities and combines them with the current real-time environment data set to calculate the posterior probabilities of the user being in various activity contexts.

[0022] The activity scenario with the highest posterior probability is selected as the final inference result, and a confidence score associated with the activity scenario is output. When the confidence score is lower than a preset threshold, the user is prompted to manually select an activity scenario.

[0023] Furthermore, a context feature vector is constructed, which integrates historical environmental data sets with manually adjusted lighting settings by the user. A weighted fusion algorithm is used to assign weights based on the contribution of different data sources to context inference. The steps include:

[0024] The historical environmental data set is preprocessed, including: normalizing the readings of the human presence sensor and mapping the readings to the [0,1] interval; performing logarithmic transformation on the ambient light sensor readings; encoding the operating status information of the smart devices; and periodically encoding the time information.

[0025] The lighting settings manually adjusted by the user are quantified, including: mapping the light brightness adjustment value to the [0,1] range; mapping the color temperature adjustment value to the preset color temperature range; and encoding the light switch status as 0 or 1.

[0026] Based on the preprocessed historical environmental data set and the quantified lighting settings, an initial situation feature vector is constructed. The initial situation feature vector includes normalized human presence sensor readings, logarithmically transformed ambient light sensor readings, encoded smart device operating status information, periodically encoded time information, light brightness adjustment values, color temperature adjustment values, and light on / off status.

[0027] A weighted fusion algorithm is used to weight each element in the initial context feature vector to obtain a weighted context feature vector. The weighted fusion algorithm includes: establishing a weight allocation matrix, where each row of the weight allocation matrix corresponds to a data source and each column corresponds to a context, and the matrix elements represent the weight of the data source in the context; multiplying the initial context feature vector with the weight allocation matrix to obtain the weighted context feature vector.

[0028] For different residential areas, a feature selection model corresponding to the area is established. The feature selection model is based on information gain or mutual information algorithm to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction to obtain the final context feature vector used for context inference.

[0029] Furthermore, for different residential areas, a feature selection model corresponding to each area is established. This model, based on information gain or mutual information algorithms, is used to evaluate the contribution of each feature in the initial context feature vector to context inference and select the subset of features with the highest contribution. The steps for reducing the dimensionality of the weighted context feature vector based on the selected feature subset to obtain the final context feature vector used for context inference include:

[0030] Based on users' historical behavior data, a regional association matrix is ​​constructed. Each element of the regional association matrix represents the probability that a user moves from one residential area to another. The transfer probability is calculated by statistically analyzing the frequency of user switching between different areas, and the results are stored in the database.

[0031] When performing feature selection for a specific residential area, the regional association matrix is ​​read from the database and incorporated into the objective function of the feature selection model. Specifically, the regional association matrix and the information gain or mutual information value of the features are weighted and summed to obtain the corrected feature importance score.

[0032] Based on the corrected feature importance scores, the features in the initial context feature vector are sorted, and the feature subset with the highest score is selected. At the same time, based on the regional association matrix, the selected feature subset is adjusted, giving priority to retaining features with strong association with other regions. The adjustment method is to calculate the mutual information of each feature with other regional associated features and use it as an adjustment factor, multiplying it with the feature importance score.

[0033] Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction processing to obtain the final context feature vector used for context inference.

[0034] Furthermore, using time series analysis methods, the changing trend of the context feature vector over time is analyzed to predict the user's activity context in the future, and the prediction results are used as initial context hypotheses. The initial context hypotheses include the predicted activity context and the corresponding probability values. The steps include:

[0035] Extract a set of historical context feature vectors from the database, classify the historical context feature vectors according to date information, and distinguish between holiday context feature vectors and regular context feature vectors;

[0036] Time series analysis models are established for holiday context feature vectors and regular context feature vectors, respectively. The time series analysis models include autoregressive moving average models or long short-term memory network models. The model parameters are trained and optimized based on the corresponding historical context feature vector sets.

[0037] When predicting activity scenarios, determine whether the current date is a holiday. If it is a holiday, select the holiday time series analysis model; otherwise, select the normal time series analysis model.

[0038] Input the current context feature vector into the selected time series analysis model to predict the user's activity context in the future. Based on the model output, calculate the probability value of each predicted activity context and generate the initial context hypothesis.

[0039] Secondly, the present invention provides a sensor data control system applied to a residential intelligent lighting control system, comprising:

[0040] The acquisition module is used to acquire a set of real-time environmental data of the current residential environment; the set of real-time environmental data includes human presence sensor readings, ambient light sensor readings, smart device operating status information, and time information;

[0041] The identification module is used to identify the user identifier of the currently active user;

[0042] The search module is used to search for the historical behavior pattern record with the highest similarity to the real-time environment data set in the behavior pattern library based on the user identifier; the behavior pattern record includes the historical environment data set, the user identifier, and the lighting settings manually adjusted by the user.

[0043] The inference module is used to infer the activity context of the current active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user.

[0044] The selection module is used to select the corresponding lighting control strategy from the preset lighting strategy library based on the inferred activity context;

[0045] The control module is used to send control commands to the lighting controller based on the selected lighting control strategy, so that the lighting controller adjusts the lighting settings of the current residential environment.

[0046] Furthermore, the search module performs the following when searching for the historical behavior pattern record in the behavior pattern library that has the highest similarity to the real-time environment data set based on the user identifier:

[0047] An anomaly detection model is established, which is based on statistical analysis or machine learning algorithms and is used to evaluate the rationality of users manually adjusting lighting settings in historical behavior pattern records by considering the correlation between historical environmental data sets and lighting settings.

[0048] When multiple historical behavior pattern records with the same similarity are found, the anomaly detection model is used to evaluate each historical behavior pattern record to obtain an anomaly score corresponding to each historical behavior pattern record; the anomaly score reflects the degree of deviation between the lighting settings manually adjusted by the user and the corresponding historical environmental data set.

[0049] Based on the abnormal scores, all historical behavior pattern records are filtered out, and those records with abnormal scores exceeding a preset threshold are removed from the behavior pattern library; the preset threshold is dynamically adjusted according to the distribution of abnormal scores in the historical behavior pattern records.

[0050] Furthermore, the inference module performs the following when inferring the activity context of the currently active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user:

[0051] A context feature vector is constructed, which integrates historical environmental data sets with lighting settings manually adjusted by the user, and a weighted fusion algorithm is used to assign weights based on the contribution of different data sources to context inference.

[0052] Using time series analysis, the changing trend of the context feature vector over time is analyzed to predict the user's activity context in the future, and the prediction results are used as initial context hypotheses, which include the predicted activity context and the corresponding probability values.

[0053] An activity context inference model based on Bayesian networks is established. The Bayesian network uses the probability values ​​in the initial context assumptions as prior probabilities and combines them with the current real-time environment data set to calculate the posterior probabilities of the user being in various activity contexts.

[0054] The activity scenario with the highest posterior probability is selected as the final inference result, and a confidence score associated with the activity scenario is output. When the confidence score is lower than a preset threshold, the user is prompted to manually select an activity scenario.

[0055] Furthermore, the inference module, in constructing a context feature vector, which integrates historical environmental data sets with manually adjusted lighting settings by the user, and employs a weighted fusion algorithm to assign weights based on the contribution of different data sources to context inference, includes the following steps:

[0056] The historical environmental data set is preprocessed, including: normalizing the readings of the human presence sensor and mapping the readings to the [0,1] interval; performing logarithmic transformation on the ambient light sensor readings; encoding the operating status information of the smart devices; and periodically encoding the time information.

[0057] The lighting settings manually adjusted by the user are quantified, including: mapping the light brightness adjustment value to the [0,1] range; mapping the color temperature adjustment value to the preset color temperature range; and encoding the light switch status as 0 or 1.

[0058] Based on the preprocessed historical environmental data set and the quantified lighting settings, an initial situation feature vector is constructed. The initial situation feature vector includes normalized human presence sensor readings, logarithmically transformed ambient light sensor readings, encoded smart device operating status information, periodically encoded time information, light brightness adjustment values, color temperature adjustment values, and light on / off status.

[0059] A weighted fusion algorithm is used to weight each element in the initial context feature vector to obtain a weighted context feature vector. The weighted fusion algorithm includes: establishing a weight allocation matrix, where each row of the weight allocation matrix corresponds to a data source and each column corresponds to a context, and the matrix elements represent the weight of the data source in the context; multiplying the initial context feature vector with the weight allocation matrix to obtain the weighted context feature vector.

[0060] For different residential areas, a feature selection model corresponding to the area is established. The feature selection model is based on information gain or mutual information algorithm to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction to obtain the final context feature vector used for context inference.

[0061] As can be seen from the above, the sensor data control method provided by this invention, by comprehensively analyzing multi-source data and the user's historical manual adjustment behavior, can accurately infer the user's current activity context, thereby providing highly personalized and contextualized lighting control, avoiding the problem of control results not matching user expectations under traditional static rules. This directly leads to a significant reduction in the frequency of users manually adjusting lighting settings, improving user satisfaction with the smart home system.

[0062] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description

[0063] Figure 1 This is a flowchart of a sensor data control method provided in an embodiment of the present invention.

[0064] Figure 2 This is a schematic diagram of a sensor data control system provided in an embodiment of the present invention.

[0065] Label Explanation:

[0066] 100. Acquisition Module; 200. Recognition Module; 300. Search Module; 400. Inference Module; 500. Selection Module; 600. Control Module. Detailed Implementation

[0067] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0068] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0069] Reference Appendix Figure 1 This invention provides a sensor data control method for use in a residential intelligent lighting control system, comprising the following steps:

[0070] Acquire a real-time environmental data set of the current residential environment; the real-time environmental data set includes human presence sensor readings, ambient light sensor readings, smart device operating status information, and time information;

[0071] Identify the user ID of the currently active user;

[0072] Based on the user identifier, search the behavior pattern library for the historical behavior pattern record with the highest similarity to the real-time environmental data set; the behavior pattern record includes the historical environmental data set, the user identifier, and the lighting settings manually adjusted by the user.

[0073] Based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user, the activity context of the current active user can be inferred.

[0074] Based on the inferred activity context, select the corresponding lighting control strategy from the preset lighting strategy library;

[0075] Based on the selected lighting control strategy, control commands are sent to the lighting controller to adjust the lighting settings of the current residential environment.

[0076] To truly provide a lighting experience that meets users' actual needs and eliminates the need for frequent manual adjustments, this embodiment requires a smart home platform with more advanced judgment and understanding capabilities, namely, the ability to infer the user's current context. This necessitates that the platform not only process data from a single sensor in isolation but also comprehensively analyze data from multiple related information sources. For example, the platform can combine the current time period (morning, noon, or evening), the user's historical behavior patterns (what a user typically does at a specific time and in a specific area), and the operational status of other smart devices (whether the TV is on, whether the speaker is playing music, and whether the user's device is online and active). Through deep correlation analysis of this information from different sources and of different types, the platform can attempt to infer the specific type of activity the user is currently engaged in, such as determining whether the user is "reading," "watching a movie," "eating," "working," or "resting."

[0077] Based on accurate inferences about user activity contexts, the platform needs to dynamically select or adjust corresponding lighting control strategies. For example, if the platform infers that a user is "reading," even if the ambient light sensor data shows that the brightness already meets a preset general threshold, the platform should still increase the lighting brightness in the reading area to a suitable level for reading and may adjust the color temperature to a cooler tone to improve focus. Conversely, if the platform infers that the user is "watching a movie," it should dim or turn off the main lighting, while turning on ambient lighting or background lights and adjusting the color temperature to a warm tone to create an immersive viewing atmosphere. This method of dynamically adapting lighting strategies based on inferred user contexts is clearly more flexible, intelligent, and user-friendly than simple static rule triggering.

[0078] Furthermore, considering that residential environments typically involve multiple family members living together, the platform also needs the ability to differentiate between different users. This can be achieved in various ways, such as by analyzing the identifiers of specific user devices connected to the platform (with explicit user authorization and strict adherence to privacy guidelines), or through user identification sensors in specific areas. After identifying users, the platform can record and learn each user's lighting preferences in specific contexts, such as recording users' manual lighting adjustments under specific environmental data combinations, and storing these behaviors as personalized user behavior patterns. This shift from simple sensor data collection and static rule triggering to a control model based on multi-source data correlation analysis, contextual inference, personalized behavior pattern learning, and policy execution places higher demands on the computing, data processing, decision-making, and control algorithm capabilities of smart home platforms. By achieving efficient and accurate correlation analysis, pattern recognition, and intelligent decision-making processes, the platform can achieve more user-predictable automated lighting control, significantly reducing situations where control fails to meet user expectations and the frequency of manual adjustments by users, thereby improving the overall smart home experience.

[0079] In this embodiment, a real-time environmental data set of the current residential environment is acquired by collecting data through various sensors and devices connected to the smart home platform. A human presence sensor detects human activity within the detection area. An ambient light sensor measures the brightness level of the environment. Smart device operating status information reflects the working status of devices such as televisions and speakers. Time information provides the current time. Thus, the system obtains a snapshot of the current environment, device status, and time.

[0080] Identifying the user's identity for the currently active user can be achieved in various ways, such as through user login to smart home applications, wearable device identification, or user identification algorithms based on sensor data. This step associates the current context with a specific user, allowing subsequent processing to consider the user's personalized preferences.

[0081] Based on the user's identifier, the system searches the behavior pattern library for historical behavior pattern records that have the highest similarity to the real-time environmental data set. The behavior pattern library stores historical records of the user under different environments, device states, and times, as well as manual lighting adjustments made by the user at those times. The search process involves calculating the similarity between the current real-time environmental data set and the historical environmental data set in the library, and identifying the one or more records with the highest similarity. By utilizing the user's past behavior data, the system can learn the user's lighting habits.

[0082] Based on historical environmental data from recorded behavioral patterns and the user's manually adjusted lighting settings, the system infers the current user's activity context. This step is the core of the intelligent inference process. The system analyzes how the user adjusts the lighting in similar historical contexts. For example, at a specific time and under specific lighting conditions, if the user always brightens the lights and sets them to a cool tone, the system may infer that the user is currently engaged in work or study. This inference goes beyond simple environmental perception and attempts to understand the intent behind the user's behavior.

[0083] Based on the inferred activity context, the system selects a corresponding lighting control strategy from a pre-defined lighting strategy library. This library contains pre-configured sets of lighting parameters for different activity contexts (such as reading, watching movies, dining, and resting), including brightness, color temperature, and light on / off status. Based on the inferred user activity, the system searches for and selects the most suitable lighting strategy.

[0084] Based on the selected lighting control strategy, the system sends control commands to the lighting controller, causing the controller to adjust the lighting settings of the current residential environment. The system converts the lighting parameters in the selected strategy into control commands and sends them to the corresponding lighting devices, thereby automatically adjusting the lighting to meet the needs of the user's current activity context. This achieves personalized lighting control based on the user's activity context.

[0085] Specifically, this method addresses the technical problem of traditional intelligent lighting control relying on static rules, which cannot provide matching lighting settings based on specific user activities and personalized needs. The system first acquires current environmental, device, and time information and identifies the current user. Next, the system searches a database of user behavior patterns and manual adjustment records for historical records most similar to the current situation. These historical records contain actual lighting adjustments made by the user under similar conditions, reflecting the user's true needs. By analyzing environmental data and manually adjusted lighting settings in these historical records, the system infers the user's likely current activity. For example, if historical data shows that the user always dims the lights and sets them to a warm tone in the evening, in the living room, with the TV on and the ambient light low, the system may infer that the user is watching a movie. Once the activity situation is inferred, the system selects a lighting control strategy corresponding to that activity situation from a pre-set lighting strategy library. This strategy defines the optimal lighting parameters for that activity situation. Finally, the system sends a command to the lighting controller based on the selected strategy to automatically adjust the lighting settings. As a result, the system can provide appropriate lighting based on the user's current activities and personalized habits, avoiding the lighting mismatch problem caused by the inability to distinguish user activities in traditional methods, reducing the frequency of users manually adjusting the lights, and improving the user experience of the smart lighting system.

[0086] In some specific implementations, assume that a human presence sensor and an ambient light sensor are deployed in the living room area of ​​a residence. A smart home platform connects to a smart TV and a smart speaker, recording the user's behavior patterns in the living room. When user A enters the living room (the human presence sensor detects someone), at 8 PM (time information), the ambient light sensor reading is low, and the smart TV is on (smart device operating status information), the system identifies the current user as user A. The system searches its behavior pattern library for historical records with the highest similarity to the current real-time environmental data set (someone, 8 PM, low light, TV on). Assume a record is found showing that user A, at a similar time and in a similar environment, manually adjusted the living room main light brightness to 20%, the color temperature to 2700K, and turned off some downlights. This historical record and the associated manual adjustment behavior indicate that user A may have been watching a movie at that time. Based on this historical record, the system infers that user A's current activity scenario is "watching a movie." The system searches its lighting strategy library for the lighting strategy corresponding to the "watching a movie" scenario, which specifies a main light brightness of 20%, a color temperature of 2700K, and downlights turned off. Based on this strategy, the system sends a command to the living room lighting controller to adjust the main light brightness to 20%, the color temperature to 2700K, and turn off the downlights. Thus, the system automatically provides suitable lighting based on user A's movie-watching scenario, without requiring manual operation from the user.

[0087] In some embodiments, the step of searching for the historical behavior pattern record with the highest similarity to the real-time environment data set in the behavior pattern library based on the user identifier includes:

[0088] An anomaly detection model is established, which is based on statistical analysis or machine learning algorithms and is used to evaluate the rationality of users manually adjusting lighting settings in historical behavior pattern records by considering the correlation between historical environmental data sets and lighting settings.

[0089] When multiple historical behavior pattern records with the same similarity are found, the anomaly detection model is used to evaluate each historical behavior pattern record and obtain the anomaly score corresponding to each historical behavior pattern record. The anomaly score reflects the degree of deviation between the lighting settings manually adjusted by the user and the corresponding historical environmental data set.

[0090] Based on the abnormal scores, all historical behavior pattern records are filtered out, and those with abnormal scores exceeding a preset threshold are removed from the behavior pattern database. The preset threshold is dynamically adjusted according to the distribution of abnormal scores in historical behavior pattern records.

[0091] An anomaly detection model can be constructed as a predictive model that takes a historical environmental dataset as input and outputs a predicted reasonable lighting setting. The difference between the user's manually adjusted lighting setting and the model's prediction can be used as an anomaly score. For example, the model can be a regression model that learns the relationship between historical environmental data (such as light intensity and time) and the brightness settings that users typically use in those environments. The anomaly score can be calculated as the absolute difference or squared difference between the actual manually set brightness and the model's predicted brightness. Furthermore, the anomaly detection model can also be implemented based on a clustering algorithm, clustering historical behavior pattern records. Records far from the cluster center are considered anomalies, and their distance from the nearest cluster center can be used as an anomaly score. When multiple historical behavior pattern records with the same highest similarity are found, these records are input into the anomaly detection model one by one for evaluation, and the model calculates an anomaly score for each record. This quantifies the degree of deviation between the manually adjusted lighting setting and the corresponding environmental data in each record. Based on these anomaly scores, the system performs a filtering operation, retaining only records with anomaly scores below a preset threshold. The preset threshold can be dynamically adjusted based on the abnormal score distribution of all or recent historical behavioral pattern records in the behavioral pattern library. For example, it can be set to a certain percentile of the abnormal score distribution (such as 95%) or determined based on statistical methods (such as box plots). Filtered-out abnormal records can be removed from the behavioral pattern library to continuously optimize the data quality of the library.

[0092] Specifically, when searching for historical behavior pattern records with the highest similarity to the real-time environmental data set based on user identifiers, the system first performs a similarity matching process. When multiple historical behavior pattern records are found to have the same highest similarity to the current real-time environmental data set, an anomaly detection mechanism is introduced to avoid using data containing unreasonable manual adjustments. An established anomaly detection model is used to evaluate these records with the highest similarity. The model analyzes the relationship between the historical environmental data set in each record and the user's manually adjusted lighting settings to determine whether such adjustments conform to general patterns or user history. For example, if the model detects that a user manually adjusts the light brightness to maximum in a well-lit daytime environment, this may be considered an anomaly. The model calculates an anomaly score for each record, reflecting the degree of deviation between the manually adjusted settings and the environmental data; a higher score indicates a greater deviation. Subsequently, the system filters the found records based on these anomaly scores. A preset threshold is set; only records with anomaly scores below this threshold are retained for subsequent contextual inference. Records with anomaly scores exceeding the threshold are considered anomalous data, excluded from the current processing flow, and can be deleted from the behavior pattern library to clean up the data. The preset threshold is not a fixed value, but is dynamically adjusted based on the distribution of abnormal ratings in historical records in the behavior pattern library. This allows the system to adapt to changes in user behavior patterns and more accurately identify anomalies. Therefore, through anomaly data detection, scoring, filtering, and dynamic threshold adjustment, the historical behavior pattern records used for contextual inference are ensured to be filtered and more reliable data, improving the accuracy of subsequent contextual inference and reducing erroneous lighting control caused by the use of abnormal data.

[0093] In some specific implementations, the anomaly detection model can employ a linear regression model trained on historical data. This model is trained using a set of historical environmental data (e.g., ambient light intensity, time of day) as input features and the user-manually adjusted lighting settings (e.g., brightness value) as the output target. After training, when multiple historical behavior pattern records with the highest similarity are found, the historical environmental data set from each record is input into the regression model to obtain a predicted reasonable brightness value. The absolute difference between the brightness value actually manually adjusted by the user in that record and the model's predicted value is calculated as the anomaly score for that record. For example, if the model predicts a reasonable brightness of 0.6 (after normalization), while the user manually adjusts it to 0.1, the anomaly score is |0.1 - 0.6| = 0.5. Furthermore, the preset threshold can be set to the 98th percentile of all historical anomaly scores in the behavior pattern database. If an anomaly score (e.g., 0.5) of a record among the most similar records found exceeds the dynamically calculated threshold (e.g., 0.6), the record is deemed an anomaly, excluded from current processing, and can be removed from the behavior pattern library.

[0094] In some embodiments, the step of inferring the activity context of the currently active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user includes:

[0095] A context feature vector is constructed, which integrates historical environmental data sets with lighting settings manually adjusted by the user. A weighted fusion algorithm is used to assign weights based on the contribution of different data sources to context inference, with human presence sensor readings having a higher weight than time information.

[0096] Using time series analysis, we analyze the changing trend of context feature vectors over time, predict the user's activity context in the future, and use the prediction results as the initial context hypothesis, which includes the predicted activity context and the corresponding probability value.

[0097] A Bayesian network-based activity context inference model is established. The Bayesian network uses the probability values ​​in the initial context hypothesis as the prior probability and combines them with the current real-time environment data set to calculate the posterior probability of the user being in various activity contexts.

[0098] The activity scenario with the highest posterior probability is selected as the final inference result, and the confidence score associated with the activity scenario is output. When the confidence score is lower than a preset threshold, the user is prompted to manually select an activity scenario.

[0099] In this embodiment, a context feature vector is constructed, fusing historical environmental data and user-manually adjusted lighting settings. A weighted fusion algorithm is used, assigning weights based on the contribution of different data sources to context inference, with human presence sensor readings having a higher weight than time information. Furthermore, time series analysis is employed to analyze the changing trend of the context feature vector over time, predicting the user's activity context within a future period. This prediction is used as the initial context hypothesis, which includes the predicted activity context and its corresponding probability value. Based on this, a Bayesian network-based activity context inference model is established. The Bayesian network uses the probability values ​​from the initial context hypothesis as prior probabilities and combines them with the current real-time environmental data set to calculate the posterior probability of the user being in various activity contexts. Finally, the activity context with the highest posterior probability is selected as the final inference result, and a confidence score associated with that activity context is output. When the confidence score falls below a preset threshold, the user is prompted to manually select an activity context.

[0100] Specifically, this technical solution addresses the problem that relying solely on a single historical record for context inference can lead to the invalidation of that record due to sudden changes in user behavior, resulting in uncertainty or bias in the inference results and impacting the effectiveness of subsequent lighting control strategies. By constructing a context feature vector that integrates historical environmental data and user lighting settings, the system consolidates multi-dimensional information. Weighted fusion is employed, giving higher weight to data more critical to context inference, thus improving the effectiveness of the feature vector. Time series analysis allows the system to capture dynamic trends in user behavior and predict potential future activity scenarios, providing forward-looking information for subsequent inferences and overcoming the limitations of relying solely on current or single historical snapshots. A Bayesian network-based inference model uses the probability predicted by time series as a priori and combines it with current real-time environmental data as evidence. Through probabilistic reasoning, the posterior probability of various scenarios is calculated, effectively handling data uncertainty and integrating predicted and real-time information, thus improving the accuracy and robustness of context inference. A confidence score is output, and a user manual selection mechanism is introduced to ensure that users can intervene and correct inferences when the system is uncertain, improving system reliability and user experience. Therefore, the system can more accurately understand the user's current activity context and select a lighting control strategy that better matches the user's needs.

[0101] In some specific implementations, for example in the living room area, after the system acquires a real-time environmental data set (human presence sensor readings, ambient light sensor readings, smart TV operating status, and time information), it identifies the current user. The system searches for the historical behavior pattern record with the highest similarity to this real-time data set in the behavior pattern library. Suppose a record is found that contains the historical environmental data set and the user's manually adjusted lighting settings (e.g., brightness set to 20%, color temperature set to 2700K, light switch status is on). The system merges this historical environmental data set and lighting settings to construct a contextual feature vector. For example, the human presence sensor reading is normalized to 1.0, the ambient light sensor reading is logarithmically transformed to X, the smart TV status is encoded as 1 (indicating it's on), the time information is periodically encoded as Y, and the historical lighting settings are [0.2, 2700, 1]. These data constitute the contextual feature vector V. Using a pre-trained Long Short-Term Memory (LSTM) network model, the time series of historical context feature vectors are analyzed to predict the probability that the user will be in a "movie-watching" context (0.7), a "reading" context (0.2), and a "resting" context (0.1) in the future. These probabilities are used as the prior probabilities of the Bayesian network. Combining the current real-time environmental data set (e.g., the smart TV is indeed currently on), the Bayesian network calculates the posterior probabilities, resulting in a posterior probability of 0.95 for the user being in a "movie-watching" context, 0.03 for being in a "reading" context, and 0.02 for being in a "resting" context. The "movie-watching" context with the highest posterior probability is selected as the inference result, and a confidence score of 0.95 is calculated. If the preset threshold is 0.8, then 0.95 is higher than the threshold, the system confirms the inference result, and sends instructions to the lighting controller according to the lighting strategy associated with the "movie-watching" context (e.g., adjusting the light brightness to 15% and the color temperature to 2500K). If the confidence score is below 0.8, for example, 0.75, the system will send a prompt to the user interface, asking the user about the current activity context and allowing the user to make a manual selection.

[0102] In some embodiments, the process of constructing a context feature vector, which fuses historical environmental data sets with manually adjusted lighting settings by the user, and employing a weighted fusion algorithm to assign weights based on the contribution of different data sources to context inference, includes the following steps:

[0103] The historical environmental data set is preprocessed, including: normalizing the readings of the human presence sensor and mapping the readings to the [0,1] interval; performing logarithmic transformation on the ambient light sensor readings; encoding the operating status information of the smart devices; and periodically encoding the time information.

[0104] The lighting settings manually adjusted by the user are quantified, including: mapping the light brightness adjustment value to the [0,1] range; mapping the color temperature adjustment value to the preset color temperature range; and encoding the light switch status as 0 or 1.

[0105] Based on the preprocessed historical environmental data set and the quantified lighting settings, an initial situation feature vector is constructed. The initial situation feature vector includes normalized human presence sensor readings, logarithmically transformed ambient light sensor readings, encoded smart device operating status information, periodically encoded time information, light brightness adjustment values, color temperature adjustment values, and light on / off status.

[0106] A weighted fusion algorithm is used to weight each element in the initial context feature vector to obtain a weighted context feature vector. The weighted fusion algorithm includes: establishing a weight allocation matrix, where each row of the weight allocation matrix corresponds to a data source and each column corresponds to a context, and the matrix elements represent the weight of the data source in that context; multiplying the initial context feature vector with the weight allocation matrix to obtain the weighted context feature vector; the weight allocation matrix can be dynamically adjusted based on the current user's historical behavior data.

[0107] For different residential areas, a feature selection model corresponding to the area is established. The feature selection model is based on information gain or mutual information algorithm to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction to obtain the final context feature vector used for context inference.

[0108] The preprocessing of historical environmental datasets transforms sensor data of different types and dimensions into a unified numerical representation. Human presence sensor readings are normalized and mapped to the [0,1] interval, eliminating the dimensional influence of the original readings. Ambient light sensor readings undergo logarithmic transformation to handle potential nonlinear relationships or large-scale variations, making them more suitable for linear model processing. Smart device operating status and time information are encoded into numerical forms; for example, device status (on / off / standby) is encoded as discrete values, and time (hours / minutes / day of the week) is encoded using periodic functions (such as sine / cosine) to capture its periodic characteristics. User-adjusted lighting settings are quantized and converted into numerical values; light brightness adjustment values ​​are mapped to the [0,1] interval, color temperature adjustment values ​​are mapped to a preset color temperature range, and light on / off status is encoded as 0 or 1. These preprocessing and quantization steps convert heterogeneous data into a unified numerical format, facilitating subsequent vector construction and calculation. The initial context feature vector is a high-dimensional vector formed by simply combining these preprocessed and quantized values, containing various information reflecting historical environment and user preferences. The weighted fusion algorithm assigns weights to different elements (corresponding to different data sources) in the initial context feature vector by establishing a weight allocation matrix. Each row of the weight allocation matrix corresponds to a data source, and each column corresponds to a possible context. The matrix elements represent the importance of that data source in that specific context. Multiplying the initial context feature vector by the weight allocation matrix yields the weighted context feature vector. This process reflects the contribution of different data sources to context inference. For example, in the "reading" context, the weight of ambient light and brightness adjustment may be higher than that of the smart device status. The weight allocation matrix can be dynamically adjusted based on user historical behavior data. The system can learn the user's preferences for various data sources in different contexts and further optimize the weight allocation. A feature selection model is established for different residential areas. This model, based on information gain or mutual information algorithms, evaluates the contribution of each feature in the initial context feature vector (such as human presence readings, ambient light readings, smart TV status, etc.) to distinguishing different contexts. The higher the information gain or mutual information value, the more important the feature is for context inference. The model selects the subset of features with the highest contribution and removes redundant or irrelevant features. The weighted context feature vector is dimensionality-reduced based on a selected subset of features, retaining only the most important features to form the final context feature vector for context inference. This process reduces the dimensionality of the feature vector, improves computational efficiency, and enhances its ability to distinguish specific contexts in different regions, thus resolving the issue of inconsistent feature dimensions caused by differences in sensor deployment across different areas.

[0109] Specifically, to address the issue of inconsistent context feature vector dimensions caused by differences in sensor deployment density and type across different residential areas in multi-user residential environments, which affects the accuracy of subsequent context inference, this solution first preprocesses and quantifies the historical environmental data set and the lighting settings manually adjusted by the user. Human presence sensor readings are normalized to the [0,1] interval, ambient light sensor readings undergo logarithmic transformation, smart device operating status information and time information are encoded into numerical forms, and user-manually adjusted lighting settings (brightness, color temperature, on / off status) are also quantified or encoded. Thus, heterogeneous data from different sources and types are converted into a unified numerical representation. Next, these preprocessed and quantized values ​​are combined into an initial context feature vector. This vector contains various information reflecting historical environment and user preferences. Further, a weighted fusion algorithm is used to process the initial context feature vector. A weight allocation matrix is ​​established to assign weights to different elements in the vector (corresponding to different data sources). The elements of the weight allocation matrix represent the importance of a specific data source in a specific context; for example, in a "movie watching" context, the smart TV status and brightness adjustment may have higher weights. Multiplying the initial context feature vector by the weighting matrix yields a weighted context feature vector, allowing the differentiated contributions of different data sources to context inference to be reflected. The weighting matrix can be dynamically adjusted based on the user's historical behavior data, and the system can learn to assign higher weights to data sources that are more important for specific context inference. Therefore, the weighted context feature vector better reflects the user's true preferences in specific contexts. Finally, for different residential areas, a region-specific feature selection model is established. This model, based on information gain or mutual information algorithms, evaluates the contribution of each feature in the weighted context feature vector to context inference and selects the subset of features with the highest contribution. The weighted context feature vector is then dimensionality-reduced based on the selected feature subset. This step removes redundant or irrelevant features, reduces the dimensionality of the feature vector, improves computational efficiency, and enhances the feature vector's ability to distinguish specific contexts within a region. By establishing independent feature selection models for different regions, the most relevant feature subset can be selected based on the sensor configuration and user behavior characteristics of each region, ensuring the consistency of the final feature vector dimensionality used for context inference and improving the accuracy and generalization ability of context inference.

[0110] In some specific implementations, taking the living room area as an example, assume that the area is equipped with a human presence sensor, an ambient light sensor, and a smart TV. Historical data records the user's activities in the living room, including sensor readings, smart TV status, time, and manually adjusted lighting settings (brightness, color temperature, on / off). For example, a historical record shows: human presence reading 0.7, ambient light reading 80 lux, smart TV status "on", time "9 pm", the user manually adjusted the brightness to 0.2, the color temperature to 2700K, and the on / off status to "on". First, these data are preprocessed and quantized. The human presence reading of 0.7 is within the range [0,1]. The ambient light reading of 80 lux is logarithmically transformed, for example, to obtain ln(80)≈4.38. The smart TV status "on" is encoded as 1. The time "9 pm" is periodically encoded, for example, to obtain (-0.707,-0.707). The brightness adjustment value of 0.2 is within the range [0,1]. The color temperature adjustment value of 2700K is quantized to the numerical value 2700. The on / off state "on" is encoded as 1. This constructs an initial context feature vector, for example, [0.7, 4.38, 1, -0.707, -0.707, 0.2, 2700, 1]. Next, a weighted fusion algorithm is used. Based on historical behavioral data from the living room area, the system learns that in the "movie watching" context, the smart TV status and brightness adjustment have a significant impact on user preferences, and therefore assign them higher weights, for example, a weight vector of [0.3, 0.1, 0.4, 0.05, 0.05, 0.3, 0.05, 0.05]. The initial vector is then weighted and summed or matrix multiplied with this weighted vector to obtain a weighted context feature vector. Then, a feature selection model is established for the living room area, and the contribution of each feature in the weighted vector to distinguish between "movie watching," "reading," and "chatting" contexts is evaluated based on the information gain algorithm. It is assumed that the evaluation results show that the presence of a human body, the smart TV status, ambient light, and brightness adjustment have the highest information gain. Based on the selected feature subset, the weighted context feature vector is dimensionality-reduced, retaining only the numerical values ​​corresponding to the four features, forming a final 4-dimensional context feature vector. This 4-dimensional vector serves as the input to the subsequent context inference model, used to determine the most likely activity context of the current user in the living room. By customizing the feature selection process for the living room area, the effectiveness and dimensionality consistency of the final feature vector are ensured, improving the accuracy of context inference in this area.

[0111] In some embodiments, for different residential areas, a feature selection model corresponding to each area is established. The feature selection model is based on information gain or mutual information algorithms to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. The step of reducing the dimensionality of the weighted context feature vector according to the selected feature subset to obtain the final context feature vector used for context inference includes:

[0112] Based on users' historical behavior data, a regional association matrix is ​​constructed. Each element of the regional association matrix represents the probability that a user moves from one residential area to another. The transfer probability is calculated by statistically analyzing the frequency of user switching between different areas, and the results are stored in the database.

[0113] When performing feature selection for a specific residential area, the regional association matrix is ​​read from the database and incorporated into the objective function of the feature selection model. Specifically, the regional association matrix is ​​weighted and summed with the information gain or mutual information value of the features to obtain the corrected feature importance score, so that feature selection not only considers the information gain of the current area, but also the association with other areas.

[0114] Based on the corrected feature importance scores, the features in the initial context feature vector are sorted, and the feature subset with the highest score is selected. At the same time, based on the regional association matrix, the selected feature subset is adjusted, giving priority to retaining features with strong association with other regions. The adjustment method is to calculate the mutual information of each feature with other regional associated features and use it as an adjustment factor, multiplying it with the feature importance score.

[0115] Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction processing to obtain the final context feature vector used for context inference. The dimensionality reduction processing adopts principal component analysis or linear discriminant analysis to further reduce the vector dimension and improve computational efficiency. The dimensionality-reduced context feature vector is then used as the input to the subsequent activity context inference model.

[0116] The regional association matrix is ​​constructed by statistically analyzing the historical switching frequency of users between different residential areas. The matrix elements quantify the probability of a user moving from one area to another. This matrix is ​​stored in a database for subsequent feature selection. When selecting features for a specific area, this regional association matrix is ​​read and weighted and summed with the information gain or mutual information value of the features to generate a revised feature importance score. This score comprehensively considers the information contribution of a feature in the current area and its correlation with the user's cross-regional transfer pattern. Feature ranking and subset selection are performed based on the revised score. Further, the selected feature subset is adjusted using the regional association matrix, with the mutual information of the feature with other regionally related features used as an adjustment factor, prioritizing features strongly correlated with cross-regional activities. Finally, the weighted contextual feature vector is dimensionality-reduced based on the adjusted feature subset, and principal component analysis or linear discriminant analysis is used to obtain the final feature vector for contextual inference.

[0117] Specifically, this technical solution addresses the issue of neglecting to incorporate user inter-regional movement patterns into the feature selection process, thus affecting contextual inference. First, by analyzing historical user behavior data, a regional association matrix is ​​constructed and stored, reflecting users' movement habits within their residential space. When selecting features for a specific region, this regional association matrix is ​​read, and its information is weighted and fused with the information gain or mutual information values ​​of the features to calculate a revised feature importance score. This fusion method ensures that a feature's score depends not only on its contribution to contextual inference in the current region but also on its correlation with the user's inter-regional movement patterns. For example, a feature with low information gain in the current region will have a higher revised score if it is highly correlated with the user's frequent movements to another region. Next, all features in the initial contextual feature vector are ranked according to the revised feature importance score, and the features with the highest scores are selected to form the initial feature subset. Based on this, the selected feature subset is further adjusted using the regional association matrix, prioritizing features with strong correlations to other regions. By calculating the mutual information of each feature with other regionally related features and multiplying it as an adjustment factor with the feature importance score, features that may not have the highest score in the current region but are crucial for understanding cross-regional activity contexts can be identified and retained. Finally, based on the adjusted and selected feature subset, the weighted context feature vector is dimensionality-reduced using methods such as principal component analysis or linear discriminant analysis. This reduces feature dimensionality while preserving key information, lowering computational complexity and improving the processing efficiency of subsequent context inference models. The dimensionality-reduced context feature vector contains feature information that considers regional correlations and is provided as input to the activity context inference model, thereby improving the accuracy of context inference, especially when user activities involve multiple regions or are closely related to regional transfer patterns.

[0118] In some specific implementations, consider a residential environment comprising a living room and a kitchen. By statistically analyzing historical user behavior data, the probability of a user moving from the living room to the kitchen is calculated to be 0.7, and the probability of moving from the kitchen to the living room is 0.3. An area association matrix is ​​constructed and stored. When selecting contextual features for the living room area, this area association matrix is ​​retrieved. The initial contextual feature vector for the living room includes human presence sensor readings, ambient light sensor readings, television operating status, and time information. The information gain of these features for contextual inference in the living room is calculated. Simultaneously, the correlation between these features and kitchen area features (e.g., kitchen human presence sensor readings, kitchen smart device status) is considered; for example, the living room television operating status may be related to the user's subsequent movement to the kitchen to prepare snacks. The area association matrix information and the information gain of the features are weighted and summed to obtain a corrected feature importance score. For example, the corrected score for the living room television operating status may be improved due to its correlation with kitchen activities. The subset of features with the highest corrected scores is selected. Furthermore, even though the corrected score for the living room TV's operating status wasn't the highest, its high mutual information with the kitchen human presence sensor readings indicated a close correlation with the user's movement from the living room to the kitchen. Therefore, it was prioritized for retention during the feature subset adjustment stage. Finally, based on the selected and adjusted feature subset, principal component analysis was performed on the weighted living room context feature vector to reduce its dimensionality, yielding the final feature vector for subsequent context inference. Thus, the context inference model, when determining the user's activity context in the living room, not only considers local sensor information but also incorporates the probability of the user moving to the kitchen and feature information related to kitchen activities, improving the accuracy of context inference.

[0119] In some embodiments, when performing feature selection for a specific residential area, the step of reading the regional association matrix from the database and incorporating it into the objective function of the feature selection model includes: specifically, weighted summation of the regional association matrix and the information gain or mutual information value of the features to obtain the corrected feature importance score.

[0120] Construct a device state transition matrix. Each element of the device state transition matrix represents the probability that a user will transition from one smart device state to another smart device state within a residential area. The transition probability is calculated by statistically analyzing the switching frequency between different smart device states within the same area and the results are stored in the database.

[0121] Read the regional association matrix and device state transition matrix from the database, and use the singular value decomposition algorithm to decompose the regional association matrix into a user regional preference matrix and a regional feature matrix, and the device state transition matrix into a user device preference matrix and a device feature matrix.

[0122] The regional feature matrix and the device feature matrix are fused to obtain a fused feature matrix. The fusion method is as follows: calculate the weighted average of the two matrices. The weights are dynamically adjusted based on the user's historical behavior data. The longer the user stays in the region, the higher the weight of the regional feature matrix.

[0123] The fused feature matrix is ​​incorporated into the objective function of the feature selection model. Specifically, the fused feature matrix is ​​weighted and summed with the information gain or mutual information value of the features to obtain the corrected feature importance score. This makes feature selection consider not only the information gain of the current region, but also the correlation between the region and other regions, as well as the influence of the device status.

[0124] The device state transition matrix is ​​constructed by continuously monitoring changes in the operational status of smart devices within a specific residential area, such as turning smart TVs on and off, adjusting volume, and switching playback states of smart speakers. The frequency of these state transitions is recorded, and the probability of transitioning from one device state to another is calculated. These probability values ​​are then organized and stored in matrix form. The regional association matrix and device state transition matrix are retrieved from pre-built data structures stored in a database. Singular value decomposition (SVD) is applied to mathematically decompose the retrieved matrices, extracting latent feature vectors representing user behavior patterns to form the regional feature matrix and device feature matrix. The fusion of the regional and device feature matrices uses a weighted average method. The weight allocation logic is based on historical behavioral indicators such as the user's dwell time in different areas. Feature matrices corresponding to areas with longer dwell times are assigned higher weights to reflect the importance of activity in that area for overall contextual inference. The fused feature matrix contains behavioral information in two dimensions: user spatial movement and device usage within the area. The fusion feature matrix is ​​incorporated into the objective function of the feature selection model. Specifically, when calculating the information gain or mutual information of each feature (such as human presence, ambient lighting, specific device status, etc.) for context inference, the information of the fusion feature matrix is ​​used as a correction factor. The original importance score of the feature is adjusted by weighted summation, thereby obtaining the corrected feature importance score.

[0125] Specifically, this technical solution captures user interaction patterns with smart devices within a specific area by introducing a device state transition matrix, thus overcoming the limitations of only considering inter-area transition information. First, the system continuously collects data on user smart device usage across various residential areas. For example, in the living room, it records when the user turns the smart TV on or off, and when the smart speaker starts or stops playing. By statistically analyzing the frequency of these device state transitions, a device state transition matrix is ​​constructed, quantifying the user's device usage habits within a specific area. Next, the system reads a pre-calculated regional association matrix (reflecting the user's tendency to move between different areas) and the newly constructed device state transition matrix. Subsequently, the singular value decomposition algorithm is used to process these two matrices separately, extracting regional features related to the user's regional transition patterns and device features related to the user's device usage patterns within the user's area. These features are represented as a regional feature matrix and a device feature matrix. To more comprehensively reflect user behavior, the regional feature matrix and the device feature matrix are fused to form a fused feature matrix. During the fusion process, the weights are dynamically adjusted based on factors such as the user's historical dwell time in different areas. For example, if the user spends a long time in the living room, the regional features corresponding to the living room receive higher weights during fusion. Finally, when selecting features for contextual inference, the information from this fused feature matrix is ​​incorporated into the objective function of the feature selection algorithm (e.g., based on information gain or mutual information). This means that when evaluating the importance of a feature (e.g., the status of a smart TV in the living room) for contextual inference, not only is the feature's relevance to the context considered, but also its correlation with the user's cross-regional behavior patterns and device usage patterns within the region. A weighted summation is then used to obtain a revised feature importance score. Thus, the feature selection process can prioritize features that are not only informative in the current region but also closely related to the user's overall behavior patterns, resulting in a more accurate subset of features reflecting the user's current activity context. This improves the accuracy of subsequent contextual inference, enabling smart lighting systems to more precisely match the user's actual needs and reduce the frequency of manual adjustments.

[0126] In some specific implementations, in the living room area of ​​a residence, the system continuously records the changes in the operating status of smart devices used by the user, such as the smart TV turning on from off, the smart speaker turning on from silent to playing music, and the smart curtains turning off from open. By statistically analyzing the frequency of these state transitions, a device state transition matrix for the living room area is calculated. For example, statistics show that the probability of a user transitioning from "smart TV off" to "smart TV on" is higher at night, and the probability of transitioning from "smart speaker playing music" to "smart speaker silent" is higher during specific time periods. Simultaneously, the system reads the user's historical transition data between different areas to obtain a regional association matrix, such as the probability of transitioning from the dining room to the living room. Using a singular value decomposition algorithm, the device state transition matrix of the living room and the user's regional association matrix are decomposed to extract a device feature matrix representing the user's device usage habits in the living room and a regional feature matrix representing the user's regional transition patterns. Assuming that the user spends most of their time in the living room, the regional feature matrix is ​​given a higher weight when fusing the device feature matrix and the regional feature matrix. The fused feature matrix is ​​weighted and summed with the information gain values ​​of various sensor features (such as human presence sensor readings and ambient light sensor readings) and device status features (such as smart TV status and smart speaker status) in the living room area to obtain a corrected feature importance score. For example, the original information gain of the smart TV status feature may be high, but by incorporating it into the fused feature matrix, its score is further improved because it is not only related to the living room context but also closely associated with the user's extended stay in the living room and behavioral patterns when moving from the dining room to the living room. Therefore, when selecting features for context inference in the living room area, features strongly correlated with device usage and area behavior patterns, such as the smart TV status, are prioritized, thus more accurately inferring whether the user is "watching a movie" or "reading," and subsequently selecting an appropriate lighting strategy.

[0127] In some embodiments, when performing feature selection for a specific residential area, the step of reading the regional association matrix from the database and incorporating it into the objective function of the feature selection model includes: specifically, weighted summation of the regional association matrix and the information gain or mutual information value of the features to obtain the corrected feature importance score.

[0128] The system reads the regional correlation matrix from the database and obtains the current environmental data from environmental sensors, including weather and time information.

[0129] Based on environmental data, the influence factor of environmental factors on the probability of inter-regional migration is calculated using a pre-trained environmental impact model. The environmental impact model is trained based on historical environmental data and user regional migration data and is used to predict the probability changes of users' inter-regional migration under different environmental conditions.

[0130] The impact factors are fused with the regional correlation matrix to obtain the environmentally corrected regional correlation matrix. The specific method is to multiply each element in the regional correlation matrix with the corresponding regional transfer environmental impact factor to obtain the corrected transfer probability.

[0131] The environment-corrected regional correlation matrix is ​​incorporated into the objective function of the feature selection model. Specifically, the environment-corrected regional correlation matrix is ​​weighted and summed with the information gain or mutual information value of the feature to obtain the corrected feature importance score. This ensures that feature selection considers not only the information gain of the current region but also the correlation between the feature and other regions in the current environment. The corrected feature importance score is then used in subsequent feature selection steps.

[0132] The system retrieves a regional association matrix from a database, storing the statistical probabilities of users' historical migrations between different residential areas. It acquires current-moment environmental data from environmental sensors, including real-time weather conditions (e.g., sunny, rainy, cloudy) and specific times (e.g., hour, minute, day of the week). A pre-trained environmental impact model, which can be a regression model or a neural network model, is used. Its input is the current environmental data, and its output is the influence factor of environmental factors on the probability of a user migrating from one area to another. This influence factor is a multiplier used to adjust the original inter-regional migration probabilities. The influence factor is then fused with the regional association matrix by multiplying each element (the original migration probability) by the corresponding environmental influence factor for regional migration, resulting in an environment-corrected regional association matrix that reflects the dynamic migration probabilities under the current environment. This environment-corrected regional association matrix is ​​then incorporated into the objective function of a feature selection model. This means that when calculating the information gain or mutual information value of features, the corrected matrix is ​​used for weighting, resulting in a corrected feature importance score that considers the regional associations under the current environment.

[0133] Specifically, this technical solution addresses the problem of failing to dynamically consider the impact of environmental factors on user area relocation behavior when selecting residential area features. First, the system acquires environmental data such as current weather and time. This environmental data is input into a pre-trained environmental impact model. This model is trained based on a large amount of historical environmental data and user area relocation records under different environments, learning how environmental factors change the probability of a user moving from one area to another. The model outputs one or a set of impact factors, quantifying the degree to which the current environment corrects the probability of relocation between different areas. For example, if it is a sunny evening, the model might output an impact factor indicating an increased probability of a user moving from the living room to the balcony; if it is raining, the model might output another impact factor indicating a decreased probability of a user moving from the living room to the balcony. Then, the system reads an area association matrix constructed based on historical average behavior from the database. The impact factors calculated by the environmental impact model are fused with the area association matrix, specifically by multiplying each element in the matrix (representing the historical average relocation probability) by the corresponding environmental impact factor for area relocation. This yields an environmentally corrected area association matrix, which reflects the dynamic probability of a user moving between areas under current weather and time conditions. Finally, when selecting features for specific residential areas, this environment-corrected regional association matrix is ​​incorporated into the objective function of the feature selection algorithm (e.g., based on information gain or mutual information). This means that when evaluating the importance of a feature (e.g., sensor readings for a certain area) for context inference in the current area, not only is the information content of the feature in the current area considered, but also the correlation between the feature and other areas in the current environment is dynamically considered based on the environment-corrected regional association matrix. For example, if the environment-corrected matrix shows that a user is more likely to move from the current area to another area in the current environment, then sensor features from that other area may receive a higher importance score in the feature selection for the current area. In this way, the feature selection process can dynamically adapt to the current environmental conditions, selecting a subset of features that are more predictive of context inference in the current environment, thereby improving the accuracy of subsequent activity context inference.

[0134] In some implementations, it is assumed that the system is performing feature selection on the living room area. The system reads the association probability matrices between the living room and the balcony, and between the living room and the kitchen, from the database. The current environmental data shows "rainy day, 3 PM". A pre-trained environmental impact model receives "rainy day, 3 PM" as input and calculates the influence factor of the environment on the probability of a user moving from the living room to the balcony as 0.2 (indicating a decreased probability), and the influence factor on the probability of moving from the living room to the kitchen as 1.1 (indicating a slight increase in probability). In the original area association matrix, the probability of moving from the living room to the balcony is 0.4, and the probability of moving from the living room to the kitchen is 0.3. After environmental correction, the corrected probability of moving from the living room to the balcony becomes 0.4 * 0.2 = 0.08, and the corrected probability of moving from the living room to the kitchen becomes 0.3 * 1.1 = 0.33. When performing feature selection on the living room area, the importance of the balcony light sensor readings as features is evaluated. Traditional feature selection may only be based on its information gain in inferring the living room context. This approach incorporates a weighted average of 0.08, representing the adjusted transition probability from the living room to the balcony, when calculating the revised importance score of the balcony lighting sensor features. Since this transition probability is significantly reduced in the current rainy weather, the revised importance score of the balcony lighting sensor features will decrease accordingly. Similarly, when evaluating the importance of the kitchen smart device status as a feature, a weighted average of 0.33, representing the adjusted transition probability from the living room to the kitchen, is used. This slight increase in probability may slightly improve the revised importance score of the kitchen smart device status features. Finally, based on these revised feature importance scores, the subset of features most relevant to the current living room context is selected. For example, on a rainy afternoon, features related to the balcony may be excluded or have their weight reduced, while features related to the kitchen may be retained or have their weight increased. Thus, the context inference model will use features that better reflect user behavior patterns in the current environment, improving the accuracy of context inference.

[0135] In some embodiments, the steps of using time series analysis to analyze the changing trend of context feature vectors over time, predicting the user's activity context over a future period, and using the prediction results as initial context hypotheses, wherein the initial context hypotheses include the predicted activity contexts and corresponding probability values, include:

[0136] Extract a set of historical context feature vectors from the database, classify the historical context feature vectors according to date information, and distinguish between holiday context feature vectors and regular context feature vectors;

[0137] Time series analysis models are established for holiday context feature vectors and regular context feature vectors, respectively. The time series analysis models include autoregressive moving average models or long short-term memory network models. The model parameters are trained and optimized based on the corresponding historical context feature vector sets.

[0138] When predicting activity scenarios, determine whether the current date is a holiday. If it is a holiday, select the holiday time series analysis model; otherwise, select the normal time series analysis model.

[0139] Input the current context feature vector into the selected time series analysis model to predict the user's activity context in the future. Based on the model output, calculate the probability value of each predicted activity context and generate the initial context hypothesis.

[0140] After extracting historical context feature vector sets from the database, these vectors are categorized into either a "holiday context feature vector set" or a "regular day context feature vector set" based on the date information associated with each vector. This classification process is based on a pre-defined list of holidays or automatically identified through analysis of historical date data. Independent time series analysis models are constructed for these two separate datasets. For example, an autoregressive moving average model can be trained for holiday data, and a long short-term memory network model can be trained for regular day data. The model training process uses the corresponding category's historical context feature vector set as input, optimizing the model parameters to enable it to learn and capture time series patterns under that category of dates. When context prediction is required, the system first obtains the current date information and determines whether it belongs to a holiday or a regular day. Based on the determination result, the system selects a pre-trained time series analysis model that matches the current date type. The context feature vector at the current moment is input into the selected model. Based on the learned time patterns, the model outputs predictions of the user's future activity context and calculates a probability value for each predicted activity context. These predicted activity contexts and their corresponding probability values ​​together constitute the initial context hypothesis, used for subsequent context inference. By establishing independent models for different date types, the system can more accurately reflect users' behavioral patterns in different time periods, thus improving the accuracy of predictions.

[0141] Specifically, this technical solution addresses the impact of varying user behavior patterns across different date types on the accuracy of context prediction. First, the system extracts context feature vectors from stored historical data. These vectors represent the environment and user-adjusted lighting settings at a specific point in the past. By examining the date each vector was recorded on, the system categorizes these historical vectors into two groups: one corresponding to holidays and the other to weekdays. This classification step separates datasets with different temporal behavior patterns. Next, independent time-series analysis models are built and trained for each of these two separate groups of data. For example, an autoregressive moving average model or a long short-term memory network model can be used. Each model is trained using only historical data for its corresponding category, enabling it to specifically learn and reflect user behavior time-series patterns for that date type. In actual activity context prediction, the system first determines whether the current date is a holiday or a weekday. Based on this determination, the system selects the corresponding trained time-series analysis model. The context feature vectors collected at the current moment are input into the selected model. Based on its learning of historical patterns for that date type, the model predicts the user's possible activity contexts over a future period and calculates a probability value for each predicted context. These predictions and their probability values ​​are integrated into initial context hypotheses. By using different models for different date types, this approach can more accurately predict users' future activity scenarios under the current date type, improve the reliability of the initial scenario assumptions, and thus enhance the accuracy of subsequent scenario inference based on Bayesian networks.

[0142] In some implementations, it is assumed that the system database stores contextual feature vector data of users over the past year. The system first iterates through this data, classifying all data recorded on holidays into a "holiday dataset" and all data recorded on non-holidays into a "normal dataset" based on date information (e.g., checking a list of national statutory holidays or analyzing whether the date is a weekend). For example, data from October 1, 2023, is placed in the holiday dataset, while data from October 9, 2023, is placed in the normal dataset. Then, for the holiday dataset, a long short-term memory network model is trained, which learns the pattern of contextual feature vector changes over time during holidays. For the normal dataset, an autoregressive moving average model is trained, which learns the pattern of contextual feature vector changes over time during normal periods. When the system needs to make a contextual prediction for May 1, 2024 (Labor Day, a holiday), the system determines that the current date is a holiday and therefore selects the long short-term memory network model trained on a holiday. The system obtains the contextual feature vector at the current time (e.g., 9:00 AM) and inputs it into the model. The model outputs predictions, for example, the probability of the "preparing breakfast" scenario is 0.6, the probability of the "leisure reading" scenario is 0.3, and the probability of the "outdoor activity" scenario is 0.1. These predicted scenarios and their probability values ​​(e.g., {"preparing breakfast": 0.6, "leisure reading": 0.3, "outdoor activity": 0.1}) constitute the initial scenario hypotheses. If the current date is May 6, 2024 (a normal day), the system selects the autoregressive moving average model trained on a normal day for prediction.

[0143] Reference Appendix Figure 2 This invention provides a sensor data control system applied to a residential intelligent lighting control system, comprising:

[0144] The acquisition module 100 is used to acquire a real-time environmental data set of the current residential environment; the real-time environmental data set includes human presence sensor readings, ambient light sensor readings, smart device operating status information, and time information;

[0145] The identification module 200 is used to identify the user identifier of the currently active user;

[0146] The lookup module 300 is used to search for the historical behavior pattern record with the highest similarity to the real-time environment data set in the behavior pattern library based on the user identifier; the behavior pattern record includes the historical environment data set, the user identifier, and the lighting settings manually adjusted by the user.

[0147] The inference module 400 is used to infer the activity context of the current active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user.

[0148] The selection module 500 is used to select the corresponding lighting control strategy from the preset lighting strategy library based on the inferred activity context.

[0149] The control module 600 is used to send control commands to the lighting controller based on the selected lighting control strategy, so that the lighting controller adjusts the lighting settings of the current residential environment.

[0150] In some embodiments, the lookup module 300 performs the following when searching for a historical behavior pattern record in the behavior pattern library that has the highest similarity to the real-time environment data set based on the user identifier:

[0151] An anomaly detection model is established, which is based on statistical analysis or machine learning algorithms and is used to evaluate the rationality of users manually adjusting lighting settings in historical behavior pattern records by considering the correlation between historical environmental data sets and lighting settings.

[0152] When multiple historical behavior pattern records with the same similarity are found, the anomaly detection model is used to evaluate each historical behavior pattern record and obtain the anomaly score corresponding to each historical behavior pattern record. The anomaly score reflects the degree of deviation between the lighting settings manually adjusted by the user and the corresponding historical environmental data set.

[0153] Based on the abnormal scores, all historical behavior pattern records are filtered out, and those with abnormal scores exceeding a preset threshold are removed from the behavior pattern database. The preset threshold is dynamically adjusted according to the distribution of abnormal scores in historical behavior pattern records.

[0154] In some embodiments, the inference module 400 performs the following when inferring the activity context of the currently active user based on a set of historical environmental data in historical behavior pattern records and lighting settings manually adjusted by the user:

[0155] A context feature vector is constructed, which integrates historical environmental data sets with lighting settings manually adjusted by the user. A weighted fusion algorithm is used to assign weights based on the contribution of different data sources to context inference, with human presence sensor readings having a higher weight than time information.

[0156] Using time series analysis, we analyze the changing trend of context feature vectors over time, predict the user's activity context in the future, and use the prediction results as the initial context hypothesis, which includes the predicted activity context and the corresponding probability value.

[0157] A Bayesian network-based activity context inference model is established. The Bayesian network uses the probability values ​​in the initial context hypothesis as the prior probability and combines them with the current real-time environment data set to calculate the posterior probability of the user being in various activity contexts.

[0158] The activity scenario with the highest posterior probability is selected as the final inference result, and the confidence score associated with the activity scenario is output. When the confidence score is lower than a preset threshold, the user is prompted to manually select an activity scenario.

[0159] In some embodiments, the inference module 400 is executed when constructing a context feature vector, which fuses historical environmental data sets with manually adjusted lighting settings by the user, and employs a weighted fusion algorithm to assign weights based on the contribution of different data sources to context inference:

[0160] The historical environmental data set is preprocessed, including: normalizing the readings of the human presence sensor and mapping the readings to the [0,1] interval; performing logarithmic transformation on the ambient light sensor readings; encoding the operating status information of the smart devices; and periodically encoding the time information.

[0161] The lighting settings manually adjusted by the user are quantified, including: mapping the light brightness adjustment value to the [0,1] range; mapping the color temperature adjustment value to the preset color temperature range; and encoding the light switch status as 0 or 1.

[0162] Based on the preprocessed historical environmental data set and the quantified lighting settings, an initial situation feature vector is constructed. The initial situation feature vector includes normalized human presence sensor readings, logarithmically transformed ambient light sensor readings, encoded smart device operating status information, periodically encoded time information, light brightness adjustment values, color temperature adjustment values, and light on / off status.

[0163] A weighted fusion algorithm is used to weight each element in the initial context feature vector to obtain a weighted context feature vector. The weighted fusion algorithm includes: establishing a weight allocation matrix, where each row of the weight allocation matrix corresponds to a data source and each column corresponds to a context, and the matrix elements represent the weight of the data source in that context; multiplying the initial context feature vector with the weight allocation matrix to obtain the weighted context feature vector; the weight allocation matrix can be dynamically adjusted based on the current user's historical behavior data.

[0164] For different residential areas, a feature selection model corresponding to the area is established. The feature selection model is based on information gain or mutual information algorithm to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction to obtain the final context feature vector used for context inference.

[0165] In some embodiments, the inference module 400 is used to establish a feature selection model corresponding to different residential areas. The feature selection model is based on information gain or mutual information algorithms to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. Based on the selected feature subset, the weighted context feature vector is dimensionality reduced to obtain the final context feature vector used for context inference.

[0166] Based on users' historical behavior data, a regional association matrix is ​​constructed. Each element of the regional association matrix represents the probability that a user moves from one residential area to another. The transfer probability is calculated by statistically analyzing the frequency of user switching between different areas, and the results are stored in the database.

[0167] When performing feature selection for a specific residential area, the regional association matrix is ​​read from the database and incorporated into the objective function of the feature selection model. Specifically, the regional association matrix is ​​weighted and summed with the information gain or mutual information value of the features to obtain the corrected feature importance score, so that feature selection not only considers the information gain of the current area, but also the association with other areas.

[0168] Based on the corrected feature importance scores, the features in the initial context feature vector are sorted, and the feature subset with the highest score is selected. At the same time, based on the regional association matrix, the selected feature subset is adjusted, giving priority to retaining features with strong association with other regions. The adjustment method is to calculate the mutual information of each feature with other regional associated features and use it as an adjustment factor, multiplying it with the feature importance score.

[0169] Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction processing to obtain the final context feature vector used for context inference. The dimensionality reduction processing adopts principal component analysis or linear discriminant analysis to further reduce the vector dimension and improve computational efficiency. The dimensionality-reduced context feature vector is then used as the input to the subsequent activity context inference model.

[0170] In some embodiments, the inference module 400, when performing feature selection for a specific residential area, reads a regional association matrix from a database and incorporates it into the objective function of the feature selection model. Specifically, it performs a weighted summation of the regional association matrix and the information gain or mutual information value of the features to obtain a corrected feature importance score.

[0171] Construct a device state transition matrix. Each element of the device state transition matrix represents the probability that a user will transition from one smart device state to another smart device state within a residential area. The transition probability is calculated by statistically analyzing the switching frequency between different smart device states within the same area and the results are stored in the database.

[0172] Read the regional association matrix and device state transition matrix from the database, and use the singular value decomposition algorithm to decompose the regional association matrix into a user regional preference matrix and a regional feature matrix, and the device state transition matrix into a user device preference matrix and a device feature matrix.

[0173] The regional feature matrix and the device feature matrix are fused to obtain a fused feature matrix. The fusion method is as follows: calculate the weighted average of the two matrices. The weights are dynamically adjusted based on the user's historical behavior data. The longer the user stays in the region, the higher the weight of the regional feature matrix.

[0174] The fused feature matrix is ​​incorporated into the objective function of the feature selection model. Specifically, the fused feature matrix is ​​weighted and summed with the information gain or mutual information value of the features to obtain the corrected feature importance score. This makes feature selection consider not only the information gain of the current region, but also the correlation between the region and other regions, as well as the influence of the device status.

[0175] In some embodiments, the inference module 400, when performing feature selection for a specific residential area, reads a regional association matrix from a database and incorporates it into the objective function of the feature selection model. Specifically, it performs a weighted summation of the regional association matrix and the information gain or mutual information value of the features to obtain a corrected feature importance score.

[0176] The system reads the regional correlation matrix from the database and obtains the current environmental data from environmental sensors, including weather and time information.

[0177] Based on environmental data, the influence factor of environmental factors on the probability of inter-regional migration is calculated using a pre-trained environmental impact model. The environmental impact model is trained based on historical environmental data and user regional migration data and is used to predict the probability changes of users' inter-regional migration under different environmental conditions.

[0178] The impact factors are fused with the regional correlation matrix to obtain the environmentally corrected regional correlation matrix. The specific method is to multiply each element in the regional correlation matrix with the corresponding regional transfer environmental impact factor to obtain the corrected transfer probability.

[0179] The environment-corrected regional correlation matrix is ​​incorporated into the objective function of the feature selection model. Specifically, the environment-corrected regional correlation matrix is ​​weighted and summed with the information gain or mutual information value of the feature to obtain the corrected feature importance score. This ensures that feature selection considers not only the information gain of the current region but also the correlation between the feature and other regions in the current environment. The corrected feature importance score is then used in subsequent feature selection steps.

[0180] In some embodiments, the inference module 400 is executed when it uses time series analysis methods to analyze the changing trend of context feature vectors in the time dimension, predicts the user's activity context in the future, and uses the prediction result as an initial context hypothesis, which includes the predicted activity context and the corresponding probability value:

[0181] Extract a set of historical context feature vectors from the database, classify the historical context feature vectors according to date information, and distinguish between holiday context feature vectors and regular context feature vectors;

[0182] Time series analysis models are established for holiday context feature vectors and regular context feature vectors, respectively. The time series analysis models include autoregressive moving average models or long short-term memory network models. The model parameters are trained and optimized based on the corresponding historical context feature vector sets.

[0183] When predicting activity scenarios, determine whether the current date is a holiday. If it is a holiday, select the holiday time series analysis model; otherwise, select the normal time series analysis model.

[0184] Input the current context feature vector into the selected time series analysis model to predict the user's activity context in the future. Based on the model output, calculate the probability value of each predicted activity context and generate the initial context hypothesis.

[0185] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0186] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A sensor data control method, applied to a residential intelligent lighting control system, characterized in that, Includes the following steps: Acquire a real-time environmental data set of the current residential environment; the real-time environmental data set includes human presence sensor readings, ambient light sensor readings, smart device operating status information, and time information; Identify the user ID of the currently active user; Based on the user identifier, search the behavior pattern library for the historical behavior pattern record with the highest similarity to the real-time environment data set; the behavior pattern record includes the historical environment data set, the user identifier, and the lighting settings manually adjusted by the user. Based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user, the activity context of the current active user is inferred. Specific steps include: constructing a context feature vector, which integrates the historical environmental data set and the manually adjusted lighting settings, and employing a weighted fusion algorithm to assign weights based on the contribution of different data sources to context inference; further steps include: establishing a feature selection model corresponding to different residential areas, the feature selection model being based on information gain or mutual information algorithms to evaluate the contribution of each feature in the initial context feature vector to context inference, and selecting the feature subset with the highest contribution; and performing dimensionality reduction processing on the weighted context feature vector based on the selected feature subset to obtain the final context feature vector used for context inference. Further steps include: Based on users' historical behavior data, a regional association matrix is ​​constructed. Each element of the regional association matrix represents the probability that a user moves from one residential area to another. The transfer probability is calculated by statistically analyzing the frequency of user switching between different areas, and the results are stored in the database. When performing feature selection for a specific residential area, the regional association matrix is ​​read from the database and incorporated into the objective function of the feature selection model. Specifically, the regional association matrix and the information gain or mutual information value of the features are weighted and summed to obtain the corrected feature importance score. Based on the corrected feature importance scores, the features in the initial context feature vector are sorted, and the feature subset with the highest score is selected. At the same time, the selected feature subset is adjusted according to the regional association matrix. The adjustment method is to calculate the mutual information of each feature with other regional association features and use it as an adjustment factor, which is then multiplied by the feature importance score. Based on the selected feature subset, the weighted context feature vector is reduced in dimensionality to obtain the final context feature vector used for context inference. Based on the inferred activity context, select the corresponding lighting control strategy from the preset lighting strategy library; Based on the selected lighting control strategy, control commands are sent to the lighting controller to adjust the lighting settings of the current residential environment.

2. The sensing data control method according to claim 1, characterized in that, The steps for finding the historical behavior pattern record with the highest similarity to the real-time environment data set in the behavior pattern library based on the user identifier include: An anomaly detection model is established, which is based on statistical analysis or machine learning algorithms and is used to evaluate the rationality of users manually adjusting lighting settings in historical behavior pattern records by considering the correlation between historical environmental data sets and lighting settings. When multiple historical behavior pattern records with the same similarity are found, the anomaly detection model is used to evaluate each historical behavior pattern record to obtain an anomaly score corresponding to each historical behavior pattern record; the anomaly score reflects the degree of deviation between the lighting settings manually adjusted by the user and the corresponding historical environmental data set. Based on the abnormal scores, all historical behavior pattern records are filtered out, and those records with abnormal scores exceeding a preset threshold are removed from the behavior pattern library; the preset threshold is dynamically adjusted according to the distribution of abnormal scores in the historical behavior pattern records.

3. The sensing data control method according to claim 1, characterized in that, The steps for inferring the activity context of the current active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user include: A context feature vector is constructed, which integrates historical environmental data sets with lighting settings manually adjusted by the user, and a weighted fusion algorithm is used to assign weights based on the contribution of different data sources to context inference. Using time series analysis, the changing trend of the context feature vector over time is analyzed to predict the user's activity context in the future, and the prediction results are used as initial context hypotheses, which include the predicted activity context and the corresponding probability values. An activity context inference model based on Bayesian networks is established. The Bayesian network uses the probability values ​​in the initial context assumptions as prior probabilities and combines them with the current real-time environment data set to calculate the posterior probabilities of the user being in various activity contexts. The activity scenario with the highest posterior probability is selected as the final inference result, and a confidence score associated with the activity scenario is output. When the confidence score is lower than a preset threshold, the user is prompted to manually select an activity scenario.

4. The sensing data control method according to claim 3, characterized in that, The process of constructing a context feature vector, which integrates historical environmental data with manually adjusted lighting settings, and employing a weighted fusion algorithm to assign weights based on the contribution of different data sources to context inference, includes the following steps: The historical environmental data set is preprocessed, including: normalizing the readings of the human presence sensor and mapping the readings to the [0,1] interval; performing logarithmic transformation on the ambient light sensor readings; encoding the operating status information of the smart devices; and periodically encoding the time information. Quantify the lighting settings manually adjusted by the user, including mapping the light brightness adjustment value to the [0,1] range; Map the color temperature adjustment value to a preset color temperature range; encode the light switch status as 0 or 1; Based on the preprocessed historical environmental data set and the quantified lighting settings, an initial situation feature vector is constructed. The initial situation feature vector includes normalized human presence sensor readings, logarithmically transformed ambient light sensor readings, encoded smart device operating status information, periodically encoded time information, light brightness adjustment values, color temperature adjustment values, and light on / off status. A weighted fusion algorithm is used to weight each element in the initial context feature vector to obtain a weighted context feature vector. The weighted fusion algorithm includes: establishing a weight allocation matrix, where each row of the weight allocation matrix corresponds to a data source and each column corresponds to a context, and the matrix elements represent the weight of the data source in the context; multiplying the initial context feature vector with the weight allocation matrix to obtain the weighted context feature vector. For different residential areas, a feature selection model corresponding to the area is established. The feature selection model is based on information gain or mutual information algorithm to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction to obtain the final context feature vector used for context inference.

5. The sensing data control method according to claim 3, characterized in that, Using time series analysis, the process of analyzing the changing trend of the context feature vector over time, predicting the user's activity context in the future, and using the prediction results as initial context hypotheses, which include the predicted activity contexts and corresponding probability values, includes the following steps: Extract a set of historical context feature vectors from the database, classify the historical context feature vectors according to date information, and distinguish between holiday context feature vectors and regular context feature vectors; Time series analysis models are established for holiday context feature vectors and regular context feature vectors, respectively. The time series analysis models include autoregressive moving average models or long short-term memory network models. The model parameters are trained and optimized based on the corresponding historical context feature vector sets. When predicting activity scenarios, determine whether the current date is a holiday. If it is a holiday, select the holiday time series analysis model; otherwise, select the normal time series analysis model. Input the current context feature vector into the selected time series analysis model to predict the user's activity context in the future. Based on the model output, calculate the probability value of each predicted activity context and generate the initial context hypothesis.

6. A sensor data control system, applied to a residential intelligent lighting control system, characterized in that, include: The acquisition module is used to acquire a set of real-time environmental data of the current residential environment; The real-time environmental data set includes human presence sensor readings, ambient light sensor readings, smart device operating status information, and time information; The identification module is used to identify the user identifier of the currently active user; The search module is used to search for the historical behavior pattern record with the highest similarity to the real-time environment data set in the behavior pattern library based on the user identifier; the behavior pattern record includes the historical environment data set, the user identifier, and the lighting settings manually adjusted by the user. The inference module is used to infer the activity context of the current active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user. Further, it performs the following steps: constructing a context feature vector, which integrates the historical environmental data set and the lighting settings manually adjusted by the user, and uses a weighted fusion algorithm to assign weights based on the contribution of different data sources to context inference; further, it performs the following steps: establishing a feature selection model corresponding to different residential areas, the feature selection model being based on information gain or mutual information algorithms to evaluate the contribution of each feature in the initial context feature vector to context inference, and selecting the feature subset with the highest contribution; based on the selected feature subset, it performs dimensionality reduction processing on the weighted context feature vector to obtain the final context feature vector used for context inference; and further, it performs the following steps: Based on users' historical behavior data, a regional association matrix is ​​constructed. Each element of the regional association matrix represents the probability that a user moves from one residential area to another. The transfer probability is calculated by statistically analyzing the frequency of user switching between different areas, and the results are stored in the database. When performing feature selection for a specific residential area, the regional association matrix is ​​read from the database and incorporated into the objective function of the feature selection model. Specifically, the regional association matrix and the information gain or mutual information value of the features are weighted and summed to obtain the corrected feature importance score. Based on the corrected feature importance scores, the features in the initial context feature vector are sorted, and the feature subset with the highest score is selected. At the same time, the selected feature subset is adjusted according to the regional association matrix. The adjustment method is to calculate the mutual information of each feature with other regional association features and use it as an adjustment factor, which is then multiplied by the feature importance score. Based on the selected feature subset, the weighted context feature vector is reduced in dimensionality to obtain the final context feature vector used for context inference. The selection module is used to select the corresponding lighting control strategy from the preset lighting strategy library based on the inferred activity context; The control module is used to send control commands to the lighting controller based on the selected lighting control strategy, so that the lighting controller adjusts the lighting settings of the current residential environment.

7. The sensor data control system according to claim 6, characterized in that, The search module performs the following when searching for the historical behavior pattern record in the behavior pattern library that has the highest similarity to the real-time environment data set based on the user identifier: An anomaly detection model is established, which is based on statistical analysis or machine learning algorithms and is used to evaluate the rationality of users manually adjusting lighting settings in historical behavior pattern records by considering the correlation between historical environmental data sets and lighting settings. When multiple historical behavior pattern records with the same similarity are found, the anomaly detection model is used to evaluate each historical behavior pattern record to obtain an anomaly score corresponding to each historical behavior pattern record; the anomaly score reflects the degree of deviation between the lighting settings manually adjusted by the user and the corresponding historical environmental data set. Based on the anomaly score, all the historical behavior pattern records are filtered out, and historical behavior pattern records with anomaly scores exceeding a preset threshold are excluded and removed from the behavior pattern library. The preset threshold is dynamically adjusted based on the abnormal score distribution recorded in the historical behavior pattern.

8. The sensor data control system according to claim 6, characterized in that, The inference module performs the following when inferring the activity context of the currently active user based on the historical environmental data set in the historical behavior pattern record and the lighting settings manually adjusted by the user: A context feature vector is constructed, which integrates historical environmental data sets with lighting settings manually adjusted by the user, and a weighted fusion algorithm is used to assign weights based on the contribution of different data sources to context inference. Using time series analysis, the changing trend of the context feature vector over time is analyzed to predict the user's activity context in the future, and the prediction results are used as initial context hypotheses, which include the predicted activity context and the corresponding probability values. An activity context inference model based on Bayesian networks is established. The Bayesian network uses the probability values ​​in the initial context assumptions as prior probabilities and combines them with the current real-time environment data set to calculate the posterior probabilities of the user being in various activity contexts. The activity scenario with the highest posterior probability is selected as the final inference result, and a confidence score associated with the activity scenario is output. When the confidence score is lower than a preset threshold, the user is prompted to manually select an activity scenario.

9. The sensor data control system according to claim 8, characterized in that, The inference module constructs a context feature vector, which integrates historical environmental data and user-manually adjusted lighting settings, and employs a weighted fusion algorithm to assign weights based on the contribution of different data sources to context inference. The steps include: The historical environmental data set is preprocessed, including: normalizing the readings of the human presence sensor and mapping the readings to the [0,1] interval; performing logarithmic transformation on the ambient light sensor readings; encoding the operating status information of the smart devices; and periodically encoding the time information. Quantify the lighting settings manually adjusted by the user, including mapping the light brightness adjustment value to the [0,1] range; Map the color temperature adjustment value to a preset color temperature range; encode the light switch status as 0 or 1; Based on the preprocessed historical environmental data set and the quantified lighting settings, an initial situation feature vector is constructed. The initial situation feature vector includes normalized human presence sensor readings, logarithmically transformed ambient light sensor readings, encoded smart device operating status information, periodically encoded time information, light brightness adjustment values, color temperature adjustment values, and light on / off status. A weighted fusion algorithm is used to weight each element in the initial context feature vector to obtain a weighted context feature vector. The weighted fusion algorithm includes: establishing a weight allocation matrix, where each row of the weight allocation matrix corresponds to a data source and each column corresponds to a context, and the matrix elements represent the weight of the data source in the context; multiplying the initial context feature vector with the weight allocation matrix to obtain the weighted context feature vector. For different residential areas, a feature selection model corresponding to the area is established. The feature selection model is based on information gain or mutual information algorithm to evaluate the contribution of each feature in the initial context feature vector to context inference and select the feature subset with the highest contribution. Based on the selected feature subset, the weighted context feature vector is subjected to dimensionality reduction to obtain the final context feature vector used for context inference.

Citation Information

Patent Citations

  • Deployment and control method of intelligent living room light adjustment scheme

    CN118102555A

  • Smart home lighting system based on feature recognition

    CN118632407A