Method, system, device, medium and product for controlling smart home devices
Patent Information
- Application Number
- CN202610961799.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]然而,采用上述方案时,需要针对设备所使用的协议开发定制化的协议适配模块,开发工作量大且周期较长
在本发明实施例中,通过边缘节点,获取新接入智能家居环境的智能家居设备的说明文档,并通过对说明文档进行自然语言解析,得到设备能力描述文件;通过边缘节点,获取智能家居环境中用户历史行为数据,根据用户历史行为数据,生成用户行为画像,并发送至云端节点;通过边缘节点,获取针对智能家居环境采集的当前设备状态、当前环境数据,并将当前设备状态、当前环境数据发送至云端节点;通过云端节点,响应于获取到的用户控制意图,根据当前设备状态、当前环境数据、用户行为画像,生成第一控制策略;通过边缘节点,基于本地用户历史干预记录,对第一控制策略进行个性化调整,生成第二控制策略;其中,本地用户历史干预记录为用户对系统推荐执行的控制策略的历史手动修正操作记录;通过边缘节点,基于设备能力描述文件,将第二控制策略转换为智能家居设备能够识别的私有协议控制指令,并将私有协议控制指令发送至智能家居设备执行,实现了跨品牌设备快速接入,根据环境和用户习惯调整控制策略,减少人工干预。
Smart Images

