Control method and device, electronic equipment and storage medium
By using sensor data and neural networks or decision -making trees model identification scenario information in the smart home system, and formulating control strategies, the problem of insufficient environmental perception and control in the smart home system has been solved, and the system's intelligent level and user experience are improved.
Patent Information
- Application Number
- CN202411467460.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Smart home systems have problems such as insufficient environmental perception capabilities, insufficient intelligence and personalized control.
By obtaining the sensor data in the target area, the current scene information is determined based on the neural network or decision tree model, and the control strategy is formulated according to the scene information to intelligently control the equipment in the target area.
It has improved the intelligent level of the smart home system, achieved more accurate and efficient environmental control, and improved the comfort and convenience of users.
Smart Images

Figure CN119356085A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of device control technology, and in particular, relates to a control method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of Internet of Things (IoT) technology, smart home systems are increasingly used in modern homes. Smart home systems connect various devices in the home through the network to achieve control, but smart home systems have some technical limitations, such as insufficient environmental perception, insufficient intelligence and personalized control, etc. Summary of the invention
[0003] The embodiments of the present application provide a control method, device, electronic device and storage medium, which can perform intelligent control through sensor data, thereby improving the intelligence level of the smart home system.
[0004] According to a first aspect of the present application, an embodiment of the present application provides a control method, including:
[0005] Obtaining sensor data collected by sensors within a target area;
[0006] determining current scene information in the target area based on the sensor data;
[0007] Determining a control strategy based on the scenario information;
[0008] The equipment in the target area is controlled based on the control strategy.
[0009] In some embodiments, determining current scene information in the target area based on the sensor data includes:
[0010] The sensor data is input into a pre-established neural network model to determine current scene information in the target area.
[0011] In some embodiments, the method further comprises:
[0012] Acquire first sample sensor data and corresponding first sample scene information;
[0013] Forming a first training set and a first test set based on the first sample sensor data and the corresponding first sample scene information;
[0014] Based on the first training set, the initial neural network model is trained using a back propagation algorithm to obtain a trained neural network model;
[0015] Testing the trained neural network model based on the first test set;
[0016] When the test result meets the requirements, the trained neural network model is determined as the neural network model.
[0017] In some embodiments, determining current scene information in the target area based on the sensor data includes:
[0018] The sensor data is input into a pre-established decision tree model to determine current scene information in the target area.
[0019] In some embodiments, the method further comprises:
[0020] Acquire second sample sensor data and corresponding second sample scene information;
[0021] forming a second training set and a second test set based on the second sample sensor data and the corresponding second sample scene information;
[0022] Recursively splitting the second training set to obtain a trained decision tree;
[0023] The trained decision tree model is evaluated based on the second test set, and if the evaluation result passes, the trained decision tree is determined as the decision tree model.
[0024] In some embodiments, the method further comprises:
[0025] Provides a custom interface;
[0026] Acquiring scene information and a control strategy corresponding to the scene information based on the custom interface;
[0027] A corresponding relationship between the scene information and the control strategy is established, and the corresponding relationship is stored.
[0028] In some embodiments, determining a control strategy based on the scene information includes:
[0029] Based on matching the scene information with the scene information in the corresponding relationship, a control strategy corresponding to the scene information is obtained.
[0030] According to a second aspect of the present application, an embodiment of the present application provides a control device, including:
[0031] An acquisition module, used to acquire sensor data collected by sensors in a target area;
[0032] A first determination module, configured to determine current scene information in the target area based on the sensor data;
[0033] A second determination module, used to determine a control strategy based on the scenario information;
[0034] A control module is used to control the equipment in the target area based on the control strategy.
[0035] According to the third aspect of the present application, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the methods described above when executing the computer program.
[0036] According to a fourth aspect of the present application, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.
[0037] According to the fifth aspect of the present application, the present application provides a device, including: the electronic device described above and hardware interfaces corresponding to multiple communication protocols, each hardware interface is communicatively connected to the electronic device, each hardware interface can identify data frames corresponding to the communication protocol, and each hardware interface is used to communicate with external devices.
[0038] According to the sixth aspect of the present application, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the electronic device to execute any of the methods described above.
[0039] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0040] The control method provided in the embodiment of the present application can obtain sensor data collected by sensors in a target area; determine current scene information in the target area based on the sensor data; determine a control strategy based on the scene information; and control the equipment in the target area based on the control strategy. The method can obtain sensor data in the target area, thereby determining scene information, and perform intelligent control through the scene information, thereby improving the intelligence level of the smart home system.
[0041] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 A schematic diagram of a control method for implementing the present application;
[0044] Figure 2 A schematic diagram of another control method for implementing the present application;
[0045] Figure 3 A schematic diagram of the structure of a control device provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0049] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0050] As used in the specification of this application and the appended claims, the term "if" can be interpreted as "when" or "once" or "in response to determining" or "in response to being controlled to" depending on the context. Similarly, the phrases "if it is determined" or "if it is controlled to" can be interpreted as meaning "once it is determined" or "in response to determining" or "once it is controlled to" or "in response to being controlled to" depending on the context.
[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0052] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0053] Based on the technical problems of the related art, the embodiment of the present application provides a control method, which can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. It should be noted that the embodiment of the present application does not impose any restrictions on the specific type of electronic device, and the electronic device can be a processor of a control system or a smart gateway.
[0054] The functions implemented by the control method provided in the embodiment of the present application can be implemented by calling program codes by a processor of an electronic device, wherein the program codes can be stored in a computer storage medium.
[0055] The following is an example of using electronic equipment as a control system. Figure 1 A schematic diagram of a control method for implementing this application is shown in FIG. Figure 1 As shown, the control method includes:
[0056] Step S101, acquiring sensor data collected by sensors in a target area.
[0057] In the embodiment of the present application, in the smart home scenario, the target area refers to a specific room (living room, bedroom, kitchen) or the entire house in the home. Sensors can be deployed in the target area to monitor the indoor environment (such as temperature, humidity, light) of the target area, the activity status of people in the target area, and home security (such as smoke and intrusion detection).
[0058] In an embodiment of the present application, the sensor can collect sensor data. As an example, the sensor includes a human infrared sensor, a light sensor, a temperature sensor, and a humidity sensor. Among them, the human infrared sensor is used to monitor the activity status of people in the target area. By detecting the infrared radiation emitted by the human body, it can capture information such as the existence and movement of the human body and generate motion data. The light sensor is used to collect the lighting data of the target area and evaluate the intensity changes of the ambient light, which is helpful to adjust the indoor lighting or perform energy-saving control. The temperature sensor is used to monitor the temperature data of the target area, reflect the temperature conditions of the environment, provide accurate data support for the temperature control system, and ensure the comfort of the environment. The humidity sensor is used to measure the humidity data of the target area and monitor the changes in the ambient humidity, which is crucial to maintaining the health and comfort of the indoor environment. Correspondingly, the sensor data may include motion data, light data, temperature data, and humidity data, which are used to monitor the environmental conditions in the target area and the activity status of the people in the target area.
[0059] In an embodiment of the present application, the sensor can be connected to the control system via wired or wireless means, so that data can be sent to the control system in real time or periodically. The control system can obtain real-time sensor data in the target area, thereby providing a basis for subsequent scene recognition, control strategy formulation and equipment control.
[0060] Step S102, determining current scene information in the target area based on the sensor data.
[0061] In the embodiment of the present application, the control system accurately depicts the current scene information of the target area by deeply analyzing the data collected from various sensors. This process not only relies on direct readings from sensors, but also integrates advanced scene recognition algorithms to fully understand and interpret the environment and dynamics of the target area.
[0062] First, the control system will take into account environmental conditions, such as temperature and humidity, which are crucial to assessing the comfort of the environment. For example, too high a temperature may mean that the air conditioning or ventilation system needs to be adjusted to maintain a suitable indoor temperature; while changes in humidity may affect the comfort of the occupants and the preservation of indoor items.
[0063] Secondly, through devices such as human infrared sensors, the control system can track the activities of people in the target area in real time, including the entry and exit of people, the number of people in the activity, etc. This function not only helps to improve security, but also provides more personalized services for smart home or smart office systems, such as automatically adjusting lighting or entertainment systems according to the activities of people.
[0064] Furthermore, the control system uses scene recognition algorithms to conduct in-depth analysis of sensor data to infer more detailed and specific scene information. This algorithm can comprehensively consider the data of multiple sensors, such as light intensity, temperature, and humidity, as well as the correlation and change trends between them, to make more accurate scene judgments. For example, in an "overheated and dim" scene, the control system may automatically start the air conditioner to reduce the temperature and adjust the lighting system to increase the light to create a more comfortable environment.
[0065] In the embodiment of the present application, it is intended to provide users with a more intelligent and personalized service experience. Through this process, the control system can perceive and respond to changes in the target area in real time to ensure that the environment is always in the best state.
[0066] Step S103: determining a control strategy based on the scene information.
[0067] In an embodiment of the present application, a correspondence between multiple scene information and corresponding control strategies is stored in the control system. This correspondence is based on the analysis of historical data of the target area, user preferences, and best practices, and is intended to ensure that appropriate and effective responses can be provided in different scenarios. In this way, after determining the current scene, the control system determines the corresponding control strategy. As an example, the control strategy may include adjusting environmental parameters (such as temperature, humidity, and light), triggering alarms or notifications. Specifically, for the "overheated and dim" scene, the control system will immediately execute the corresponding control strategy, such as turning on the air conditioner to lower the indoor temperature, and turning on the lights at the same time to increase the light. Such a strategy not only improves the comfort of the environment, but also ensures a good visual experience for the user.
[0068] In addition, the control strategy may also include the ability to trigger alarms or notifications. For example, when abnormal environmental conditions are detected (such as too high or too low temperature, too much humidity, etc.), the control system may automatically send an alarm notification to relevant personnel so that they can take timely measures. Similarly, if the system detects that someone enters the target area without authorization, a security alarm can also be triggered.
[0069] In the embodiments of the present application, by accurately matching scene information with control strategies, the control system can adjust environmental parameters in real time, trigger alarms or notifications, and other functions, thereby providing users with a more intelligent, comfortable, and safe experience.
[0070] Step S104: Control the equipment in the target area based on the control strategy.
[0071] In the embodiment of the present application, the control system directly controls the equipment in the target area according to the determined control strategy, which may include adjusting the temperature setting of the air conditioner, turning on and off the lights, triggering the alarm system, etc.
[0072] In the embodiments of the present application, the control system usually communicates with the device via wired or wireless means and sends control instructions to perform the required actions. These instructions may include turning the device on or off, adjusting the setting parameters of the device, etc.
[0073] The control method provided in the embodiment of the present application obtains sensor data collected by sensors in the target area; determines the current scene information in the target area based on the sensor data; determines a control strategy based on the scene information; and controls the equipment in the target area based on the control strategy. The current scene information of the target area can be accurately depicted through sensor data, and intelligent control is performed based on the scene information, thereby improving the intelligence level of the smart home system.
[0074] According to this application, by integrating more types and precision sensors and applying advanced algorithms to deeply analyze and process sensor data, comprehensive perception and intelligent analysis of the home environment can be achieved. In this way, the control system can make smarter decisions based on the real-time environment, such as automatically adjusting the air-conditioning temperature, turning on and off lights, etc.
[0075] According to an embodiment of the present application, the current scene information is inferred from the data collected by the sensor in the target area. In some embodiments, step S102, determining the current scene information in the target area based on the sensor data, includes:
[0076] Step S1021, input the sensor data into a pre-established neural network model to determine the current scene information in the target area.
[0077] In this step, before inputting the sensor data into the neural network model, the sensor data can be preprocessed, such as denoising, normalization, etc., to improve the accuracy and efficiency of the model.
[0078] In this step, the neural network model takes sensor data as input, which contains detailed information about the environment in the target area, such as temperature, humidity, light intensity, etc. The task of the neural network model is to automatically extract features that are critical to distinguishing different scenes from these seemingly chaotic data. These features may be a specific combination of certain environmental parameters, or their trends over time, or even complex relationships between these parameters. The neural network, through its internal neurons and connection structure, is able to learn these features and associate them with different scenes in the target area.
[0079] Once the neural network model identifies the current scene information of the target area, this information will serve as the basis for the formulation of the control strategy in the subsequent step S103. The control system will select the most appropriate strategy from the preset control strategy library based on this scene information, or generate a new strategy through real-time calculation to achieve intelligent control of the equipment in the target area.
[0080] For example, in a smart home environment, sensors may include temperature sensors, humidity sensors, light sensors, etc., which will collect environmental data in the target area in real time. Then, these data will be input into the pre-established neural network model, which can determine the current scene information of the target area through data analysis and processing, such as "daytime work mode", "night rest mode", "guest visit mode", etc.
[0081] Based on this scene information, the smart home system can formulate a control strategy that better meets user needs, such as adjusting light brightness, temperature, humidity, etc., to provide users with a more comfortable and convenient living environment. At the same time, this intelligent control method also greatly improves the efficiency and accuracy of the home system, making home life more intelligent and humane.
[0082] In these embodiments, the neural network model can accurately identify sensor data and determine the current scene information of the target area, which can directly affect the effectiveness of subsequent control strategies and user experience.
[0083] According to this application, in order to build a neural network model that can accurately determine scene information based on sensor data, training and verification steps are required. The following are the specific steps:
[0084] In some embodiments, the control method further comprises:
[0085] Step S105, obtaining first sample sensor data and corresponding first sample scene information.
[0086] In this step, historical data can be extracted from the smart home system. In daily operation, the smart home system continuously collects data from various sensors and annotates the collected sensor data with corresponding scene information based on the logs of the smart home system or user feedback. For example, when the temperature sensor data shows that the indoor temperature has risen and the human motion sensor detects human activity, it can be annotated as a scene of "someone is at home and the room is hotter". After cleaning and sorting, these data can be used as the first sample sensor data and the corresponding first sample scene information for training the neural network model.
[0087] Step S106: forming a first training set and a first test set based on the first sample sensor data and the corresponding first sample scene information.
[0088] In this step, the sample data is divided into a training set and a test set for model training and performance evaluation. The first training set is used to train the neural network model, usually accounting for a larger proportion of the total samples (such as 70%-80%), and the first test set is used to verify the performance of the model to ensure that the model can accurately identify the scene information in the new data, usually accounting for a smaller proportion of the total samples (such as 20%-30%).
[0089] Step S107, training the initial neural network model using a back propagation algorithm based on the first training set to obtain a trained neural network model.
[0090] In this step, the neural network model is trained to accurately identify the association between sensor data and scene information. Specifically, a suitable neural network architecture (initial neural network model) is selected as the starting point. By calculating the error between the model output and the real scene information, the weights and biases within the model are gradually adjusted to reduce the error. The above process is repeated until the performance of the model on the training set reaches the preset standard or no longer improves significantly.
[0091] Step S108, testing the trained neural network model based on the first test set.
[0092] In this step, by testing the trained neural network model based on the first test set, you can evaluate the performance of the model on new data to ensure that the model has good generalization ability. You can also compare the model output with the real scene information and calculate performance indicators such as accuracy and recall to quantify the performance of the model. These indicators will help determine whether the model has good generalization ability, that is, whether it can accurately predict unseen data.
[0093] Step S109, when the test result meets the requirements, the trained neural network model is determined as the neural network model.
[0094] In this step, if the test results show that the model performance meets the preset requirements (such as accuracy higher than a certain threshold, for example, 85%), the model is determined as the final neural network model. If the test results are not ideal, it may be necessary to adjust the model architecture, increase training data or improve the training strategy, and retrain and verify.
[0095] In these embodiments, through the steps of training and verification, it can be ensured that the neural network model can accurately identify the sensor data in the smart home system and output the corresponding scene information, providing strong support for the subsequent control strategy formulation.
[0096] According to the present application, in addition to using a neural network model, a decision tree model may also be used to determine current scene information in a target area based on sensor data.
[0097] In some embodiments, step S102, determining current scene information in the target area based on sensor data, includes:
[0098] Step S1022, input the sensor data into a pre-established decision tree model to determine the current scene information in the target area.
[0099] In this step, the pre-established decision tree model can accurately identify the sensor data collected from the target area and determine the current scene information.
[0100] Specifically, the steps include:
[0101] Data preprocessing: Before inputting the data into the decision tree model, the sensor data may need to be preprocessed to ensure that the data format is consistent with the model input requirements and to remove noise and redundant information.
[0102] Model selection: Select a pre-trained decision tree model that can process sensor data and output scene information. The advantage of the decision tree model is its intuitiveness and easy-to-understand decision path.
[0103] Data input: The preprocessed sensor data is passed as input to the decision tree model.
[0104] Model reasoning: The decision tree model makes decisions based on the input data, along the nodes and branches in the tree structure, and finally reaches a leaf node, which corresponds to the current scene information.
[0105] In these embodiments, through the above steps, the control system can use the decision tree model to accurately identify the current scene information based on the sensor data, providing strong support for the subsequent control strategy formulation. Compared with the neural network model, the decision tree model has advantages in interpretability and intuitiveness, and is easier for users to understand and accept.
[0106] According to the embodiment of the present application, in order to build a decision tree model that can accurately determine scene information based on sensor data, training and evaluation steps are required. The following specific steps:
[0107] Step S100, obtaining second sample sensor data and corresponding second sample scene information.
[0108] In this step, historical data can be extracted from the smart home system. In daily operation, the smart home system continuously collects data from various sensors and annotates the collected sensor data with corresponding scene information based on the logs of the smart home system or user feedback. For example, when the temperature sensor data shows that the indoor temperature rises and the human motion sensor detects human activity, it can be annotated as a scene of "someone is at home and the room is hotter". After cleaning and sorting, these data can be used as the second sample sensor data and the corresponding second sample scene information of the decision tree model.
[0109] Step S110: forming a second training set and a second test set based on the second sample sensor data and the corresponding second sample scene information.
[0110] In this step, the sample data is divided into a training set and a test set for model training and performance evaluation. The second training set is used to train the neural network model, usually accounting for a larger proportion of the total samples (such as 70%-80%), and the second test set is used to verify the performance of the model to ensure that the model can accurately identify the scene information in the new data, usually accounting for a smaller proportion of the total samples (such as 20%-30%).
[0111] Step S120, recursively split the second training set to obtain a trained decision tree.
[0112] In this step, a decision tree model that can accurately classify the sensor data is built by recursively splitting the training set.
[0113] Step S120, recursively splitting the second training set to obtain a trained decision tree, specifically includes the following steps:
[0114] Select the best feature: At each node in the training set, select a sensor data feature that can best distinguish different scene information as the splitting criterion.
[0115] Generate child nodes: Split the training set into two or more subsets based on the selected feature values, and generate a new child node for each subset.
[0116] Recursive training: Repeat the above process for each child node until the stopping condition is met (such as the number of samples in the subset is less than the preset threshold, the depth of the decision tree reaches the preset limit, etc.).
[0117] Generate leaf nodes: When the recursive process ends, each leaf node will correspond to a specific scene information.
[0118] Step S130, evaluating the trained decision tree model based on the second test set, and if the evaluation result passes, determining the trained decision tree as the decision tree model.
[0119] In this step, the performance of the trained decision tree model on new data is evaluated to ensure that the model has good generalization ability. As an example, the data in the second test set is used as input to run the trained decision tree model. Compare the model output with the real scene information and calculate performance indicators such as accuracy and recall. If the evaluation results show that the model performance meets the preset requirements (such as the accuracy is higher than a certain threshold, for example, 85%), the trained decision tree is determined as the final decision tree model; otherwise, it may be necessary to adjust the model parameters (such as maximum depth, minimum number of samples, etc.) and retrain and evaluate.
[0120] In these embodiments, through the steps of training and evaluation, it can be ensured that the decision tree model can accurately identify the sensor data in the smart home system and output the corresponding scene information, providing strong support for the subsequent control strategy formulation. Compared with the neural network model, the decision tree model has advantages in interpretability and intuitiveness, and is easier for users to understand and accept.
[0121] According to the present application, in the control method of the smart home system, a custom interface is introduced to allow users to set scene information and its corresponding control strategy according to personal preferences and needs, thereby greatly enhancing the flexibility of the system and user experience. The following are the specific steps:
[0122] In some embodiments, the control method further comprises:
[0123] Step S140, providing a customized interface.
[0124] In this step, an intuitive and easy-to-use platform is provided for users so that they can define the scene information of the smart home according to their living habits, preferences or specific needs. As an example, the interface may be a graphical user interface (GUI) accessed through a touch screen, computer or mobile device. The interface should include options for creating new scenes, editing existing scenes, and setting scene trigger conditions and corresponding control strategies.
[0125] Step S150, obtaining scene information and a control strategy corresponding to the scene information based on the custom interface.
[0126] In this step, through the interaction between the user and the custom interface, the user-defined scene information (such as "home mode", "away mode", etc.) and the control strategies that smart home devices should implement in these scenes (such as light brightness, air conditioning temperature, curtain status, etc.) are collected.
[0127] In this step, users can select or enter the scene name on the interface, and then specify a series of control strategies for each scene. These strategies may include the on / off state of the device, adjustment parameters (such as temperature, brightness), etc. The control system should be able to capture and store these user inputs.
[0128] Step S160, establishing a correspondence between the scene information and the control strategy, and storing the correspondence.
[0129] In this step, a clear correspondence is established between the user-defined scenario information and the control strategy, so that when the corresponding scenario is triggered later, the control system can automatically execute the preset control strategy.
[0130] In this step, a database or data structure is created inside the control system to store these correspondences. Whenever the user adds or modifies a scenario and its control strategy through the custom interface, the control system updates this database. In this way, when sensor data or user instructions trigger a scenario, the system can quickly find and execute the corresponding control strategy.
[0131] In these embodiments, through the above steps, the smart home system can provide users with a more personalized and intelligent control experience. Users can define and adjust scene information and its corresponding control strategy according to their needs, thereby achieving more accurate and efficient smart home control.
[0132] According to the present application, in the control process of the smart home system, it is crucial to formulate and execute corresponding control strategies by accurately identifying scene information.
[0133] In some embodiments, step S103, determining a control strategy based on scene information, includes:
[0134] Step S1031, matching the scene information with the scene information in the corresponding relationship to obtain a control strategy corresponding to the scene information.
[0135] In this step, the control calculates the similarity between the features of the current scene information and the features of each stored scene information. The similarity can be calculated by using Euclidean distance, cosine similarity, Manhattan distance, etc.
[0136] In this step, before performing the similarity calculation, the control system sets a similarity threshold. This threshold determines the standard by which the system considers two scene information to be similar enough to match. Once the similarity between the current scene information and each stored scene information is calculated, the control system compares these similarity values with the set threshold. If the similarity between a stored scene information and the current scene information exceeds the threshold, the system considers them to match and performs the corresponding operation based on the control strategy corresponding to the scene information. Conversely, if the similarity between all stored scene information and the current scene information does not exceed the threshold, the system may consider that there is no matching scene information and take appropriate measures, such as maintaining the current state, triggering a warning, or requesting user input.
[0137] In these embodiments, through this matching process, the control system can accurately execute corresponding control strategies according to the current scene information, thereby providing users with a more comfortable, convenient and intelligent living environment.
[0138] Based on the above embodiments, existing smart home devices usually use their own communication protocols, such as CAN (Controller Area Network), Bluetooth, Zigbee, etc. Due to the different communication protocols, it is difficult for these devices to interoperate with each other, which limits the scalability and compatibility of the smart home system. Users often need multiple gateway devices to manage devices with different protocols, which increases the complexity and cost of the system.
[0139] Figure 2 A schematic diagram of the connection structure of the intelligent gateway provided in the embodiment of the present application is shown in FIG. Figure 2 As shown, the intelligent gateway has built-in conversion modules for multiple communication protocols, which can support multiple smart home device communication protocols such as CAN (Controller Area Network), Bluetooth, Zigbee, etc. As an example, the conversion module can be a programmable communication interface chip, which has a microcontroller (MCU) or communication interface module with wide compatibility to ensure support for common communication protocols such as CAN, Bluetooth, Zigbee, etc. Through the conversion module of the communication protocol of the intelligent gateway, devices with different communication protocols can be seamlessly connected to the intelligent gateway system to achieve interoperability between devices and system scalability. In addition, users do not need to purchase multiple gateway devices, reducing the complexity and cost of the system. Taking into account the new communication protocols that may appear in the future, the intelligent gateway is designed with reserved hardware interfaces and software interfaces to facilitate the subsequent addition of support for new protocols.
[0140] At the software level, the system has built-in communication protocol stacks and drivers that can identify and parse data frames of different communication protocols to ensure smooth communication with various smart home devices. The software design has protocol conversion capabilities, which can convert and transmit data between different protocols to achieve seamless connection between devices.
[0141] In these embodiments, by supporting multiple communication protocols, the present invention enables smart home devices of different brands to be seamlessly connected to the system, thereby improving the compatibility and scalability of the system.
[0142] Many devices in existing smart home systems can only be controlled by preset timing or simple sensor triggers, lacking comprehensive perception and intelligent analysis capabilities of the home environment. For example, some systems can only judge whether someone is present based on simple infrared sensors, but cannot comprehensively consider multiple environmental factors such as light, temperature, humidity, etc. to make smarter decisions.
[0143] According to this application, the smart gateway combines multiple sensors, such as light sensors, temperature sensors, humidity sensors, etc., to monitor multiple factors of the home environment in real time. By processing and analyzing sensor data through intelligent algorithms, the system can achieve comprehensive perception and intelligent judgment of the home environment.
[0144] For example, the system can automatically adjust curtains and air conditioning according to changes in light and temperature to provide a more comfortable living environment.
[0145] More specifically, the sensor module includes a human infrared sensor, a light sensor, a temperature sensor, and a humidity sensor, wherein the human infrared sensor is used to detect human activities, such as entering and leaving the room. The light sensor is used to monitor the indoor light intensity for adjusting the lighting. The temperature sensor is used to measure the indoor temperature and assist in adjusting the air conditioner or heater. The humidity sensor is used to monitor the indoor humidity to ensure a comfortable environment. Each sensor is connected to the intelligent gateway system through an analog or digital interface to collect home environment data in real time. The collected data is digitized and filtered in the data processing unit of the intelligent gateway system to remove noise and improve data accuracy. The processed data is transmitted to the intelligent algorithm module for further analysis.
[0146] Based on the results of environmental perception and intelligent algorithms, the gateway system can automatically adjust the status of home devices to achieve intelligent home management. For example, in "away mode", the system will automatically turn off the lights and adjust the temperature to reduce energy consumption and ensure safety; in "home mode", the system will automatically turn on the lights and play music to create a comfortable atmosphere for returning home.
[0147] In the embodiments of the present application, most existing smart home systems can only realize basic remote control and switching of preset scenes, and lack intelligent and personalized control capabilities based on user behavior patterns and habits. This means that users need to frequently adjust the equipment manually and cannot truly enjoy the convenience brought by smart homes.
[0148] According to this application, the intelligent gateway system can achieve compatible support for multiple communication protocols, and combine sensors and intelligent algorithms to achieve intelligent perception of the home environment and personalized scene control.
[0149] In some embodiments, the intelligent gateway system of the present invention introduces a learning mechanism for user behavior patterns and habits, and can perform intelligent control based on user usage habits.
[0150] The system analyzes and predicts user behavior through machine learning algorithms and automatically adjusts device settings to meet users' personalized needs.
[0151] Users can also customize scene settings through mobile phone apps and other interfaces, such as "home mode" and "leaving mode", to achieve a more convenient and personalized control experience.
[0152] The following will introduce the two forms separately in detail.
[0153] Neural Networks:
[0154] Architecture: A multi-layer perceptron (MLP) neural network is used, which includes an input layer, multiple hidden layers, and an output layer. The input layer receives sensor data, and the output layer provides classification results of home scenes.
[0155] Feature extraction: Extract key features from sensor data, such as ambient light intensity, temperature changes, etc.
[0156] Dataset: Collect a large amount of sensor data and corresponding scene labels to build training sets and test sets.
[0157] Training: Use the back-propagation algorithm to train the neural network, adjust the weights and reduce the loss by minimizing the loss function (such as mean square error). Adjust the hyperparameters through cross-validation to prevent overfitting.
[0158] Evaluation: Evaluate model performance on the test set to ensure that indicators such as accuracy and recall meet the standards and ensure the generalization ability of the model.
[0159] Decision Tree:
[0160] Architecture: Choose a decision tree model based on information gain or Gini coefficient.
[0161] Feature selection: Same as neural network, extract features from sensor data.
[0162] Dataset: Use the same training and testing sets as the neural network.
[0163] Training: Recursively split the dataset, build a decision tree, and select the optimal features for segmentation until the home scene corresponding to the leaf node has the maximum information gain or the minimum Gini impurity.
[0164] Evaluation: Evaluate the performance of the decision tree on the test set to ensure that it can accurately classify home scenes.
[0165] Improve user experience: By introducing intelligent and personalized control mechanisms, the present invention can automatically adjust according to the user's behavior patterns and habits, providing a more convenient and personalized control experience.
[0166] In the embodiment of the present application, based on the sensor data and the trained neural network or decision tree model, the home scene is identified in real time. According to the identified scene, the control module automatically executes the preset control strategy. For example, in the "away mode", the lights and non-essential appliances are turned off, and in the "home mode", the door locks are unlocked, the lights and temperature are adjusted.
[0167] Users can customize scenarios and control strategies through the mobile app or web interface, such as setting device status for specific time periods or conditions.
[0168] Users use mobile apps to remotely monitor and control home devices, view sensor data, and manually adjust device status.
[0169] According to the present application, through the above implementation scheme, the intelligent gateway system can achieve compatible support for multiple communication protocols, combine sensors and intelligent algorithms to achieve intelligent perception of the home environment, provide personalized scene control, and greatly improve the intelligence level and user experience of the smart home system.
[0170] In summary, the smart gateway system of the present invention provides a more efficient, compatible and intelligent smart home solution for modern families by solving the technical limitations in the current smart home system.
[0171] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0172] According to the aforementioned embodiments, the embodiments of the present application provide a control device, and the modules included in the device and the units included in the modules can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing) or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.
[0173] The present application embodiment provides a control device, Figure 3 A schematic diagram of the structure of a control device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the control device 400 includes:
[0174] An acquisition module 401 is used to acquire sensor data collected by sensors in a target area;
[0175] A first determination module 402, configured to determine current scene information in the target area based on the sensor data;
[0176] A second determination module 403, configured to determine a control strategy based on the scenario information;
[0177] The control module 404 is used to control the equipment in the target area based on the control strategy.
[0178] In some embodiments, determining current scene information in the target area based on the sensor data includes:
[0179] The sensor data is input into a pre-established neural network model to determine current scene information in the target area.
[0180] In some embodiments, the control device 400 is further configured to:
[0181] Acquire first sample sensor data and corresponding first sample scene information;
[0182] Forming a first training set and a first test set based on the first sample sensor data and the corresponding first sample scene information;
[0183] Based on the first training set, the initial neural network model is trained using a back propagation algorithm to obtain a trained neural network model;
[0184] Testing the trained neural network model based on the first test set;
[0185] When the test result meets the requirements, the trained neural network model is determined as the neural network model.
[0186] In some embodiments, determining current scene information in the target area based on the sensor data includes:
[0187] The sensor data is input into a pre-established decision tree model to determine current scene information in the target area.
[0188] In some embodiments, the method further comprises:
[0189] Acquire second sample sensor data and corresponding second sample scene information;
[0190] forming a second training set and a second test set based on the second sample sensor data and the corresponding second sample scene information;
[0191] Recursively splitting the second training set to obtain a trained decision tree;
[0192] The trained decision tree model is evaluated based on the second test set, and if the evaluation result passes, the trained decision tree is determined as the decision tree model.
[0193] In some embodiments, the control device 400 is further configured to:
[0194] Provides a custom interface;
[0195] Acquiring scene information and a control strategy corresponding to the scene information based on the custom interface;
[0196] A corresponding relationship between the scene information and the control strategy is established, and the corresponding relationship is stored.
[0197] In some embodiments, determining a control strategy based on the scene information includes:
[0198] Based on matching the scene information with the scene information in the corresponding relationship, a control strategy corresponding to the scene information is obtained.
[0199] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0200] in addition, Figure 3 The control device shown may be a software unit, a hardware unit, or a combination of software and hardware units built into an existing electronic device, or may be integrated into the electronic device as an independent pendant, or may exist as an independent terminal device.
[0201] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0202] Figure 4This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 3 of this embodiment may include: at least one processor 30 ( Figure 4 Only one processor 30 is shown in the figure), a memory 31, and a computer program 32 stored in the memory 31 and executable on at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the above-mentioned method embodiments are implemented. For example, Figure 1 Steps S101 to S104 in the illustrated embodiment. Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 3 Functions of modules 401 to 404 are shown.
[0203] Exemplarily, the computer program 32 may be divided into one or more modules / units, one or more modules / units are stored in the memory 31, and are executed by the processor 30 to complete the present application. One or more modules / units may be a series of computer program 32 instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3.
[0204] The present application provides a device, including: the electronic device described above and hardware interfaces corresponding to multiple communication protocols, each hardware interface is communicatively connected to the electronic device, each hardware interface can identify data frames corresponding to the communication protocol, and each hardware interface is used to communicate with external devices.
[0205] In the embodiments of the present application, the communication protocols may include: CAN (Controller Area Network), Bluetooth, Zigbee, etc.
[0206] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program 32. When the computer program 32 is executed by the processor 30, the steps in the above-mentioned method embodiments can be implemented.
[0207] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0208] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. According to this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 32, and the computer program 32 can be stored in a computer-readable storage medium, and the computer program 32 can implement the steps of the above-mentioned various method embodiments when executed by the processor 30. Among them, the computer program 32 includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the terminal, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0209] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0210] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0211] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0212] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0213] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A control method, characterized in that: include: Obtaining sensor data collected by sensors within a target area; determining current scene information in the target area based on the sensor data; Determining a control strategy based on the scenario information; The equipment in the target area is controlled based on the control strategy.
2. The method according to claim 1, characterized in that: The determining the current scene information in the target area based on the sensor data includes: The sensor data is input into a pre-established neural network model to determine current scene information in the target area.
3. The method according to claim 2, characterized in that The method further comprises: Acquire first sample sensor data and corresponding first sample scene information; Forming a first training set and a first test set based on the first sample sensor data and the corresponding first sample scene information; Based on the first training set, the initial neural network model is trained using a back propagation algorithm to obtain a trained neural network model; Testing the trained neural network model based on the first test set; When the test result meets the requirements, the trained neural network model is determined as the neural network model.
4. The method according to claim 1, characterized in that The determining the current scene information in the target area based on the sensor data includes: The sensor data is input into a pre-established decision tree model to determine current scene information in the target area.
5. The method according to claim 4, characterized in that The method further comprises: Acquire second sample sensor data and corresponding second sample scene information; forming a second training set and a second test set based on the second sample sensor data and the corresponding second sample scene information; Recursively splitting the second training set to obtain a trained decision tree; The trained decision tree model is evaluated based on the second test set, and if the evaluation result passes, the trained decision tree is determined as the decision tree model.
6. The method according to claim 1, characterized in that The method further comprises: Provides a custom interface; Acquiring scene information and a control strategy corresponding to the scene information based on the custom interface; A corresponding relationship between the scene information and the control strategy is established, and the corresponding relationship is stored.
7. The method according to claim 6, characterized in that The determining of the control strategy based on the scene information includes: Based on matching the scene information with the scene information in the corresponding relationship, a control strategy corresponding to the scene information is obtained.
8. A control device, characterized in that: include: An acquisition module, used to acquire sensor data collected by sensors in a target area; A first determination module, configured to determine current scene information in the target area based on the sensor data; A second determination module, used to determine a control strategy based on the scenario information; A control module is used to control the equipment in the target area based on the control strategy.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A device, characterized in that: include: The electronic device described in claim 9 and the hardware interfaces corresponding to the multiple communication protocols, each hardware interface is communicatively connected to the electronic device, each hardware interface can identify the data frame of the corresponding communication protocol, and each hardware interface is used to communicate with external devices.
11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Decision tree model generation method and data recommendation method based on decision tree model
CN114418035A
Individual-based smart home scene control method and apparatus, and electronic device
CN116449718A
Intelligent debugging method and system for adaptive scene of combined atmosphere lamp
CN117241445A
Intelligent home environment sensing switch control system
CN118131639A
Terminal equipment-oriented intelligent scene generation method and smart home system
CN118444620A