Figure CN123010462A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence in the new-generation information technology industry, and particularly relates to a method, system, device, medium and product for smart home device control. Background Art
[0002] With the rapid development of artificial intelligence technology in the field of smart home, there are many smart home devices in people's daily lives. At present, the smart devices in a user's home may come from multiple different brands. For example, lighting devices, air conditioning devices, security devices and the like may be products from different manufacturers respectively. However, smart home devices of different brands generally adopt their respective communication protocols and interaction standards, which causes great difficulties in interconnection and intercommunication between the devices. Users need to use the application programs provided by the respective brands to control devices of different brands separately, making it difficult to realize collaborative work between the devices.
[0003] In the prior art, a third-party platform can generally be used to integrate devices of different brands in the form of plug-ins. Alternatively, a central gateway is used to convert different communication protocols, and fixed preset scenario linkage rules, such as device action sequences under an "away-from-home mode" or a "home-return mode", are preset to realize linkage control of multiple devices.
[0004] However, when adopting the above solutions, it is necessary to develop a customized protocol adaptation module for the protocol used by the device, which leads to large development workload and long cycle. When the protocol version of the device manufacturer is updated, the developed adaptation module may need to be re-adapted to continue to be used, resulting in high expansion and maintenance costs of the system. Secondly, the device linkage control relies on preset rules manually configured by the user, and can only execute a fixed control strategy according to the conditions and actions predefined by the user. When the user's habits change, the user needs to modify the preset rules again, which makes it difficult to adapt to the dynamically changing personalized usage needs of the user. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a method, system, device, medium and product for smart home device control that overcomes the above problems or at least partially solves the above problems, including: In a first aspect, the present invention provides a method for smart home device control, which is applied to a collaborative control system. The collaborative control system includes a cloud node, an edge node, and a smart home device, the edge node is communicatively connected to the cloud node and the smart home device respectively, and the method comprises: acquiring, by the edge node, the specification document of a smart home device newly accessed to the smart home environment, and performing natural language parsing on the specification document to obtain a device capability description file; The edge node acquires historical user behavior data in the smart home environment, generates a user behavior profile based on the historical user behavior data, and sends it to the cloud node. The edge node acquires the current device status and current environment data collected for the smart home environment, and sends the current device status and current environment data to the cloud node. Through the cloud node, in response to the acquired user control intent, a first control strategy is generated based on the current device status, current environmental data, and user behavior profile; Based on the local user's historical intervention records, the first control strategy is personalized and a second control strategy is generated through the edge node; wherein, the local user's historical intervention records are the user's historical manual correction operation records of the control strategy recommended by the system. Through the edge node, based on the device capability description file, the second control strategy is converted into a private protocol control command that the smart home device can recognize, and the private protocol control command is sent to the smart home device for execution.
[0006] Optionally, the device capability description file includes a device identifier and its corresponding function name and parameter boundary values.
[0007] Optionally, after obtaining the documentation for the newly connected smart home devices in the smart home environment, the method further includes: obtaining physical constraint information of the devices by performing natural language parsing on the documentation, and generating an action constraint mask based on the physical constraint information; The first control policy is generated based on the current device status, current environment data, and user behavior profile, including: generating the first control policy based on the current device status, current environment data, user behavior profile, and the action constraint mask.
[0008] Optionally, the physical constraint information includes any one or more of the following: device frequency conversion start-up delay, temperature regulation lower limit.
[0009] Optionally, generating a first control strategy based on the current device status, current environmental data, and user behavior profile includes: Through the reinforcement learning agent of the cloud node, a state space is constructed based on the current device state, current environment data, and user behavior profile, and an action space is constructed based on action combinations; Based on the reward function, a target action combination is determined from the action space as the first control strategy.
[0010] Optionally, the reward function includes a comfort sub-function, an energy efficiency sub-function, and a response speed sub-function; based on the reward function, a target action combination is determined from the action space as a first control strategy, including: Based on the comfort sub-function, energy efficiency sub-function, and response speed sub-function, the comfort score, energy efficiency score, and response speed score of multiple candidate action combinations are determined from the action space. The comfort score, energy efficiency score, and response speed score are then weighted and summed to obtain a comprehensive score. The target action combination is determined based on the comprehensive score and used as the first control strategy.
[0011] Optionally, before weighting and summing the comfort score, energy efficiency score, and response speed score to obtain a comprehensive score, the method further includes: Obtain the judgment matrix; wherein the judgment matrix is used to characterize the importance comparison relationship between scores; Based on the judgment matrix, the initial weights of the comfort score, energy efficiency score, and response speed score are determined, and the initial weights are corrected according to the energy efficiency level of the smart home device to obtain the final weights of the comfort score, energy efficiency score, and response speed score.
[0012] Optionally, the initial weights are adjusted based on the energy efficiency rating of the smart home devices, including: If the energy efficiency level of the smart home device is greater than the preset level, the initial weight of the comfort score is increased; if the energy efficiency level of the smart home device is less than or equal to the preset level, the initial weight of the energy efficiency score is increased.
[0013] Optionally, the comfort score is non-linearly correlated with the duration of continuous uninterrupted use by the user, and the comfort sub-function is a Sigmoid function.
[0014] Optionally, based on local user historical intervention records, the first control policy is personalized to generate a second control policy, including: Based on local user historical intervention records, the personalized offset value corresponding to the action parameter in the first control strategy is determined, and the personalized offset value is weighted and fused with the corresponding action parameter in the first control strategy to obtain the second control strategy.
[0015] Optionally, after sending the private protocol control command to the smart home device for execution, the method further includes: The edge nodes are used to obtain execution feedback and user intervention behavior feedback, and the local user historical intervention records are updated based on the execution feedback and user intervention behavior feedback.
[0016] Secondly, the present invention provides a collaborative control system, which includes a cloud node, an edge node, and a smart home device, wherein the edge node is communicatively connected to the cloud node and the smart home device respectively; The edge nodes are used for: Obtain the instruction manuals for newly connected smart home devices in the smart home environment, and obtain device capability description files by performing natural language parsing on the instruction manuals; Acquire historical user behavior data in the smart home environment, generate a user behavior profile based on the historical user behavior data, and send it to the cloud node; Acquire the current device status and current environment data collected for the smart home environment, and send the current device status and current environment data to the cloud node; The cloud node is used for: In response to the acquired user control intent, a first control strategy is generated based on the current device status, current environmental data, and user behavior profile; The edge node is also used for: Based on local user historical intervention records, the first control strategy is adjusted in a personalized manner to generate a second control strategy; wherein, the local user historical intervention records are the user's historical manual correction operation records of the control strategy recommended by the system. Based on the device capability description file, the second control strategy is converted into a private protocol control command that the smart home device can recognize, and the private protocol control command is sent to the smart home device for execution.
[0017] Thirdly, the present invention provides an electronic device including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method described above.
[0018] Fourthly, the present invention provides a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method described above.
[0019] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0020] The embodiments of the present invention have the following advantages: In this embodiment of the invention, the edge node acquires the instruction manual of the newly connected smart home device in the smart home environment, and obtains the device capability description file by parsing the instruction manual into natural language. The edge node also acquires historical user behavior data in the smart home environment, generates a user behavior profile based on the historical user behavior data, and sends it to the cloud node. Furthermore, the edge node acquires the current device status and current environment data collected for the smart home environment, and sends the current device status and current environment data to the cloud node. In response to the acquired user control intent, the cloud node generates a first control strategy based on the current device status, current environment data, and user behavior profile. Based on local user historical intervention records, the edge node personalizes the first control strategy to generate a second control strategy. The local user historical intervention records are records of users' historical manual correction operations on the system-recommended control strategy. Finally, based on the device capability description file, the edge node converts the second control strategy into a private protocol control command that the smart home device can recognize, and sends the private protocol control command to the smart home device for execution. This enables rapid access for cross-brand devices, adjusts control strategies according to the environment and user habits, and reduces manual intervention.
[0021] Specifically, this invention automatically generates device capability description files by parsing the documentation using natural language. This eliminates the need for newly connected devices to develop customized protocol adaptation modules for different brands, thereby shortening the time required for device integration and reducing system expansion and maintenance costs. By acquiring historical user behavior data to generate user behavior profiles and sending them to cloud nodes, personalized user characteristic information is provided for cloud-based decision-making. Responding to user control intentions, the cloud nodes generate a first control strategy based on the current device status, current environmental data, and user behavior profile. This allows the strategy to consider real-time device operating conditions, environmental context, and user historical habits, rather than relying on user-preset fixed rule chains, thus improving the system's dynamic adaptability.
[0022] Secondly, this invention personalizes the cloud-generated strategy based on local user historical intervention records, enabling the issued control strategy to adapt to individual user preferences without requiring users to actively configure rules. Based on the device capability description file, the second control strategy is converted into proprietary protocol control commands and issued for execution. This allows devices of different brands and protocols to receive control commands in a unified format, and the devices return feedback results after execution, forming a closed loop. Furthermore, this allows the control strategy of the smart home system to transition from static rules to dynamic adaptation with minimal user intervention, improving the compatibility, scalability, and personalized service capabilities of the smart home system in multi-brand device environments. Attached Figure Description
[0023] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of the steps of a method for controlling smart home devices provided in some embodiments of the present invention; Figure 2 This is a flowchart of the steps of a second method for controlling smart home devices provided in some embodiments of the present invention; Figure 3 This is a flowchart of the steps of a method for controlling smart home devices provided in some embodiments of the present invention. Detailed Implementation
[0025] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of the present 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.
[0026] In related technologies, users can control smart home devices from a single brand using a brand-specific application (APP). Alternatively, they can integrate multiple brands of devices as plug-ins through third-party platforms, controlling smart home devices from different brands by pre-setting rule chains.
[0027] However, different brands of smart home devices use their own proprietary protocols. When a new smart home device is connected, a customized protocol adapter needs to be developed, which typically takes 2 to 3 weeks. Furthermore, the developed adapter is prone to failure when the proprietary protocol version is updated. Secondly, the smart home systems in these technologies can only execute user-preset mechanical rules, such as "turn on the lights when the light intensity is less than 50 lux." They cannot proactively optimize based on user behavior habits (e.g., not triggering the morning mode when a user wakes up late on weekends) or environmental context (e.g., movie-watching scenarios need to consider factors such as time, user location, and device power consumption), resulting in relatively rigid scene services.
[0028] Based on this, this invention proposes to construct a cloud-edge collaborative protocol abstraction layer. This protocol abstraction layer can parse device capability description documents, such as PDF (Portable Document Format) manuals and API (Application Programming Interface) documents, using Natural Language Processing (NLP) to extract the device's function names and parameter boundaries (e.g., extracting the function name "dimming" and parameter boundary values from 0% to 100% from "dimming range: 0-100%)", and mapping the extracted results to capability description parameters in a unified format (e.g., mapping the dimming range to a unified parameter `light_intensity`).
[0029] The protocol abstraction layer can automatically generate lightweight protocol adapters based on the parsing results. By semantically modeling device capabilities, a universal capability dictionary can be established for cross-brand devices. When new smart home devices are connected, automatic adaptation can be achieved through semantic matching, eliminating the need for customized development. By parsing device capabilities, the time required for new device connection can be reduced from hours to minutes, and plug-and-play functionality for unknown brands can be supported, with a protocol compatibility coverage rate exceeding 98%.
[0030] This invention proposes deploying a reinforcement learning (RL) agent in the cloud. The RL agent can use historical user behavior data (such as device operation records for the past 30 days), environmental sensor data (such as light intensity, temperature, and humidity), device status (such as device online status and energy consumption data), and user profiles (such as sleep schedule and preference tags) as input information to the state space, and use scene action combinations (such as closing curtains, adjusting air conditioning, and turning on ambient lighting) as output information to the action space. The RL agent can score actions using a reward function, which can comprehensively consider multi-objective optimization that prioritizes energy efficiency and is weighted towards comfort. The RL agent can dynamically optimize the control strategy based on the scoring results of the reward function.
[0031] This invention proposes the introduction of a federated learning framework. Under this framework, edge nodes in each household can train models locally and only upload anonymized model gradients to the cloud for aggregation. This protects user privacy while optimizing the model, enabling scene policies to have autonomous learning capabilities and dynamically evolve over time, no longer relying on static rule bases, and supporting multi-dimensional context-aware proactive services. By dynamically optimizing control strategies, the accuracy of the system's proactive scene recommendations can be improved by 40%, the rate of manual user intervention reduced by 60%, and energy consumption reduced by 15% to 20% in typical scenarios (such as the linkage between air conditioning and curtains).
[0032] Reference Figure 1 The diagram illustrates a step flowchart of a method for controlling smart home devices according to some embodiments of the present invention, which is applied to a collaborative control system. The collaborative control system includes a cloud node, an edge node, and smart home devices, wherein the edge node is communicatively connected to the cloud node and the smart home devices respectively.
[0033] In some examples, a collaborative control system can be a system composed of multiple computing nodes and controlled devices. In a collaborative control system, different nodes can undertake different computing and communication responsibilities to jointly control smart home devices.
[0034] In this context, cloud nodes can be computing resources deployed on remote servers. Cloud nodes can be used to perform computationally intensive tasks, including but not limited to training reinforcement learning models, generating global control policies, and aggregating model parameters from multiple home edge nodes. Edge nodes can be computing devices deployed locally in a user's home. Edge nodes can be used to perform tasks with high real-time requirements, including but not limited to device access management, protocol conversion, local data acquisition and preprocessing, and local fine-tuning of control policies. For example, an edge node could be a home smart gateway.
[0035] Smart home devices can be devices with communication and control functions; they can include lighting equipment, air conditioning equipment, curtain control equipment, audio-visual equipment, etc. Smart home devices can interact with edge nodes through communication protocols such as Wi-Fi (Wireless Fidelity), Bluetooth, and Zigbee (Zigbee protocol).
[0036] In practical applications, cloud nodes and edge nodes can establish communication connections via the Internet; edge nodes and smart home devices can establish communication connections via local area networks or point-to-point communication links. Edge nodes can act as an intermediate layer, undertaking data relay and control command forwarding functions between cloud nodes and smart home devices.
[0037] Specifically, it may include the following steps: Step 101: Obtain the instruction manual of the newly connected smart home device through the edge node, and obtain the device capability description file by performing natural language parsing on the instruction manual.
[0038] In some examples, a smart home environment can be an environment where smart home devices are deployed, and multiple smart home devices can exist within this environment that can interact via a communication network. The documentation can be documents provided by the smart home device manufacturer that record the device's functional specifications and usage instructions. This documentation may include at least one of a device PDF manual and open API interface documentation. The content of the documentation may include the names of the functions supported by the device, the range of values for the functional parameters, and precautions for operating the device.
[0039] In some examples, natural language parsing can include processing documentation such as word segmentation, part-of-speech tagging, named entity recognition, and relation extraction to extract structured information from unstructured text. Natural language parsing can be an example of NLP (Natural Language Processing) techniques.
[0040] In some examples, the device capability description file includes a device identifier and its corresponding function name and parameter boundary values. The device capability description file can be a data file that records device functional information in a structured data format. The device capability description file can be in JSON (JavaScript Object Notation) format, and it can be used by edge nodes and cloud nodes to identify and understand the device's capabilities.
[0041] In practical applications, edge nodes can read documentation from the device's local storage, obtain it through user uploads, or retrieve it through open API interfaces provided by the device manufacturer.
[0042] After obtaining the documentation at the edge node, natural language parsing can be performed on it. For example, the edge node can call an NLP module to perform semantic analysis and information extraction on the unstructured text in the documentation. Through named entity recognition and relation extraction technologies, the device's supported function names (such as "power on / off", "temperature setting", "brightness adjustment") and the parameter boundaries corresponding to each function (such as temperature setting range of 16℃ to 30℃, brightness adjustment range of 0% to 100%) can be extracted from the documentation.
[0043] After parsing the documentation using natural language and determining the parsing results, a device capability description file can be generated based on those results. This file records the device's capability information in a standardized, structured format, allowing the system to recognize devices of different brands and types using the same data format. Edge nodes can store the generated device capability description file locally for later use in instruction conversion.
[0044] In some implementations, when a new device joins the network, the Protocol Abstraction Layer (PAL) can automatically read the device's PDF manual or open API documentation. The PAL uses an NLP module to extract the device's core functions (such as "on / off," "brightness adjustment," "temperature setting," and "color temperature adjustment") and parameter boundaries (such as brightness adjustment range of 0 to 100%, temperature setting range of 16 to 30°C, and color temperature adjustment range of 2700K to 6500K), and generates a unified capability description file in JSON format, for example: { “device_id”:“L001”, / / Device identifier, used to uniquely identify the smart device in the system; "functions":[ / / A list of functions, recording all callable functions supported by this device; / / The beginning of the first functional object; “name”:“set_brightness”, / / Function name, indicating that the device supports the “adjust brightness” function; "params":{ / / Parameter object, describing the specific parameters involved in this function; “min”:0, / / The parameter “min” represents the minimum value of this function parameter (the minimum brightness is 0%). "max":100 / / The parameter "max" represents the maximum value of this function parameter (the maximum brightness is 100%). / / End of parameter object; / / End of the first functional object; / / End of feature list; / / End of the entire device capability description file object.
[0045] In practical applications, regardless of whether a device originally uses a proprietary or general protocol, it can interact with the system through capability description files. PAL has a built-in general protocol converter that can map unified control commands to proprietary protocol signals that the device can recognize. This converter supports protocols such as MQTT (Message Queuing Telemetry Transport), CoAP (Constrained Application Protocol), and HTTP (Hypertext Transfer Protocol). Smart home devices, after connecting via Wi-Fi, Bluetooth, or Zigbee, can complete registration and adaptation in a short time, such as within 5 minutes, without requiring manual intervention.
[0046] In some embodiments of the present invention, after obtaining the documentation of the newly connected smart home device in the smart home environment, the method further includes: obtaining device physical constraint information by performing natural language parsing on the documentation, and generating an action constraint mask based on the physical constraint information.
[0047] In some examples, physical constraint information includes one or more of the following: device inverter start-up delay, temperature regulation lower limit. These physical constraint information can be limiting parameters inherent to the device at the hardware level, determined by the device's physical structure or operating principle.
[0048] In some examples, an action constraint mask can be a data structure used to mark which actions in the action space are currently unavailable. The action constraint mask corresponds one-to-one with candidate actions in the action space; when a candidate action is marked as unavailable by the mask, that action will not be selected by the reinforcement learning agent. The action constraint mask can be a Boolean array, where each element indicates whether the corresponding action is available.
[0049] In practical applications, when edge nodes analyze documentation using natural language processing technology, they can extract physical constraint information from text paragraphs such as notes, warnings, and usage restrictions.
[0050] After extracting the physical constraint information, the edge nodes can generate action constraint masks based on the physical constraint information. For example, the edge nodes transform the restrictions in the physical constraint information into availability judgment rules for candidate actions in the action space, judge each candidate action in the action space according to the availability judgment rules, generate prohibition marks for unavailable actions, and summarize the prohibition marks into an action constraint mask.
[0051] Step 102: Obtain historical user behavior data in the smart home environment through the edge node, generate a user behavior profile based on the historical user behavior data, and send it to the cloud node.
[0052] In some examples, user history behavior data can be recorded data generated when users operate various devices in a smart home environment. This data may include the type of device operation (e.g., turning on, turning off, adjusting parameters), the time of the operation, the spatial location of the operation, and the parameter settings. User history behavior data may also include records of user interventions after the system automatically executes actions.
[0053] In some examples, a user behavior profile can be a dataset representing a user's personalized usage habits and preferences. A user behavior profile can include information such as the user's operating patterns, frequency of operation, and operating preferences across various devices at different times. User behavior profiles can be generated through statistical analysis and pattern recognition of historical user behavior data.
[0054] In practical applications, edge nodes can record relevant information for each user operation, including the operation object, operation type, operation parameters, operation time, and operation location. This allows for the acquisition of historical user behavior data generated when users operate various devices in a smart home environment.
[0055] After acquiring users' historical behavior data, user behavior profiles can be generated. For example, edge nodes can classify and statistically analyze users' historical behavior data according to operation type, time period, and spatial location to identify users' operation patterns (such as repetitive operations performed at fixed times every day, combined operations in specific scenarios, etc.). Furthermore, edge nodes can classify behavior patterns into habitual behaviors and occasional behaviors based on operation frequency.
[0056] After generating a user behavior profile, it can be sent to a cloud node. Upon receiving the user behavior profile, the cloud node can use it as one of the input information for the reinforcement learning agent when making control policy decisions.
[0057] In some implementations, edge nodes can update user behavior profiles according to a set period or after a set amount of historical user behavior data has been accumulated, and send the updated user behavior profiles to cloud nodes.
[0058] In some implementations, user behavior in the smart home environment can be recorded in real time. The recorded historical user behavior data can be a continuous sequence of operations, such as "turning on the TV at 8 PM, then lowering the screen, and then setting the air conditioner to 26°C." Edge nodes can also record the user's spatiotemporal correlation information, such as "device usage frequency in the living room is higher on weekend afternoons than on weekdays." Edge nodes can also record abnormal user intervention behaviors, such as "the system automatically dims the lights, and the user manually brightens them." Edge nodes can categorize and store user historical behavior data according to behavioral patterns. For example, behavioral patterns that occur three or more times per week can be marked as "daily habits," and unique settings that occur only once can be marked as "temporary preferences," generating a user-specific behavioral profile through categorized storage.
[0059] Step 103: Obtain the current device status and current environment data collected for the smart home environment through the edge node, and send the current device status and current environment data to the cloud node.
[0060] In some examples, the current device status may include whether the device is online, the device's current operating mode, and the device's current operating parameter values (such as the current temperature setting, current light brightness, current curtain opening, etc.); the current device status may also include the device's energy consumption information.
[0061] In some examples, the current environmental data may include at least one of indoor environmental data and external environmental data. Indoor environmental data may include indoor light intensity, indoor temperature, indoor humidity, and human body sensing information. External environmental data may include outdoor weather information (such as temperature, probability of rainfall, etc.).
[0062] In practical applications, edge nodes can obtain the current device status by sending status query requests to smart home devices or receiving status information actively reported by smart home devices through communication connections with various smart home devices (such as Wi-Fi, Bluetooth, and Zigbee connections).
[0063] Edge nodes can acquire current environmental data through communication connections with various sensors deployed in the home environment (such as temperature and humidity sensors, light sensors, and infrared human body sensors connected via wired or wireless means). Edge nodes can also obtain external environmental data from external data sources, such as weather service APIs, through communication connections with external networks.
[0064] In some implementations, edge nodes can collect and upload current device status and current environment data according to a set time period (such as every 30 seconds or 1 minute), or they can collect and upload data immediately when the device status changes (such as after the user manually operates the device).
[0065] Before sending the current device status and current environment data to the cloud node, the current device status and current environment data can be preprocessed. Preprocessing can include uniform conversion of data format, removal of outliers, and data normalization (such as mapping data of different dimensions to a uniform numerical range, such as the [0,1] range).
[0066] In some implementations, data collected by indoor sensors (such as light intensity, temperature and humidity, and human body sensing information), device status data (such as device energy consumption and online duration), and external data (such as rainfall probability obtained through weather APIs and holiday information obtained through calendar APIs) can be integrated to construct a dynamic environmental context.
[0067] For example, when it is detected that it is raining outside, the window is not closed, or the user has left home, a window closing command can be automatically triggered. Or, when the indoor temperature is detected to be 28°C and the user is home, the air conditioning can be adjusted first rather than opening the window, thus balancing energy efficiency.
[0068] Step 104: In response to the acquired user control intent, the cloud node generates a first control strategy based on the current device status, current environmental data, and user behavior profile.
[0069] In some examples, user control intent can be an operation or scenario state that a user wants the smart home system to perform. This user control intent can be obtained through user input, which can include at least one of voice commands, app operation commands, and gesture commands. User control intent can be a specific operation command (such as "turn on the air conditioner") or a scenario requirement (such as "I want to rest" or "movie mode").
[0070] like Figure 2 Users can initiate requests by inputting voice commands or operation instructions. Edge nodes can obtain the user's control intent through voice recognition or command parsing and forward the user's control intent to the cloud node. The cloud node then responds to the user's control intent and generates the corresponding first control strategy.
[0071] In some examples, the first control strategy can be a control scheme generated by a cloud node in response to a user's control intent; the first control strategy can include one or more action combinations, each action combination corresponding to control commands for one or more smart home devices. The first control strategy can be a control scheme optimized based on global data and can include multiple action parameters (such as temperature setpoints, light brightness values, curtain opening values, etc.).
[0072] In some embodiments of the present invention, generating a first control strategy based on the current device state, current environment data, and user behavior profile includes: constructing a state space using the current device state, current environment data, and user behavior profile through the reinforcement learning agent of the cloud node, and constructing an action space using action combinations; and determining a target action combination from the action space based on a reward function as the first control strategy.
[0073] In some examples, a reinforcement learning agent can be a program module that implements decision-making functions based on reinforcement learning algorithms. The reinforcement learning agent learns the optimal policy through interaction with the environment (observing states, selecting actions, and receiving rewards). For example, a reinforcement learning agent could be an agent employing the Q-learning algorithm.
[0074] In some examples, the state space can be constructed by fusing data from the current device state, current environmental data, and user behavior profiles. Each action in the action space can correspond to a combination of scene actions, that is, a combination of control commands for one or more smart home devices; the action space can contain multiple candidate action combinations.
[0075] In practical applications, reinforcement learning agents can receive current device status, current environmental data, and user behavior profiles as input information. The agent then constructs a state space based on this input. For example, it fuses current device status (such as the online status of each device and current operating parameter values), current environmental data (such as indoor temperature, light intensity, and human body sensor information), and user behavior profiles (such as user habit weights and intervention records) to form a state vector as the state space. The data in each dimension of the state space can be normalized before fusion.
[0076] In practical applications, reinforcement learning agents can also construct action spaces. An action space contains multiple candidate action combinations, each corresponding to a set of device control commands (such as "turn on the air conditioner and set it to 26°C, close the curtains, and dim the lights to 20%"). Each candidate action combination can contain one or more action parameters (such as temperature, brightness, and opening degree).
[0077] In some examples, the reward function can be a scoring function used to evaluate the quality of an action. The reward function can quantitatively evaluate the action chosen by the reinforcement learning agent and output a numerical value as the reward value for that action; the reward function can contain multiple sub-functions, each corresponding to an evaluation dimension.
[0078] In some examples, the target action combination can be actions selected by the reinforcement learning agent from the action space. Here, the target action combination is the action selection result that the reinforcement learning agent considers optimal or near-optimal based on the reward function evaluation, given the current state space.
[0079] In practical applications, reinforcement learning agents can calculate a reward value for each candidate action combination in the action space; the reward value is calculated by a reward function based on the current state space and the candidate action combinations. The reinforcement learning agent can sort or compare the reward values of each candidate action combination and select the candidate action combination with the highest reward value as the target action combination.
[0080] Before selecting actions from the action space, the reinforcement learning agent can first obtain the action constraint mask, filter out currently unavailable actions from the action space based on the action constraint mask, and then select actions from the filtered action space.
[0081] In some implementations, the reinforcement learning agent can use a state space S as input information; wherein, the state space S may include device state, environmental data, and user profile. The action space A of the reinforcement learning agent can be composed of a combination of scene actions (e.g., "movie viewing mode" may include 5 device actions such as lowering the screen, adjusting the lights, and setting the air conditioner).
[0082] In some implementations, multi-source data can be transformed into a computable vector form. The state space S can contain device status (such as device online status, normalized operating parameters), environmental data (such as sensor data, external API data, after normalization), and user profiles (such as habit weights, intervention records). For example, the state space S = [device(1,1,1), environment(0.2,0.7), profile(0.8,0.1)].
[0083] Among them, the action space A can be composed of scene action combinations (such as "viewing mode" can include actions such as lowering the screen, adjusting the lights to 10%, and setting the air conditioner to 24℃). The parameters in the action space can be normalized.
[0084] Reinforcement learning agents can score candidate actions in the action space using a reward function R. The reward function R can be expressed as a weighted sum of multiple sub-functions, for example: Reward function R = 0.6 × Comfort score + 0.3 × Energy efficiency score + 0.1 × Response speed score. Based on the comprehensive score calculated by the reward function, a specific combination of actions is selected from the action space.
[0085] In some embodiments of the present invention, a first control strategy is generated based on the current device state, current environmental data, and user behavior profile, including: generating a first control strategy based on the current device state, current environmental data, user behavior profile, and the action constraint mask.
[0086] After constructing an action space containing multiple candidate action combinations at the cloud node, an action constraint mask can be obtained. The action constraint mask marks which candidate actions are unavailable in the current state. The cloud node can apply the action constraint mask to the action space to exclude the candidate actions marked as unavailable, resulting in a filtered action space. By calling the reinforcement learning agent, with the state space as input, each available candidate action in the filtered action space is scored based on the reward function. The candidate action with the highest score is selected as the target action combination, and the target action combination is output as the first control policy.
[0087] In some embodiments of the present invention, the reward function includes a comfort sub-function, an energy efficiency sub-function, and a response speed sub-function; based on the reward function, a target action combination is determined from the action space as a first control strategy, including: Based on the comfort sub-function, energy efficiency sub-function, and response speed sub-function, comfort scores, energy efficiency scores, and response speed scores of multiple candidate action combinations are determined from the action space. The comfort scores, energy efficiency scores, and response speed scores are then weighted and summed to obtain a comprehensive score. The target action combination is determined based on the comprehensive score as the first control strategy.
[0088] In some examples, the comfort subfunction can be a function used to calculate the comfort score of a combination of actions. The input to the comfort subfunction can include the duration of continuous uninterrupted user activity, current environmental parameters (such as temperature and humidity), and the output is a numerical value as a comfort score. This comfort score can be a quantitative assessment of the comfort level of the combination of actions.
[0089] In some examples, the energy efficiency subfunction can be a function used to calculate the energy efficiency score of a combination of actions. The input to the energy efficiency subfunction can include information such as the device's current power and rated maximum power, and the output is a numerical value as an energy efficiency score. This score can be a quantitative assessment of the energy efficiency of the combination of actions.
[0090] In some examples, the response speed subfunction can be a function used to calculate the score of the action combination on the dimension of response timeliness. The input to the response speed subfunction can include information such as system response latency and user perception thresholds, and the output is a numerical value as the response speed score, which can be a quantitative evaluation result of the action combination on the dimension of response timeliness.
[0091] In practical applications, reinforcement learning agents can call comfort sub-functions, energy efficiency sub-functions, and response speed sub-functions separately for calculations when dealing with multiple candidate action combinations in the action space. Specifically: The reinforcement learning agent can calculate a comfort score, energy efficiency score, and response speed score for each candidate action combination in the action space. The comfort score can be calculated by a comfort sub-function based on information such as the user's continuous uninterrupted time and current environmental parameters in the current state space. The energy efficiency score can be calculated by an energy efficiency sub-function based on device power information in the current state space. The response speed score can be calculated by a response speed sub-function based on system latency information in the current state space.
[0092] After determining the comfort score, energy efficiency score, and response speed score for multiple candidate action combinations, the reinforcement learning agent can perform a weighted summation of these scores for each candidate action combination. During the weighted summation, the comfort score is multiplied by a comfort weight coefficient, the energy efficiency score by an energy efficiency weight coefficient, and the response speed score by a response speed weight coefficient. By adding these three products, a comprehensive score for the candidate action combination is obtained.
[0093] After calculating the comprehensive score for each candidate action combination in the action space, the target action combination can be determined from the action space based on the comprehensive score. For example, all candidate action combinations are sorted from high to low according to their comprehensive scores, the candidate action combination with the highest comprehensive score is selected as the target action combination, and the determined target action combination is used as the output of the first control strategy.
[0094] In some embodiments of the present invention, the comfort score is non-linearly correlated with the duration of continuous uninterrupted user interaction, and the comfort sub-function is the Sigmoid function.
[0095] In some examples, the duration of continuous no-intervention by the user can be the length of time from the most recent automatic execution of a control action to the current moment during which the user has not manually intervened in the automatically executed action. The unit of measurement for the duration of continuous no-intervention by the user can be minutes or seconds. The duration of continuous no-intervention by the user can reflect the degree of user acceptance of the current control strategy; the longer the duration, the higher the user's acceptance of the current strategy.
[0096] In some examples, the sigmoid function can be a sigmoid function, a mathematical function that is monotonically increasing within its domain and whose output value is restricted to a specific interval (such as the interval between 0 and 1), and whose function curve has an S-shaped shape. For example, the sigmoid function is a logistic function.
[0097] In practical applications, the comfort sub-function can be a sigmoid function. In this function, the independent variable can be the duration of continuous uninterrupted user interaction, and the dependent variable is the comfort score. The function exhibits a non-linear correlation, with the comfort score changing in an S-shaped curve with the duration of continuous uninterrupted user interaction.
[0098] In practical applications, since the units and dimensions of the three indicators "comfort", "energy efficiency" and "response speed" are different, they can be converted into a unified 0 to 1 rating system (0 points represent the worst and 1 point represents the full score).
[0099] Comfort scores can be calculated based on the duration of continuous, uninterrupted user interaction. When selecting an action, a Q-Table (a table recording state-action values) can be consulted. The Q-Table records historical statistics on whether the user manually intervened after selecting a certain action in similar past states. If historical data shows that an action rarely triggers user intervention, the corresponding Q-value for that action is high, and it is preferable to select that action.
[0100] For example, the duration of continuous uninterrupted user interaction, T, can be used as the core variable. Let T be the duration of continuous uninterrupted user interaction, and T_max be the user's tolerance limit. Then, the basic comfort score can be expressed as min(1,T / T_max). Energy efficiency scores can be calculated based on device power consumption. Let P be the current power, and P_max be the device's rated maximum power. Then, the basic energy efficiency score can be expressed as 1-(P / P_max). Response speed scores can be calculated based on response latency. Let t be the actual latency, and t_limit be the user's perceived threshold. Then, the basic response speed score can be expressed as max(0,1-(t / t_limit)). The weighting coefficients [0.6,0.3,0.1] can be determined using the Analytic Hierarchy Process (AHP).
[0101] In some implementations, the overall score can be calculated using the following formula:
[0102] Where R refers to the overall reward value (i.e., the overall score), which is used to quantitatively evaluate the overall quality of a candidate action combination. The higher the R value, the better the action combination; S(t) refers to the comfort score. This refers to the energy efficiency rating; This refers to the response speed rating; , , These are the weighting coefficients for comfort rating, energy efficiency rating, and response speed rating, respectively, with the sum of the three weighting coefficients being 1. The weighting coefficients can be predetermined using the Analytic Hierarchy Process (AHP) and dynamically adjusted according to the energy efficiency rating of smart home devices.
[0103] In some implementations, the comfort score can be calculated using a sigmoid function to quantitatively model user comfort, as shown in the following formula:
[0104] Where t refers to the duration of continuous no-intervention by the user; This refers to the user tolerance threshold, which is the typical time between when a user begins an action and when the user may intend to intervene. The user tolerance threshold can be calculated based on the user's historical intervention data, such as the average waiting time before intervention occurs in similar scenarios. A higher user tolerance threshold indicates a stronger tolerance (a higher tolerance for deviations from comfort); a lower threshold indicates a weaker tolerance (more sensitive to deviations from comfort, making premature intervention more likely).
[0105] Here, K refers to the sensitivity coefficient, which represents the user's sensitivity to deviations from a comfort state. The larger the k value, the more pronounced the S-curve deviation. The steeper the rise in the S-curve, the more sensitive the user's perceived comfort level is to changes in the duration of no intervention; the smaller the k-value, the more pronounced the S-curve. The gentler the rise in temperature, the less sensitive the user's comfort perception is to changes in the duration of no intervention. k can be set according to the characteristics of the user group (e.g., when elderly people are more sensitive to temperature changes, the k value can be set higher). e refers to the natural constant, approximately equal to 2.71828.
[0106] In some embodiments of the present invention, before weighted summation of the comfort score, energy efficiency score, and response speed score to obtain a comprehensive score, the method further includes: Obtain a judgment matrix; wherein the judgment matrix is used to characterize the importance comparison relationship between the scores; based on the judgment matrix, determine the initial weights of the comfort score, energy efficiency score, and response speed score, and correct the initial weights according to the energy efficiency level of the smart home device to obtain the final weights of the comfort score, energy efficiency score, and response speed score.
[0107] In some examples, the judgment matrix can be a data structure used to record the pairwise importance comparisons between multiple evaluation indicators. The judgment matrix can be a square matrix, where the rows and columns correspond to the same set of evaluation indicators (such as comfort, energy efficiency, and response speed). Each element in the judgment matrix represents the importance of the row indicator relative to the column indicator. The judgment matrix can be pre-defined and stored in the system, and can be directly accessed when needed.
[0108] In some examples, importance comparison can refer to the degree of importance of one indicator relative to another when comparing two evaluation indicators. Importance comparison can be quantified using a numerical scale (such as using a 1 to 9 scale, where a larger number indicates that the row indicator is more important than the column indicator, and a number of 1 indicates that the two indicators are equally important).
[0109] In some examples, the initial weights can be base weight values calculated from the judgment matrix. The initial weights are the result of mathematical calculations applied to the importance comparisons within the judgment matrix. The initial weights can be three values, corresponding to the weights of the comfort score, energy efficiency score, and response speed score, respectively.
[0110] In practical applications, after obtaining the judgment matrix, the initial weights of each rating can be calculated based on the judgment matrix. For example, the geometric mean of each row element in the judgment matrix is calculated, and the geometric mean of each row is normalized to obtain the initial weights corresponding to each rating. The pairwise importance comparisons recorded in the judgment matrix are transformed into three values, which are used as the initial weights for the comfort rating, energy efficiency rating, and response speed rating, respectively.
[0111] In some examples, the energy efficiency rating of smart home devices can be a rating system indicating how efficient the device is at utilizing energy. This energy efficiency rating can be determined by parsing energy efficiency parameters from the device's documentation, such as the COP (Coefficient of Performance) and EER (Energy Efficiency Ratio), using natural language processing. For instance, energy efficiency ratings can include different levels such as Level 1, Level 2, and Level 3.
[0112] After determining the initial weights, the energy efficiency ratings of smart home devices can be obtained. Based on these ratings, the initial weights are adjusted to obtain the final weights for each score. For example, the comfort and energy efficiency weights in the initial weights can be adjusted according to the energy efficiency rating. The adjusted weights can then be used as the final weights for subsequent weighted summation of comfort, energy efficiency, and response speed scores.
[0113] In some implementations, pairwise comparison matrices (i.e., judgment matrices) can be constructed. These matrices can be used to record the pairwise importance relationships among three indicators: comfort, energy efficiency, and response speed. A judgment matrix can be constructed based on the consensus that "comfort is slightly more important than energy efficiency (scale 2), comfort is significantly more important than response speed (scale 3), and energy efficiency is slightly more important than response speed (scale 2)." In the matrix, rows represent the indicators being compared, and columns represent the reference indicators. For example:
[0114] The value in the first row and second column is 2, which means that "comfort" is twice as important as "energy efficiency"; the value in the second row and first column is 0.5, which means that "energy efficiency" is 0.5 times more important than "comfort".
[0115] In some implementations, the weight vector can be calculated using the square root method. This involves calculating the geometric mean (i.e., the cube root of the product) of the elements in each row of the judgment matrix, followed by normalization. For example, the geometric mean of the first row is (1×2×3)^(1 / 3)≈1.817, the geometric mean of the second row is (1 / 2×1×2)^(1 / 3)=1.000, and the geometric mean of the third row is (1 / 3×1 / 2×1)^(1 / 3)≈0.550. The sum of the three geometric means is 1.817+1.000+0.550=3.367. After normalization, the final weights are obtained: comfort 1.817 / 3.367≈0.54, energy efficiency 1.000 / 3.367≈0.30, and response speed 0.550 / 3.367≈0.16.
[0116] After determining the final weights, the final weights [0.54, 0.30, 0.16] can be fine-tuned in an engineering manner. For example, the comfort weight can be fine-tuned to 0.6, the energy efficiency weight can be kept at 0.3, and the response speed weight can be fine-tuned to 0.1, with the sum of the three being 1.0.
[0117] In some embodiments of the present invention, the initial weight is corrected according to the energy efficiency level of the smart home device, including: If the energy efficiency level of the smart home device is greater than the preset level, the initial weight of the comfort score is increased; if the energy efficiency level of the smart home device is less than or equal to the preset level, the initial weight of the energy efficiency score is increased.
[0118] In some examples, the preset level can be a pre-defined energy efficiency level threshold. The preset level can be used to divide the energy efficiency level of smart home devices into two ranges: "high energy efficiency" and "low energy efficiency." For example, the preset level could be level 2 energy efficiency. Devices with an energy efficiency level higher than level 2 (i.e., level 1) belong to the high energy efficiency range, while devices with an energy efficiency level lower than or equal to level 2 (i.e., level 2 or 3) belong to the low energy efficiency range.
[0119] In practical applications, when the energy efficiency level of the device is greater than the preset level (i.e., the device's energy efficiency is higher than the preset level, such as when the preset level is level 2 energy efficiency and the device is level 1 energy efficiency), the initial weight corresponding to the comfort score can be increased, and the initial weight corresponding to the energy efficiency score can be decreased accordingly. This results in the comfort score having an increased weight based on the initial weight, and the energy efficiency score having a decreased weight based on the initial weight.
[0120] When the energy efficiency level of the device is less than or equal to the preset level (i.e., the device energy efficiency is lower than or equal to the preset level, such as when the preset level is level 2 energy efficiency and the device is level 2 or 3 energy efficiency), the initial weight corresponding to the energy efficiency score can be increased, and the initial weight corresponding to the comfort score can be decreased accordingly. This results in the energy efficiency score having an increased weight based on the initial weight, and the comfort score having a decreased weight based on the initial weight.
[0121] Step 105: Using the edge node, based on the local user's historical intervention records, the first control strategy is adjusted in a personalized manner to generate a second control strategy; wherein, the local user's historical intervention records are the user's historical manual correction operation records of the control strategy recommended by the system.
[0122] In some examples, local user intervention history records can be historical data stored on edge nodes generated from users manually modifying automatically executed control policies. These local user intervention history records may include information such as the time the user made the manual modification, the smart home device involved, and the parameter values before and after the modification.
[0123] In practical applications, after a certain control strategy is automatically executed, records of users manually modifying the device's operating parameters (such as through an app, remote control, voice commands, or physical buttons) can be used as local user historical intervention records. For example, if the air conditioner is automatically set to 26°C, and the user manually adjusts the temperature to 25°C after this setting, this operation is recorded as a manual correction operation record.
[0124] In some examples, personalized adjustments can be operations that modify a general control strategy based on the user's individual behavioral characteristics. The second control strategy can be a control scheme generated after the edge node personalized the first control strategy; the second control strategy can include one or more adjusted action parameters.
[0125] In practical applications, edge nodes can extract correction operation records related to the current scenario from local user historical intervention records (such as scenarios identical to the currently controlled smart home device, or scenarios similar to the current time period). Based on the historical correction operation records, they can calculate the offset values of one or more action parameters and apply these offset values to the corresponding action parameters in the first control strategy to generate a second control strategy. For example, if the edge node determines from historical correction operation records that the user has repeatedly lowered the air conditioner temperature by 1°C from the cloud-recommended value in similar scenarios, then in this processing, the air conditioner temperature setpoint in the first control strategy can be reduced by 1°C.
[0126] In some embodiments of the present invention, based on local user historical intervention records, the first control strategy is personalized to generate a second control strategy, including: Based on local user historical intervention records, the personalized offset value corresponding to the action parameter in the first control strategy is determined, and the personalized offset value is weighted and fused with the corresponding action parameter in the first control strategy to obtain the second control strategy.
[0127] In some examples, action parameters can be adjustable variables included in a control strategy. A control strategy can contain one or more action parameters; action parameters can include temperature setpoints, light brightness values, curtain opening values, etc. Each action parameter has a numerical value, representing its setpoint within the current control strategy (e.g., if the air conditioner temperature setpoint is 26℃, then 26℃ is the numerical value of an action parameter).
[0128] In some examples, the personalized offset value can be a numerical value calculated based on the user's historical intervention records, representing the difference between the user's preferences and the cloud-based recommendations. The personalized offset value can be a positive, negative, or zero number. The sign of the personalized offset value indicates the direction of the user's preference deviating from the cloud-based recommendations (a positive offset indicates that the user's preference is higher than the cloud-based recommendations, and a negative offset indicates that the user's preference is lower than the cloud-based recommendations), and the absolute value of the personalized offset value indicates the degree of deviation.
[0129] In practical applications, for each action parameter in the first control strategy, the historical correction operation records related to the action parameter can be queried from the local user's historical intervention records. For example, for the action parameter "air conditioning temperature", the edge node can query all historical manual correction operation records related to air conditioning temperature adjustment from the local user's historical intervention records.
[0130] After obtaining historical correction operation records, the personalized offset values corresponding to the action parameters in the first control strategy can be determined. For example, the deviation of each manual correction operation relative to the recommended value can be extracted from the historical correction operation records (e.g., if a user manually corrects the recommended 26℃ to 25℃, the deviation is -1℃). Statistical analysis can be performed on all deviations (e.g., calculating the average, moving average, or fitting the trend through linear regression). The results of the statistical analysis can then be used as the personalized offset values for the action parameters.
[0131] After determining the personalized offset value, it can be weighted and fused with the corresponding action parameter in the first control strategy to obtain the value of the action parameter in the second control strategy. For example, the value of the action parameter in the first control strategy is multiplied by the cloud weight coefficient, and the personalized offset value of the action parameter is multiplied by the edge weight coefficient. The two products are then added together to obtain the value of the action parameter in the second control strategy.
[0132] In some implementations, Q-learning algorithms can be used for iterative optimization of strategies. For example, when a user accepts the recommended "morning mode" (such as turning on the lights, opening the curtains, and starting the coffee machine at 6:30) three times in a row, the weight of this strategy in the Q-table can be increased; when a user manually turns off the air conditioner that the system automatically turns on, the priority of the "automatically turn on the air conditioner when it is hot" strategy can be reduced.
[0133] For example, the update formula for the Q-learning algorithm can be expressed as: Q(s,a)←Q(s,a)+α×[r+γ×maxQ(s',a')-Q(s,a)]. Here, α is the learning rate (which can be set to 0.1), and γ is the discount factor (which can be set to 0.9). The Q-table can be understood as a data table storing historical experience, where each Q-value represents the expected long-term cumulative reward obtained by performing a specific action a in a specific state s. The ε-greedy strategy is used to control the balance between exploration and exploitation in action selection. When making a decision, it selects the action with the largest current Q-value with a high probability (e.g., 90%), and randomly selects an action (exploring new possibilities) with a low probability (e.g., 10%).
[0134] In some implementations, the update steps of the Q-learning algorithm may include: initializing the Q-table (initializing all values in the table to 0) → selecting actions using an ε-greedy strategy → calculating the reward value r (i.e., the overall score) after executing the selected action → updating the Q-value according to the update formula → repeating the above steps until the Q-value converges (i.e., the Q-value stabilizes). When the table values change very little for several consecutive times (e.g., the change is less than 0.001), learning can be considered complete, and the Q-table at this point represents the optimal policy.
[0135] For example, in an update, assuming the old Q(s,a)=0, the immediate reward r for the current action=0.85 (calculated using the comfort formula when the user has not intervened), the optimal valuation for the next state max Q(s',a')=0.8, the learning rate α=0.1, and the discount factor γ=0.9. Substituting into the update formula: new Q value=0+0.1×[0.85+0.9×0.8-0]=0+0.1×[0.85+0.72]=0.1×1.57=0.157, the Q value is updated from 0 to 0.157.
[0136] In the Q-table, rows can correspond to different states (such as indoor brightness, temperature, etc.), and columns can correspond to different actions (such as turning on lights, turning off lights, adjusting temperature, etc.). Each cell in the Q-table corresponds to a Q-value, representing the expected long-term cumulative reward for performing the corresponding action in the given state. During decision-making, based on the current input state, the corresponding row in the Q-table can be found, and the action with the highest Q-value in that row can be selected as the action to be performed. The Q-table is universal; as long as the input state conforms to the table's definition (such as including dimensions like temperature and time), the action can be determined by looking up the table in any scenario.
[0137] In some implementations, edge nodes can perform data fusion processing. For example, edge nodes can use Kalman filtering (a linear optimal estimation algorithm) to denoise data collected by light sensors, etc. Edge nodes can also use linear regression analysis to analyze user intervention behavior (e.g., after a user manually adjusts the air conditioner multiple times, the edge node can fine-tune the preference weights accordingly). Edge nodes can handle emergency events. For example, the rule engine in the edge node can respond to emergency events such as security alarms and ensure a response latency of less than 200 milliseconds.
[0138] Step 106: Through the edge node, based on the device capability description file, the second control strategy is converted into a private protocol control command that the smart home device can recognize, and the private protocol control command is sent to the smart home device for execution.
[0139] In some examples, proprietary protocol control commands can be control commands that conform to a custom communication protocol format specific to a particular device manufacturer. Different brands of smart home devices may use different proprietary communication protocols. Proprietary protocol control commands can be signal formats that the device can directly recognize and execute.
[0140] In practical applications, the target smart home devices to be controlled can be determined according to the second control strategy, and the device capability description files of the target smart home devices can be retrieved from local storage. Based on the protocol type and instruction format information recorded in the device capability description files, the unified format control instructions in the second control strategy are converted into control instructions that can be recognized by the private protocol of the target smart home devices.
[0141] For example, the device identifier and function name corresponding to each action parameter in the second control strategy can be identified, the protocol mapping rule corresponding to the function name can be found in the device capability description file, and the numerical value of the action parameter can be encoded into the byte sequence or signal format specified by the device's private protocol according to the mapping rule.
[0142] After converting the second control strategy into private protocol control commands that smart home devices can recognize, these commands can be sent to the target smart home device via the communication connection between the edge node and the smart home device. Upon receiving the private protocol control commands, the target smart home device can execute the corresponding actions according to the commands.
[0143] In some embodiments of the present invention, after the private protocol control command is sent to the smart home device for execution, the method further includes: obtaining execution feedback and user intervention behavior feedback through the edge node, and updating the local user historical intervention record based on the execution feedback and user intervention behavior feedback.
[0144] In some examples, execution feedback can be the response information returned by the smart home device to the edge node after executing a control command. This execution feedback can include information such as whether the device successfully executed the command, the device's operating status after execution (e.g., current temperature, current brightness), and whether any abnormalities occurred during execution.
[0145] In some examples, user intervention feedback can be feedback information generated when a user manually operates the device's status some time after the device executes a control command. This user intervention feedback can include information such as whether the user manually operated the device, the type of manual operation, the time of the manual operation, and parameter values before and after the manual operation; the type of manual operation can include manual operation via an app, remote control, physical buttons, etc.
[0146] In practical applications, after sending the private protocol control command to the smart home device for execution, we can wait for and obtain the execution feedback from the smart home device and the user's intervention behavior feedback.
[0147] After receiving control commands from a private protocol and executing the corresponding actions, smart home devices can return execution feedback to the edge node through the communication connection between the edge node and the device.
[0148] After the device executes a control command, the user may manually modify the device's status (e.g., manually adjusting the air conditioner temperature from the system setting of 25°C to 23°C). The user's manual operation changes the device's operating status, and edge nodes can identify user intervention behavior by monitoring these changes in real time and record the feedback.
[0149] Edge nodes can update their local user intervention history records based on the acquired execution feedback and user intervention behavior feedback. For example, they can append manual correction operation records from newly acquired user intervention behavior feedback to the local user intervention history records; and supplement the records based on device execution status information in the execution feedback (such as recording whether the device was operating normally when the intervention occurred). The updated local user intervention history records can then be used to make personalized adjustments to control policies issued from the cloud.
[0150] In this embodiment of the invention, the edge node acquires the instruction manual of the newly connected smart home device in the smart home environment, and obtains the device capability description file by parsing the instruction manual into natural language. The edge node also acquires historical user behavior data in the smart home environment, generates a user behavior profile based on the historical user behavior data, and sends it to the cloud node. Furthermore, the edge node acquires the current device status and current environment data collected for the smart home environment, and sends the current device status and current environment data to the cloud node. In response to the acquired user control intent, the cloud node generates a first control strategy based on the current device status, current environment data, and user behavior profile. Based on local user historical intervention records, the edge node personalizes the first control strategy to generate a second control strategy. The local user historical intervention records are records of users' historical manual correction operations on the system-recommended control strategy. Finally, based on the device capability description file, the edge node converts the second control strategy into a private protocol control command that the smart home device can recognize, and sends the private protocol control command to the smart home device for execution. This enables rapid access for cross-brand devices, adjusts control strategies according to the environment and user habits, and reduces manual intervention.
[0151] Reference Figure 3 This document illustrates a flowchart of another method for controlling smart home devices provided by some embodiments of the present invention. The method is applied to a collaborative control system, which includes a cloud node, an edge node, and smart home devices. The edge node is communicatively connected to both the cloud node and the smart home devices.
[0152] Specifically, it may include the following steps: Step 301: Obtain the instruction manual of the newly connected smart home device through the edge node, and obtain the device capability description file by performing natural language parsing on the instruction manual.
[0153] Step 302: Obtain historical user behavior data in the smart home environment through the edge node, generate a user behavior profile based on the historical user behavior data, and send it to the cloud node.
[0154] Step 303: Obtain the current device status and current environment data collected for the smart home environment through the edge node, and send the current device status and current environment data to the cloud node.
[0155] Step 304: In response to the acquired user control intent, the cloud node generates a first control strategy based on the current device status, current environmental data, and user behavior profile.
[0156] Step 305: Using the edge node, based on the local user's historical intervention records, the first control strategy is adjusted in a personalized manner to generate a second control strategy; wherein, the local user's historical intervention records are the user's historical manual correction operation records of the control strategy recommended by the system.
[0157] Step 306: Through the edge node, based on the device capability description file, the second control strategy is converted into a private protocol control command that the smart home device can recognize, and the private protocol control command is sent to the smart home device for execution.
[0158] Step 307: Obtain execution feedback and user intervention behavior feedback through the edge node, and update the local user historical intervention record based on the execution feedback and user intervention behavior feedback.
[0159] In this embodiment of the invention, the edge node acquires the documentation for newly connected smart home devices in the smart home environment, and obtains a device capability description file by parsing the documentation using natural language. The edge node also acquires historical user behavior data in the smart home environment, generates a user behavior profile based on this data, and sends it to the cloud node. Furthermore, the edge node acquires current device status and current environment data collected for the smart home environment, and sends these data to the cloud node. In response to the acquired user control intent, the cloud node generates a first control strategy based on the current device status, current environment data, and user behavior profile. Based on local user historical intervention records, the system personalizes the first control strategy to generate a second control strategy. These local user historical intervention records are records of users' manual corrections to the system's recommended control strategy. Through edge nodes, based on device capability description files, the second control strategy is converted into private protocol control commands that smart home devices can recognize, and these commands are sent to the smart home devices for execution. Through edge nodes, execution feedback and user intervention behavior feedback are obtained, and the local user historical intervention records are updated accordingly. This enables rapid cross-brand device access, adjusts control strategies based on environment and user habits, and reduces manual intervention.
[0160] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0161] Some embodiments of the present invention also provide a collaborative control system, which includes a cloud node, an edge node, and a smart home device, wherein the edge node is communicatively connected to both the cloud node and the smart home device. The edge nodes are used for: Obtain the instruction manuals for newly connected smart home devices in the smart home environment, and obtain device capability description files by performing natural language parsing on the instruction manuals; Acquire historical user behavior data in the smart home environment, generate a user behavior profile based on the historical user behavior data, and send it to the cloud node; Acquire the current device status and current environment data collected for the smart home environment, and send the current device status and current environment data to the cloud node; The cloud node is used for: In response to the acquired user control intent, a first control strategy is generated based on the current device status, current environmental data, and user behavior profile; The edge node is also used for: Based on local user historical intervention records, the first control strategy is adjusted in a personalized manner to generate a second control strategy; wherein, the local user historical intervention records are the user's historical manual correction operation records of the control strategy recommended by the system. Based on the device capability description file, the second control strategy is converted into a private protocol control command that the smart home device can recognize, and the private protocol control command is sent to the smart home device for execution.
[0162] In some embodiments of the present invention, the device capability description file includes a device identifier and corresponding function name and parameter boundary value.
[0163] In some embodiments of the present invention, after obtaining the specification document of the newly connected smart home device in the smart home environment, the method further includes: obtaining device physical constraint information by performing natural language parsing on the specification document, and generating an action constraint mask based on the physical constraint information; The first control policy is generated based on the current device status, current environment data, and user behavior profile, including: generating the first control policy based on the current device status, current environment data, user behavior profile, and the action constraint mask.
[0164] In some embodiments of the present invention, the physical constraint information includes any one or more of the following: device frequency conversion start-up delay, temperature regulation lower limit.
[0165] In some embodiments of the present invention, generating a first control strategy based on the current device state, current environmental data, and user behavior profile includes: Through the reinforcement learning agent of the cloud node, a state space is constructed based on the current device state, current environment data, and user behavior profile, and an action space is constructed based on action combinations; Based on the reward function, a target action combination is determined from the action space as the first control strategy.
[0166] In some embodiments of the present invention, the reward function includes a comfort sub-function, an energy efficiency sub-function, and a response speed sub-function; based on the reward function, a target action combination is determined from the action space as a first control strategy, including: Based on the comfort sub-function, energy efficiency sub-function, and response speed sub-function, the comfort score, energy efficiency score, and response speed score of multiple candidate action combinations are determined from the action space. The comfort score, energy efficiency score, and response speed score are then weighted and summed to obtain a comprehensive score. The target action combination is determined based on the comprehensive score and used as the first control strategy.
[0167] In some embodiments of the present invention, before weighted summation of the comfort score, energy efficiency score, and response speed score to obtain a comprehensive score, the method further includes: Obtain the judgment matrix; wherein the judgment matrix is used to characterize the importance comparison relationship between scores; Based on the judgment matrix, the initial weights of the comfort score, energy efficiency score, and response speed score are determined, and the initial weights are corrected according to the energy efficiency level of the smart home device to obtain the final weights of the comfort score, energy efficiency score, and response speed score.
[0168] In some embodiments of the present invention, the initial weight is corrected according to the energy efficiency level of the smart home device, including: If the energy efficiency level of the smart home device is greater than the preset level, the initial weight of the comfort score is increased; if the energy efficiency level of the smart home device is less than or equal to the preset level, the initial weight of the energy efficiency score is increased.
[0169] In some embodiments of the present invention, the comfort score is non-linearly correlated with the duration of continuous uninterrupted user interaction, and the comfort sub-function is the Sigmoid function.
[0170] In some embodiments of the present invention, based on local user historical intervention records, the first control strategy is personalized to generate a second control strategy, including: Based on local user historical intervention records, the personalized offset value corresponding to the action parameter in the first control strategy is determined, and the personalized offset value is weighted and fused with the corresponding action parameter in the first control strategy to obtain the second control strategy.
[0171] In some embodiments of the present invention, after sending the private protocol control command to the smart home device for execution, the method further includes: The edge nodes are used to obtain execution feedback and user intervention behavior feedback, and the local user historical intervention records are updated based on the execution feedback and user intervention behavior feedback.
[0172] Some embodiments of the present invention also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method described above.
[0173] Some embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored, and which, when executed by a processor, implements the method described above.
[0174] Some embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0175] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0176] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0177] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0178] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0179] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0180] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0181] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0182] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0183] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes the aforementioned element.
[0184] The above provides a detailed description of the methods, systems, devices, media, and products for controlling smart home devices. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this invention. At the same time, those skilled in the art will recognize that, based on the ideas of this invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for controlling smart home devices, characterized in that, An application is made in a collaborative control system, which includes a cloud node, an edge node, and smart home devices, wherein the edge node is communicatively connected to both the cloud node and the smart home devices. The method includes: The edge nodes are used to obtain the documentation for newly connected smart home devices in the smart home environment, and the device capability description file is obtained by parsing the documentation using natural language. The edge node acquires historical user behavior data in the smart home environment, generates a user behavior profile based on the historical user behavior data, and sends it to the cloud node. The edge node acquires the current device status and current environment data collected for the smart home environment, and sends the current device status and current environment data to the cloud node. Through the cloud node, in response to the acquired user control intent, a first control strategy is generated based on the current device status, current environmental data, and user behavior profile; Based on the local user's historical intervention records, the first control strategy is personalized and a second control strategy is generated through the edge node; wherein, the local user's historical intervention records are the user's historical manual correction operation records of the control strategy recommended by the system. Through the edge node, based on the device capability description file, the second control strategy is converted into a private protocol control command that the smart home device can recognize, and the private protocol control command is sent to the smart home device for execution.
2. The method according to claim 1, characterized in that, The device capability description file includes the device identifier and its corresponding function name and parameter boundary values.
3. The method according to claim 1, characterized in that, After obtaining the documentation for the newly connected smart home devices in the smart home environment, the method further includes: obtaining physical constraint information of the devices by performing natural language parsing on the documentation, and generating an action constraint mask based on the physical constraint information; The first control policy is generated based on the current device status, current environment data, and user behavior profile, including: generating the first control policy based on the current device status, current environment data, user behavior profile, and the action constraint mask.
4. The method according to claim 3, characterized in that, The physical constraint information includes one or more of the following: equipment frequency conversion start-up delay, temperature regulation lower limit.
5. The method according to any one of claims 1-4, characterized in that, The step of generating a first control strategy based on the current device status, current environmental data, and user behavior profile includes: Through the reinforcement learning agent of the cloud node, a state space is constructed based on the current device state, current environment data, and user behavior profile, and an action space is constructed based on action combinations; Based on the reward function, a target action combination is determined from the action space as the first control strategy.
6. The method according to claim 5, characterized in that, The reward function includes a comfort sub-function, an energy efficiency sub-function, and a response speed sub-function; based on the reward function, a target action combination is determined from the action space as a first control strategy, including: Based on the comfort sub-function, energy efficiency sub-function, and response speed sub-function, the comfort score, energy efficiency score, and response speed score of multiple candidate action combinations are determined from the action space. The comfort score, energy efficiency score, and response speed score are then weighted and summed to obtain a comprehensive score. The target action combination is determined based on the comprehensive score and used as the first control strategy.
7. The method according to claim 6, characterized in that, Before weighted summing the comfort score, energy efficiency score, and response speed score to obtain the comprehensive score, the following steps are also included: Obtain the judgment matrix; wherein the judgment matrix is used to characterize the importance comparison relationship between scores; Based on the judgment matrix, the initial weights of the comfort score, energy efficiency score, and response speed score are determined, and the initial weights are corrected according to the energy efficiency level of the smart home device to obtain the final weights of the comfort score, energy efficiency score, and response speed score.
8. The method according to claim 7, characterized in that, The initial weights are adjusted based on the energy efficiency ratings of the smart home devices, including: If the energy efficiency level of the smart home device is greater than the preset level, the initial weight of the comfort score is increased; if the energy efficiency level of the smart home device is less than or equal to the preset level, the initial weight of the energy efficiency score is increased.
9. The method according to claim 6, characterized in that, The comfort score is non-linearly correlated with the duration of continuous, uninterrupted user interaction, and the comfort sub-function is the Sigmoid function.
10. The method according to any one of claims 1-4, characterized in that, Based on local user historical intervention records, the first control policy is personalized and a second control policy is generated, including: Based on local user historical intervention records, the personalized offset value corresponding to the action parameter in the first control strategy is determined, and the personalized offset value is weighted and fused with the corresponding action parameter in the first control strategy to obtain the second control strategy.
11. The method according to any one of claims 1-4, characterized in that, After sending the private protocol control command to the smart home device for execution, the process further includes: The edge nodes are used to obtain execution feedback and user intervention behavior feedback, and the local user historical intervention records are updated based on the execution feedback and user intervention behavior feedback.
12. A cooperative control system, characterized in that, The collaborative control system includes cloud nodes, edge nodes, and smart home devices, with the edge nodes communicatively connected to both the cloud nodes and the smart home devices. The edge nodes are used for: Obtain the instruction manuals for newly connected smart home devices in the smart home environment, and obtain device capability description files by performing natural language parsing on the instruction manuals; Acquire historical user behavior data in the smart home environment, generate a user behavior profile based on the historical user behavior data, and send it to the cloud node; Acquire the current device status and current environment data collected for the smart home environment, and send the current device status and current environment data to the cloud node; The cloud node is used for: In response to the acquired user control intent, a first control strategy is generated based on the current device status, current environmental data, and user behavior profile; The edge node is also used for: Based on local user historical intervention records, the first control strategy is adjusted in a personalized manner to generate a second control strategy; wherein, the local user historical intervention records are the user's historical manual correction operation records of the control strategy recommended by the system. Based on the device capability description file, the second control strategy is converted into a private protocol control command that the smart home device can recognize, and the private protocol control command is sent to the smart home device for execution.
13. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method as described in any one of claims 1 to 11.
15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 11.
