Device control method and apparatus, electronic device, and storage medium

By acquiring resource data of the target space, finding matching trigger conditions, and determining device control commands, the system solves the problems of configuration complexity and high operation and maintenance costs of device control services when there are many devices, and achieves efficient and flexible device control.

CN116346869BActive Publication Date: 2026-04-17SHENZHEN LUMIUNITED TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN LUMIUNITED TECH CO LTD
Filing Date
2023-03-21
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, when there are many types and a large number of devices, the configuration of equipment control services is complex and the operation and maintenance costs are high. When the equipment fails or changes, the success rate of automated configuration is low, the user operation is cumbersome, and the learning cost is high.

Method used

By acquiring resource data of the target space, finding matching trigger conditions, and determining the device control command based on the association between the trigger conditions and the device control service in the linkage data, the device control service is sent to the target device. This enables the device control service to be independent of device state binding, making it suitable for smart home and smart park scenarios.

Benefits of technology

It reduces the operation and maintenance costs and configuration complexity of equipment control, improves the efficiency and execution success rate of automated control, enhances the flexibility and scalability of equipment control services, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116346869B_ABST
    Figure CN116346869B_ABST
Patent Text Reader

Abstract

The application provides a device control method and device, an electronic device and a storage medium, and relates to the technical field of Internet of Things. The method comprises the following steps: acquiring resource data of a target space; the resource data is related to state data reported by each device in the target space; in configured linkage data, a trigger condition matched with the resource data of the target space is found; the trigger condition in the linkage data is configured according to the resource data of the target space; based on an association relationship between the trigger condition in the linkage data and a device control service, a device control service having an association relationship with the found trigger condition is determined; a device control instruction for a target device is obtained according to the determined device control service, and the device control instruction is sent to the target device, so that the target device performs a corresponding action in response to the device control instruction. The application saves the cost of reconfiguration of the user, improves the efficiency of automatic control, and greatly improves the execution success rate of the device control service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet of Things (IoT) technology, and more specifically, to a device control method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of IoT technology, the device control services provided by various smart scenarios are becoming increasingly diverse. Taking smart home scenarios as an example, device control services can be scenario-based (such as the homecoming scenario) or automation-based.

[0003] Currently, device control services are typically tied to the device's status. Taking automation-based device control services as an example, users need to pre-configure trigger conditions and device actions in the client based on the device status of each device to achieve automated device control. For some devices in a single space with a relatively small number of devices, the logic is relatively clear, and the user operation is relatively simple.

[0004] However, for a large number of devices and a variety of device types, such as switches, sockets, lights, and sensors, configuring automation that meets the actual needs of users requires high manpower costs, the operation is cumbersome for users, and the success rate of the corresponding automation configuration will be affected if there are any changes to the devices later. Summary of the Invention

[0005] This application provides a device control method, apparatus, electronic device, and storage medium that saves users reconfiguration costs, improves the efficiency of automated control, and increases the success rate of device control service execution. The technical solution is as follows:

[0006] According to one aspect of this application, a device control method is provided, the method comprising: acquiring resource data of a target space; the resource data being related to status data reported by each device in the target space; searching for a trigger condition matching the resource data of the target space in configured linkage data; the trigger condition in the linkage data being configured based on the resource data of the target space; determining a device control service associated with the found trigger condition based on the association relationship between the trigger condition in the linkage data and a device control service; obtaining a device control instruction for a target device based on the determined device control service, and sending the device control instruction to the target device, causing the target device to respond to the device control instruction and perform a corresponding action.

[0007] According to one aspect of this application, a device control apparatus includes: a data acquisition module for acquiring resource data of a target space; the resource data being related to status data reported by each device in the target space; a condition lookup module for searching for triggering conditions matching the resource data of the target space in configured linkage data; the triggering conditions in the linkage data being configured based on the resource data of the target space; a service determination module for determining a device control service associated with the found triggering conditions based on the association relationship between the triggering conditions in the linkage data and device control services; and an instruction sending module for obtaining a device control instruction for a target device based on the determined device control service, and sending the device control instruction to the target device, causing the target device to respond to the device control instruction and perform a corresponding action.

[0008] In an exemplary embodiment, the data acquisition module includes: a first direct calculation unit, configured to calculate resource data of the target space based on status data reported by each device in the target space if the target space is a subspace; a first subspace determination unit, configured to determine each subspace belonging to the target space if the target space is a parent space; a second direct calculation unit, configured to calculate resource data of the target space based on status data reported by each device in each subspace belonging to the target space; or an indirect calculation unit, configured to calculate resource data belonging to each subspace belonging to the target space based on status data reported by each device in each subspace belonging to the target space, and to synthesize the resource data belonging to each subspace belonging to the target space into resource data of the target space.

[0009] In an exemplary embodiment, the device control service is used to instruct a space device to perform a corresponding action, the space device being created based on the space to which the target device belongs; the instruction sending module includes: a candidate device determination unit, used to determine at least one device with the same device attributes as the space device in the space to which the target device belongs, based on the space device indicated by the device control service; a target device determination unit, used to determine the target device based on each device with the same device attributes as the space device; and an instruction generation unit, used to generate a device control instruction for the target device based on the target device and the corresponding action performed by the space device indicated by the device control service; the device control instruction is used to instruct the target device to perform the corresponding action.

[0010] In an exemplary embodiment, the target device determination unit includes: a habit mining subunit, used to mine device usage habits based on historical behavior data; and a device filtering subunit, used to filter out the target device that conforms to the device usage habits from among devices that have the same device attributes as the space device.

[0011] In one exemplary embodiment, the instruction sending module includes: a first direct sending unit, configured to send the device control instruction to the target device if the space to which the target device belongs is a subspace; a third subspace determination unit, configured to determine each subspace in the space to which the target device belongs if the space to which the target device belongs is a parent space; a first indirect sending unit, configured to send the device control instruction to each network device in each subspace of the space to which the target device belongs, such that the device control instruction is forwarded to the target device through each of the network devices; or a second direct sending unit, configured to directly send the device control instruction to the target device.

[0012] In one exemplary embodiment, the apparatus further includes: a space update module, configured to acquire the binding relationship between each device in the target space and the target space, and update the space to which each device belongs based on the binding relationship; and a data update module, configured to receive status data reported by each device after updating its space, and update the resource data of the target space according to the status data reported by each device in the target space.

[0013] In one exemplary embodiment, the apparatus further includes: a binding request receiving module, configured to receive binding requests initiated by each device in the target space; and a connection establishment module, configured to establish a connection between the target space and each device therein in response to the binding request, thereby enabling each device to store a binding relationship with the target space.

[0014] In one exemplary embodiment, the apparatus further includes: a push message generation module, configured to generate a push message about a linkage configuration entry if the target space is consistent with the space to which the target device belongs, so as to display the linkage configuration entry in the client; a configuration request receiving module, configured to receive a linkage configuration request; the linkage configuration request is generated by a trigger operation on the linkage configuration entry, the linkage configuration entry being used to indicate whether to configure corresponding linkage data based on the resource data of the target space and the device control service; and a data extraction module, configured to extract and store the linkage data configured by the linkage configuration entry from the linkage configuration request, so as to find a trigger condition that matches the resource data of the target space in the configured linkage data.

[0015] According to one aspect of this application, an electronic device includes: at least one processor, at least one memory, and at least one communication bus, wherein a computer program is stored in the memory, and the processor reads the computer program from the memory via the communication bus; when the computer program is executed by the processor, it implements the device control method described above.

[0016] According to one aspect of this application, a storage medium stores a computer program thereon, which, when executed by a processor, implements the device control method described above.

[0017] According to one aspect of this application, a computer program product includes a computer program stored in a storage medium, a processor of a computer device reads the computer program from the storage medium, and the processor executes the computer program, causing the computer device to implement the device control method as described above when executed.

[0018] The beneficial effects of the technical solution provided in this application are:

[0019] In the above technical solution, based on resource data indicating the spatial state of the target space, trigger conditions matching the resource data of the target space can be found in the configured linkage data. Then, based on the association between the trigger conditions and device control services in the linkage data, the device control service associated with the found trigger conditions is determined. Thus, a device control command for the target device is obtained according to the determined device control service and sent to the target device, causing the target device to respond to the device control and execute the corresponding action. In other words, the automated device control service is no longer limited to being bound to the device state; it can also be provided by the target space. For example, "turn on the bedroom light" can be pre-configured in the client based on the target space (bedroom) instead of "turn on the bedroom lamp" based on the device (bedroom lamp). In this case, even if the bedroom lamp is offline or malfunctioning, it will not affect the implementation of "turn on the bedroom light." This avoids the phenomenon that the device cannot automatically execute the pre-configured action due to the trigger condition not being met because of device failure. This avoids the need to reconfigure the automated device control service, saves the user's reconfiguration cost, improves the efficiency of automated control, and greatly improves the execution success rate of the device control service. Attached Figure Description

[0020] To more clearly illustrate the technical solutions provided in this application, the accompanying drawings used in the description of the various embodiments of this application will be briefly introduced below.

[0021] Figure 1 This is a schematic diagram of the implementation environment according to the embodiments of this application;

[0022] Figure 2 This is a schematic diagram of the linkage data configuration in the automation scenario according to the embodiments of this application;

[0023] Figure 3 This is a flowchart illustrating a device control method according to an exemplary embodiment;

[0024] Figure 3a yes Figure 3 A schematic diagram of the interface displaying resource data of the target space involved in the corresponding embodiment on the user terminal;

[0025] Figure 3b yes Figure 3 A schematic diagram of the linkage data configuration framework for automated device control services involved in the corresponding embodiment;

[0026] Figure 3c yes Figure 3 Schematic diagrams of different forms of linkage data involved in the corresponding embodiments;

[0027] Figure 4a yes Figure 3 A schematic diagram illustrating the calculation method of resource data of the target space involved in the corresponding embodiment;

[0028] Figure 4b yes Figure 3 A schematic diagram illustrating the transmission of device control commands in the corresponding embodiment;

[0029] Figure 5 This is a flowchart illustrating another device control method according to an exemplary embodiment;

[0030] Figure 6 yes Figure 5 A flowchart of step 420 in one embodiment corresponds to the following example;

[0031] Figure 7a This is a flowchart illustrating another device control method according to an exemplary embodiment;

[0032] Figure 7b yes Figure 7a A schematic diagram of the linkage configuration entry involved in the corresponding embodiment;

[0033] Figure 8 yes Figure 3 A flowchart of step 370 in one embodiment corresponds to the following example;

[0034] Figure 9 yes Figure 8 A flowchart of step 373 in one embodiment corresponds to the following example;

[0035] Figure 10This is a structural block diagram of a device control apparatus according to an exemplary embodiment;

[0036] Figure 11 This is a hardware structure diagram of a server according to an exemplary embodiment;

[0037] Figure 12 This is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0038] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0039] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0040] As mentioned earlier, since the device control service is bound to the device status, when some devices providing the device control service are offline or malfunction, the automated device control service will not be able to function. In this case, the automated device control service needs to be reconfigured, which will increase the operation and maintenance costs of device control.

[0041] Currently, device control services are typically configured manually by users through a client. The number and types of devices affect the complexity of the configuration. As the number and types of devices increase, the configuration of device control based on these devices becomes increasingly cumbersome, which not only increases the complexity of the configuration but also greatly increases the learning cost for users.

[0042] When the number and types of devices are small, the configuration logic is relatively clear, the configuration process is relatively simple, and users can easily get started. For example, if there is only one table lamp in the bedroom, the user can accurately control the table lamp to turn on by configuring the device control command "turn on the light".

[0043] However, as the number and types of devices increase, the configuration logic becomes relatively ambiguous, significantly increasing the difficulty of configuration. Furthermore, depending on the needs of different scenarios, devices may have interactive relationships, or different devices may require different control commands. This forces users to invest more time and effort in configuration to avoid the risk of errors, greatly increasing the learning curve. For example, bedroom lights may include chandeliers, table lamps, and nightlights. If a user configures the control command "turn on the light," they cannot determine which light will be turned on. In this case, the user not only needs to clearly understand the various types of lights in the bedroom but also needs to configure corresponding control commands for each type of light to specify which type of light in the bedroom will be turned on.

[0044] Furthermore, for configured device control commands, if the device changes, such as going offline or malfunctioning, or if the spatial layout of the device changes, such as moving the device from the bedroom to the living room, the successful execution of the device control commands will inevitably be affected if they are not reconfigured. This will not only increase the operation and maintenance costs of device control, but also lack flexibility and self-improvement capabilities, ultimately affecting the user experience.

[0045] As can be seen from the above, the relevant technologies still have shortcomings such as cumbersome user operation, high maintenance costs for equipment control, and the success rate of automated configuration execution being easily affected.

[0046] Therefore, the device control method provided in this application can effectively reduce the operation and maintenance costs of device control, and can also effectively reduce the complexity of configuration in device control. Accordingly, the device control method is applicable to device control devices, which can be deployed on electronic devices, such as gateways, servers, etc.

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0048] Figure 1 This is a schematic diagram of an implementation environment involved in a device control method. The implementation environment includes a user terminal 110, a smart device 130, a gateway 150, a server 170, and a router 190.

[0049] Specifically, user terminal 110, which can also be considered as user terminal or terminal, can deploy (or install) the client associated with smart device 130. This user terminal 110 can be a smartphone, tablet, laptop, desktop computer, smart control panel, or other electronic device with display and control functions, etc., without limitation here.

[0050] The client, associated with the smart device 130, is essentially where the user registers an account and configures the smart device 130. For example, the configuration includes adding a device identifier to the smart device 130, so that when the client runs on the user terminal 110, it can provide the user with functions such as device display and device control of the smart device 130. This client can be in the form of an application or a web page. Correspondingly, the interface for displaying and controlling the device on the client can be in the form of a program window or a web page, and there is no limitation here.

[0051] Smart device 130 is deployed in gateway 150 and communicates with gateway 150 through its own configured communication module, thereby being controlled by gateway 150. It should be understood that smart device 130 generally refers to one of multiple smart devices 130. This application embodiment only uses smart device 130 as an example; that is, this application embodiment does not limit the number or type of smart devices deployed in gateway 150. In one application scenario, smart device 130 is deployed in gateway 150 by accessing it through a local area network. The process of smart device 130 accessing gateway 150 through a local area network includes: gateway 150 first establishes a local area network, and smart device 130 joins the local area network established by gateway 150 by connecting to it. This local area network includes, but is not limited to, ZIGBEE or Bluetooth. Among them, the smart device 130 can be a smart printer, smart fax machine, smart camera, smart air conditioner, smart door lock, smart light, smart speaker, smart TV, smart refrigerator, or electronic devices such as human body sensor, door and window sensor, temperature and humidity sensor, water immersion sensor, natural gas alarm, smoke alarm, wall switch, wall socket, wireless switch, wireless wall sticker switch, cube controller, curtain motor, etc., equipped with a communication module.

[0052] The interaction between user terminal 110 and smart device 130 can be achieved through a local area network (LAN) or a wide area network (WAN). In one application scenario, user terminal 110 establishes a wired or wireless communication connection with gateway 150 via router 190, such as Wi-Fi, allowing user terminal 110 and gateway 150 to be deployed on the same LAN, thus enabling user terminal 110 to interact with smart device 130 via the LAN path. In another application scenario, user terminal 110 establishes a wired or wireless communication connection with gateway 150 via server 170, such as 2G, 3G, 4G, 5G, or Wi-Fi, allowing user terminal 110 and gateway 150 to be deployed on the same WAN, thus enabling user terminal 110 to interact with smart device 130 via the WAN path.

[0053] The server-side 170 can also be considered as the cloud, cloud platform, platform side, server side, etc. This server-side 170 can be a single server, a server cluster consisting of multiple servers, or a cloud computing center consisting of multiple servers, in order to better provide backend services to a massive number of user terminals 110. For example, backend services include device control services.

[0054] Assuming an automation scenario has been configured to provide automation-based device control services, such as... Figure 2 As shown, the scene identifier "Homecoming Scene" displayed on the scene display page 302 indicates the configured automated scene 306. When a user clicks on the scene identifier "Homecoming Scene" of automated scene 306, they will enter the scene details page 701 of automated scene 306. On the scene details page 701, the linkage data configured in automated scene 306 includes trigger conditions and actions performed by the device. Specifically, the displayed trigger condition is: someone is in the entryway; the displayed actions performed by the device are: turn on the living room lights and turn on the living room air conditioner. It also displays an entry point 703 for adding new trigger conditions and an entry point 706 for adding actions performed by the device. In addition, the trigger conditions can be modified through control 702, and the actions performed by the device can be modified through controls 704 and 705. Based on this, with the configuration of the linkage data related to the automation scenario 306, when the user returns home and causes the smart door lock to open, it is considered that the trigger condition "someone is in the entrance hall" configured in the automation scenario 306 has been met. At this time, the devices configured with actions in the automation scenario 306, namely the living room light and the living room air conditioner, can automatically execute the corresponding actions, that is, automatically turn on the living room light and automatically turn on the living room air conditioner, thereby realizing the automatic execution of the homecoming scenario.

[0055] Once the user configures the linkage data related to the automated device control service using the client in the user terminal 110, they can request the gateway 150 / server 170 to provide the device control service to the user.

[0056] Specifically, taking server 170 as an example, after acquiring resource data indicating the spatial status of the target space, it can search for triggering conditions matching the resource data of the target space in the linkage data (e.g., someone is in the entryway). Then, based on the association between the triggering conditions and device control services in the linkage data, it determines the device control service associated with the found triggering conditions (e.g., turning on the living room lights, turning on the living room air conditioner, etc.), and obtains device control instructions (e.g., turning on the living room lights, turning on the living room air conditioner, etc.) for the target device 130 (e.g., the living room lights, the living room air conditioner, etc.). At this time, for the target device 130, after server 170 sends the device control instruction to the target device 130, it can receive the device control instruction and perform the corresponding action in response to the device control instruction.

[0057] Please see Figure 3 This application provides a device control method, which is applicable to electronic devices, specifically electronic devices that can be... Figure 1 The server-side 170 shown in the implementation environment can also be... Figure 1 The gateway 150 in the implementation environment is shown.

[0058] In the following method embodiments, for ease of description, the execution subject of each step of the method is an electronic device, but this does not constitute a specific limitation.

[0059] like Figure 3 As shown, the method may include the following steps:

[0060] Step 310: Obtain resource data for the target space.

[0061] Among them, the resource data is related to the status data reported by each device in the target space.

[0062] First, it should be clarified that the target space refers to the space set up to provide device control services to users. This space can be a room or area set up in various scenarios. For example, in a smart home scenario, the target space can specifically refer to the living room, bedroom, study, dining room, kitchen, etc. set up in the smart home scenario, or it can be the entire family that includes the living room, bedroom, study, dining room, kitchen, etc., as the target space. Alternatively, the living room can be regarded as a reception area, the dining room as a dining area, and the bedroom and study as leisure areas, thus obtaining different target spaces. In a smart park scenario, the target space can be the entertainment area, fitness area, leisure area, etc. set up in the smart park scenario. There is no specific limitation on the type of target space here.

[0063] It's understandable that the type of target space matters; a target space can be either a parent space or a sub-space. Taking a smart home scenario as an example, if the target space is a living room, it's considered a sub-space. If the target space is a leisure area including a bedroom and a study, it's considered a parent space, which includes other sub-spaces like the bedroom and study. In other words, the parent space contains other sub-spaces, but a sub-space does not contain other sub-spaces. However, even if the type of target space is the same, whether it's a parent space may differ in different scenarios. For instance, in a smart home scenario, if the target space is a leisure area including a bedroom and a study, it's the parent space. But in a smart park scenario, if the target space is a leisure area, it's a sub-space.

[0064] Table 1. Calculation Strategy for Resource Data in the Target Space (Part 1)

[0065]

[0066] As shown in Table 1, the resource data of the target space is related to the status data reported by each device in the target space. The status data of each device is reported to the electronic device to indicate the device status. The device status can be used to describe the working condition of the device, such as online, offline, or faulty. It can also be used to describe the working mode of the device, such as the temperature sensed by the temperature sensor, the humidity sensed by the humidity sensor, and the presence of people reflected by the temperature sensed by the human body sensor. It can be understood that the resource data of the target space can be used to describe the occupancy status of the target space, such as whether the target space is empty or occupied. It can also be used to describe the specific occupancy status of the target space, such as whether the target space is used for sleeping, reading, eating, meeting guests, leisure, watching movies, or getting up at night. It can also be used to describe behavioral events related to the target space, such as entering the target space and leaving the target space, which are not limited here.

[0067] In one possible implementation, if the target space is the parent space, then each subspace belonging to the target space is determined, and the resource data of the target space is calculated based on the status data reported by each device in each subspace belonging to the target space, in order to determine the spatial status of the parent space.

[0068] Specifically, such as Figure 4a As shown, the calculation of resource data includes direct calculation and indirect calculation. The direct calculation method includes the following steps: calculating the resource data of the target space based on the status data reported by each device in each subspace belonging to the target space. The indirect calculation method includes the following steps: calculating the resource data of each subspace belonging to the target space based on the status data reported by each device in each subspace belonging to the target space, and combining the resource data of each subspace belonging to the target space into the resource data of the target space.

[0069] Using Table 1 as an example, suppose the target space is a family home, which serves as the parent space. This family home includes sub-spaces such as the entryway and living room. Human body sensors a and b are installed in the entryway, and human body sensor c is installed in the living room. For each sub-space, the status data of each human body sensor includes at least the temperature sensed by each sensor, reflecting whether someone is in that sub-space. Regarding the spatial status of the family home, i.e., whether someone is in the family home, if the temperatures sensed by human body sensors a and b indicate someone is in the entryway, while the temperature sensed by human body sensor c indicates no one is in the living room, one approach is to combine the temperatures sensed by human body sensors a and b into the temperature sensed by the entryway (indicating someone is in the entryway), then use the temperature sensed by human body sensor c as the temperature sensed by the living room (indicating no one is in the living room), and finally determine the temperature sensed by the family home based on the combined temperatures sensed by the entryway and living room, thus determining whether someone is in the family home. Alternatively, one approach is to directly combine the human body sensors in each sub-space to determine whether someone is in the family home; that is, if the temperature sensed by any one of human body sensors a, b, or c indicates someone is in that sub-space, then the temperature sensed by the family home indicates someone is in the family home.

[0070] In one possible implementation, if the target space is a subspace, the resource data of the target space is calculated based on the status data reported by each device in the target space, and used to determine the spatial status of the subspace.

[0071] Using the previous example and Table 1 for illustration, let's assume the target space is the entryway (i.e., the room), which is a subspace and does not include other subspaces. Then, assuming human body sensors a and b are installed in the entryway, the status data of each sensor for the entryway must include at least the temperature sensed by each sensor, to indicate whether there is someone in the entryway.

[0072] Based on this, the spatial state of the entryway, i.e. whether there are people in the entryway, is based on the temperature detected by the entryway sensors. The temperature detected by the entryway sensors is determined based on the temperature detected by either human body sensor a or b in the entryway.

[0073] As can be seen from the above, the spatial state of the parent space can be directly determined by the status data reported by each device in each of its subspaces. In this way, the data source is accurate, which helps to improve the accuracy of spatial state determination, especially suitable for situations where the number of subspaces is small and the total number of devices in each subspace is small. Alternatively, the resource data of each subspace can be determined first by the status data reported by each device in each of its subspaces, and then indirectly determined by the resource data of each subspace. In this way, the efficiency of spatial state determination can be improved, especially suitable for situations where the spatial structure is more complex and the total number of devices in each subspace is large. This embodiment does not limit the method of determining the spatial state.

[0074] Of course, in addition to calculating resource data reflecting the spatial status of the target space, such as whether there are people or whether it is comfortable, based on the status data reported by temperature sensors, humidity sensors, human body sensors, etc., as shown in Table 1, in other embodiments, resource data of the target space can also be calculated based on the status data reported by other devices. The calculation strategy is shown in Table 2, which does not constitute a specific limitation.

[0075] Table 2. Calculation Strategy for Resource Data in the Target Space (Part Two)

[0076]

[0077] Once the resource data of the target space is obtained, it can be used as a basis to provide users with automated equipment control services.

[0078] It is worth mentioning that the electronic device can also send the acquired resource data of the target space to the user terminal, so that the user terminal can provide the user with a real-time environmental display of the target space based on the received resource data of the target space, so that the user can have a clearer and more intuitive understanding of the real-time environmental conditions of the target space, and thus configure the device control service more accurately. Figure 3a This image shows a schematic diagram of the interface displaying resource data of the target space on the user terminal. Figure 3a Using the home as the target space, the system not only displays the daily and monthly energy consumption of the home, but also the real-time temperature of multiple sub-spaces within the home (such as the master bedroom, secondary bedroom, and living room), as well as the status of different types of equipment in these sub-spaces (such as lights on and air conditioners on).

[0079] Step 330: In the configured linkage data, find the triggering conditions that match the resource data of the target space.

[0080] The triggering conditions in the linkage data are configured based on the resource data of the target space.

[0081] In other words, the resource data of the target space that matches the triggering conditions can be considered as the resource data of the target space that enables the triggering conditions to be met.

[0082] Please refer back to Figure 2 Taking the "coming home" scenario as an example of an automated scenario, the linked data configured in the "coming home" scenario includes: the trigger condition is "someone is in the entryway," and the device control services are "turn on the living room lights" and "turn on the living room air conditioner." In other words, this linked data at least indicates that if the resource data of the target space allows the trigger condition "someone is in the entryway" to be met, then the device control services "turn on the living room lights" and "turn on the living room air conditioner" will be executed. Here, the target space is the entryway, the resource data of the target space refers to the temperature sensed by the human body sensor in the entryway, reflecting whether someone is in the entryway, and the device control services refer to turning on the living room lights and turning on the living room air conditioner.

[0083] Therefore, if the temperature detected by any human body sensor in the entryway indicates that there is someone in the entryway, it means that the resource data of the target space (there is someone in the entryway) has satisfied the triggering condition of the linkage data configured in the "coming home scene". In other words, the triggering condition that matches the resource data of the target space is found in the linkage data.

[0084] In this approach, whether the triggering condition is met depends on the resource data of the target space (that someone is in the entryway), and no longer on a specific device (human sensor a or b). Therefore, if a device changes, such as human sensor a going offline or malfunctioning, the change in human sensor a will not affect the successful triggering of the triggering condition because human sensor b in the entryway is still online. This fully guarantees the success rate of the device control service and improves the flexibility and scalability of the device control service, thereby enhancing the user experience.

[0085] It should be noted that the linkage data is pre-configured by the client in the user terminal so that electronic devices (such as servers) can provide users with automated device control services. After the user terminal completes the configuration of the linkage data for each automation scenario, the electronic device can receive and store the linkage data sent by the user terminal. This allows it to retrieve the configured linkage data and search for triggering conditions that match the resource data in the target space when providing automated device control services to the user.

[0086] In one possible implementation, the device control service is used to instruct spatial devices to perform corresponding actions; the spatial devices are created based on the space to which the target devices belong. For example, if the target devices are living room air conditioner A and living room air conditioner B, then the corresponding spatial devices can be created based on the living room space to which living room air conditioner A and living room air conditioner B belong. This can be understood as spatial devices referring to any air conditioning device in the living room. Therefore, if the device control service is "all living room air conditioners on", it instructs all air conditioners (air conditioner A and air conditioner B) in the living room to perform the corresponding turning-on action.

[0087] In one possible implementation, the device control service is used to instruct the target device to perform a corresponding action. For example, if the device control service is "Turn on air conditioner A in the living room", then the target device air conditioner A is instructed to perform the corresponding turn-on action.

[0088] Figure 3b A schematic diagram illustrates the linkage data configuration framework for automated device control services. Figure 3b In the interface 301, the configuration method for linkage data of devices is shown. In the linkage data of devices, the trigger condition 302 can be configured according to the device status of the device, and the device control service 303 can be used to instruct the target device to perform corresponding actions. The interface 304 also shows the configuration method for linkage data of space. In the linkage data of space, the trigger condition 305 can be configured according to the resource data of the target space, and the device control service 306 can be used to instruct the space devices to perform corresponding actions. The resource data of the target space is calculated from the device status of each device in the target space based on the calculation strategy 307, and the device control service is converted into device control instructions for the target device based on the calculation strategy 308.

[0089] Therefore, by combining the configuration methods for device-related linkage data and the configuration methods for space-related linkage data, such as Figure 3c As shown, device-triggered-space-executed linkage data 401, space-triggered-space-executed linkage data 402, and space-triggered-device-executed linkage data 403 can be configured. Through these linkage data in different forms, automated device control services can be realized. This does not affect the original flexibility and openness, but also greatly reduces the user's understanding and learning costs, thereby facilitating the large-scale control of operation and maintenance costs in device control.

[0090] Step 350: Based on the association between the triggering conditions and the device control services in the linkage data, determine the device control services that are associated with the found triggering conditions.

[0091] As mentioned earlier, the triggering conditions and device control services with related relationships in the linkage data are pre-configured by the user through the client in the user terminal. In other words, the linkage data actually stores the relationship between the triggering conditions and the device control services.

[0092] Still with Figure 2 The "Homecoming Scene" example illustrates this. The linked data configured in this "Homecoming Scene" includes: the trigger condition is "someone is in the entryway," and the device control services are "turn on the living room lights" and "turn on the living room air conditioner." Therefore, this linked data essentially stores the association between the trigger condition "someone is in the entryway" and the device control services "turn on the living room lights" and "turn on the living room air conditioner."

[0093] Therefore, after determining that the trigger condition is "there is someone in the entryway", the device control service can be obtained as "turn on the living room lights and turn on the living room air conditioner" based on the association stored in the above linkage data.

[0094] Step 370: Obtain the device control command for the target device based on the determined device control service, and send the device control command to the target device.

[0095] Among them, equipment control commands are used to instruct the target equipment to perform corresponding actions.

[0096] After determining the device control service, it is possible to further determine the device control commands for the target device. Using the previous example, suppose there is a light (d) and an air conditioner (e) installed in the living room. After obtaining the device control service as "turn on the living room light, turn on the living room air conditioner," it is possible to further obtain device control command 1 for the light (d) and device control command 2 for the air conditioner (e). Device control command 1 is used to turn on the light (d), and device control command 2 is used to instruct the air conditioner (e) to turn on.

[0097] Of course, in other embodiments, the way the device control service obtains device control instructions for the target device is as shown in Table 3, which is not intended to constitute a specific limitation.

[0098] Table 3 Equipment Control Services and Equipment Control Commands for Target Equipment

[0099]

[0100]

[0101] It's understandable that, since the living room is a sub-space and doesn't contain other sub-spaces, once the device control command for the target device is determined, the corresponding device control command can be sent directly to the target device. In other words, in one possible implementation, if the space to which the target device belongs is a sub-space, the device control command is sent directly to the target device.

[0102] For example, device control command 1 is sent to light d in the living room, and device control command 2 is sent to air conditioner e in the living room. Upon receiving the device control commands, the target devices can respond and perform the corresponding actions. For example, light d will turn on, and air conditioner e will turn on.

[0103] As mentioned earlier, depending on the type, a space is not limited to subspaces; it can also be a parent space. For example, a home, as the parent space, can also include subspaces such as a living room, bedroom, study, dining room, and kitchen. In this case, after determining the device control command for the target device, and considering the space to which the target device belongs as the parent space, there are two command sending methods: indirect sending and direct sending. In one possible implementation, indirect sending means that if the space to which the target device belongs is the parent space, then each subspace within that space is identified, and the device control command is sent to each network device within that subspace, so that the device control command is forwarded to the target device through each network device. In another possible implementation, direct sending means that if the space to which the target device belongs is the parent space, then each subspace within that space is identified, and the device control command is sent directly to the target device.

[0104] For example, if the target device belongs to a home, then the sub-spaces of the home include, but are not limited to, the living room, study, and bedroom. If the device control service provided by the home is "all lights on", assuming that lights d, f, and g are installed in the living room, study, and bedroom respectively, then device control command 3 for light d in the living room, device control command 4 for light f in the study, and device control command 5 for light g in the bedroom can be determined. At this time, as shown in Figure 4, device control commands 3-5 can be sent directly to lights d, f, and g respectively through a wide area network path (shown by the dotted line in Figure 4). Alternatively, device control commands 3-5 can be sent first to the living room network device, study network device, and bedroom network device to which lights d, f, and g are respectively connected, and then the living room network device, study network device, and bedroom network device to which lights d, f, and g are respectively connected can send device control commands 3-5 to lights d, f, and g respectively through a local area network path (shown by the solid line in Figure 4). Therefore, after receiving the device control commands 3-5 respectively, each target device (lamp d, f, g) can respond to the device control commands 3-5 and perform the corresponding action (turn on).

[0105] Through the above process, device control services provided by the space are realized. For users, the automated device control service is no longer limited to being bound to the device status. It can also be provided by the target space. Even if a device in the target space is offline or malfunctions, it will not affect the implementation of the device control service. This decoupling from the device status not only avoids the phenomenon that the device cannot automatically execute the pre-configured actions due to the failure of the triggering conditions to be met due to device failure, but also avoids the need to reconfigure the automated device control service, saving users the cost of reconfiguration and the operation and maintenance cost of device control, improving the efficiency of automated control, and greatly improving the success rate of device control service execution. Moreover, it allows users to not need to pay attention to the specific number and type of devices in the target space, thereby helping to reduce the complexity of configuration in device control.

[0106] Furthermore, based on the status data reported by each device in different subspaces, resource data of different subspaces and the parent space are provided, which can form device resource sharing in the global space. This can more flexibly meet the user's automation configuration requirements in different scenarios, thereby providing better device control services to users and improving the user experience.

[0107] Please see Figure 5 In an exemplary embodiment, prior to step 310, the method may further include the following steps:

[0108] Step 440: Obtain the binding relationship between each device in the target space and the target space, and update the space to which each device belongs based on the binding relationship.

[0109] Specifically, prior to step 440, the binding process between each device in the target space and the target space includes the following steps:

[0110] Step 420: Receive binding requests initiated by each device in the target space.

[0111] The binding request is used to bind the device to the target space, or it can be considered as an instruction to establish a connection between the device and the target space.

[0112] In one possible implementation, for a device, the binding request is sent based on the distance to multiple network devices. For example, a device can send a binding request to the network device closest to it in order to establish a binding relationship between the device and the space to which that network device belongs. Here, the network devices can be applicable to... Figure 1 The gateway 150 shown in the implementation environment is not intended to constitute a specific limitation.

[0113] Specifically, such as Figure 6 As shown, step 420 may include the following steps:

[0114] Step 421: Broadcast a network access signal to the device, so that the device responds to the network access signal, measures the distance between the network devices, and determines the distance between the device and the network devices.

[0115] In other words, in this embodiment, the distance between the device and the network device is obtained by the device measuring the distance to the network device.

[0116] The ranging process specifically refers to the fact that, for network devices, they can broadcast network access signals to various devices belonging to the same or different spaces. Correspondingly, each device can receive multiple network access signals broadcast by multiple network devices in the same or different spaces.

[0117] Based on the received multiple incoming signals, the distances between the device and the multiple network devices broadcasting these signals can be calculated using the formula d = 10^((abs(RSSI)-A) / (10×n)). Here, d represents the distance between the device and the network device broadcasting the incoming signal, RSSI represents the signal strength of the incoming signal, A and n are hyperparameters, where A represents the signal strength of the incoming signal when the device and the network device are 1 meter apart, and n represents the propagation coefficient of the incoming signal, which can also be considered as the environmental attenuation factor.

[0118] Step 423: The receiving device sends a binding request based on the distance between itself and multiple network devices.

[0119] For each device, after determining the distance between it and multiple network devices, it can select one network device from the multiple network devices to connect to based on the distance between the device and the network devices. Then, as the device connects to the network device, a binding relationship can be established between the device and the space to which the network device belongs.

[0120] In this embodiment, the device selects the network device closest to it to send a binding request. Specifically, after determining the network device closest to it, the device requests to establish a communication connection with that network device, and then sends a binding request to that network device based on the established communication connection. For example, in Figure 4, light d in the living room can receive network access signals sent by the living room network device, the study network device, and the bedroom network device. Since light d is closest to the living room network device, a binding relationship can be established between light d and the living room by sending a binding request to the living room network device. In other words, light d can be considered a device in the living room. Similarly, light f is considered a device in the study, and light g is considered a device in the bedroom.

[0121] Of course, in other embodiments, the device may also send the binding request directly based on the signal strength of the network access signal broadcast by the network device. For example, the device may send a binding request to the network device with the strongest signal strength of the broadcast network access signal. This embodiment does not constitute a specific limitation in this regard.

[0122] Furthermore, to improve the accuracy of binding between the device and the target space, a signal strength threshold and / or a distance threshold can be set. Only when the network signal strength exceeds this threshold, and / or the distance between the device and the network device broadcasting the network signal exceeds the distance threshold, is the device allowed to send a binding request to the corresponding network device. This approach effectively reduces the possibility of binding errors. Of course, in other embodiments, the user can also manually adjust the binding between the device and the target space using a user terminal if inaccurate binding is detected.

[0123] Step 430: In response to the binding request, establish a connection between the target space and each device therein, thereby enabling each device to store the binding relationship with the target space.

[0124] After receiving a space binding request from another device, the network device determines that the device requests to bind to the space where the network device is located. Then, a connection is established between the two devices to store the association between the space where the device and the network device are located, thus providing a basis for the automatic updating of the space to which the device belongs.

[0125] Suppose a smart speaker is located in the bedroom and a smart TV is located in the living room. The smart TV in the living room is associated with the living room; the smart speaker in the bedroom is associated with the bedroom, not the living room. If the smart speaker is moved from the bedroom to the living room, it will disconnect from the network devices in the bedroom and establish a connection with the network devices in the living room. This unbinds the smart speaker from the bedroom and binds it to the living room, storing the association between the smart speaker and the living room. Based on this association, the smart speaker's location can then automatically update from the bedroom to the living room.

[0126] As can be seen, as the device moves in different spaces, it will establish connections with network devices in different spaces, thereby enabling the device to bind to different spaces and store the association between the device and different spaces accordingly, strengthening the association between the device and the space, and thus enabling the automatic updating of the space to which the device belongs.

[0127] Step 450: Receive the status data reported by each device after updating its own space, and update the resource data of the target space according to the status data reported by each device in the target space.

[0128] That is to say, whether the device status of the device changes or the device moves in different target spaces, the resource data of the target space is always calculated in real time according to the status data reported by each device after updating the belonging space, so as to ensure that the device control service based on automation is not affected.

[0129] Further, it should be noted that the above steps are all automatically completed without manual operation by the user. When the position of the device or the network device changes, the device will re-send a new binding request to the corresponding network device based on the network access signal, and then update the space to which the device belongs in a timely manner, so that the resource data of the target space can be updated in a timely manner, so as to ensure that the trigger condition in the linkage data can be successfully satisfied without affecting the implementation of the device control service based on automation.

[0130] Please refer to Figure 7a , in an exemplary embodiment, before step 330, the method may further include the following steps:

[0131] Step 510, receiving a linkage configuration request.

[0132] The linkage configuration request is generated by a triggering operation on the linkage configuration entry, and the linkage configuration entry is used to indicate whether to configure corresponding linkage data according to the resource data of the target space and the device control service.

[0133] To facilitate the user to configure the linkage data, the electronic device will send a push message about the linkage configuration entry to the user terminal, so that the user terminal can provide the linkage configuration entry to the user, that is, display the linkage configuration entry in the client. If the user performs a corresponding triggering operation on the linkage configuration entry, it can quickly indicate whether the electronic device configures corresponding linkage data according to the resource data of the target space and the device control service. Among them, the resource data of the target space is used to configure the trigger condition in the linkage data.

[0134] Figure 7b Shows a schematic diagram of the linkage configuration entry in an embodiment. As Figure 7b shown, in the automation scenario "home scenario", multiple linkage configuration entries are provided for the user to configure flexibly. Among them, the linkage configuration entry 707 is used to indicate whether to establish an association between the trigger condition "someone is in the entrance hall" and the device control service "turn on the lights in the living room", the linkage configuration entry 708 is used to indicate whether to establish an association between the trigger condition "someone is in the living room" and the device control service "turn on the air conditioner in the living room", and the linkage configuration entry 709 is used to indicate whether to establish an association between the trigger condition "someone is in the living room" and the device control service "turn on all the lights in the house". It should be noted here that the linkage configuration entry can be displayed in any control form (such as a switch), and this is not a specific limitation.

[0135] exist Figure 7b In the interface, each linkage configuration entry is displayed as a switch. For linkage configuration entry 707, if the user slides the switch to "on," it means the user expects the living room lights to turn on when someone is in the entryway. The sliding action is considered a trigger operation for the linkage configuration entry. It's worth noting that the specific behavior of the trigger operation can vary depending on the input components configured on the user's terminal (such as a touch layer, mouse, keyboard, etc. covering the display screen). For example, for a smartphone with a touch layer, the trigger operation could be a click or swipe gesture; while for a laptop with a mouse, the trigger operation could be a drag, single click, double click, or other mechanical operation—there is no limitation here.

[0136] When a user performs a corresponding trigger operation on the linkage configuration entry 707, the user terminal can detect this trigger operation, thereby determining the corresponding linkage data "someone is in the entryway, living room lights on". Based on this linkage data, the terminal initiates a linkage configuration request to the electronic device, instructing the electronic device to establish an association between the trigger condition and the device control service. In this linkage data, the trigger condition is "someone is in the entryway", and the device control service is "living room lights on".

[0137] In one possible implementation, the linkage configuration entry point is set to be consistent between the target space and the target device's space. That is, if the target space and the target device's space are consistent, a push message about the linkage configuration entry point is generated to display the entry point on the client. Then, based on a trigger operation targeting this entry point, a linkage configuration request is initiated to the electronic device, instructing the electronic device to configure the corresponding linkage data according to the resource data of the target space and the device control service. For example, suppose the linkage data is "Turn on the bedroom air conditioner when the bedroom temperature is below 23℃". In this linkage data, the target space is the bedroom, the target device is the bedroom air conditioner, and the target device's space is the bedroom.

[0138] Step 530: Extract and store the linkage data configured by the linkage configuration entry point from the linkage configuration request, so as to find the triggering conditions that match the resource data of the target space in the configured linkage data.

[0139] For electronic devices, after receiving a linkage configuration request carrying linkage data, they can extract the linkage data and store it so that when providing users with automated device control services, they can obtain the stored linkage data to search for trigger conditions that match the resource data of the target space.

[0140] Under the above embodiments, the linkage configuration function is realized. For users, the configuration is changed from device-based to trigger operation based on the linkage configuration entry, making the configuration easier to understand from the user's perspective and greatly reducing the management and use costs of user configuration.

[0141] As mentioned earlier, device control services can be used to instruct space devices to perform corresponding actions, and also to instruct target devices to perform corresponding actions. This is combined with... Figure 8 The process of obtaining device control instructions for a target device from the device control service used to instruct space devices to perform corresponding actions is described in detail below:

[0142] Please see Figure 8 In one exemplary embodiment, obtaining the device control command for the target device based on the determined device control service in step 370 may include the following steps:

[0143] Step 371: Based on the space device indicated by the device control service, identify at least one device with the same device attributes as the space device in the space to which the target device belongs.

[0144] In this context, device attributes are related to the adjustable environmental attributes of the device. For example, if a lamp is used to adjust the brightness of the environment, and the corresponding environmental attribute is brightness, then the lamp's device attribute is the brightness attribute. Of course, in other embodiments, device attributes are not limited to brightness attributes; they can also be temperature attributes, humidity attributes, volume attributes, etc. It should be noted that while device attributes may be the same, device types can differ. For example, if the device attribute is temperature, candidate devices could be air conditioners, fans, radiators, etc., with different device types. This embodiment does not limit whether candidate devices with the same device attribute have the same device type.

[0145] Step 373: Determine the target device based on devices that have the same device attributes as the space device.

[0146] Among them, the space device is created based on the space to which the target device belongs. Therefore, the space to which the space device belongs is the same as the space to which the target device belongs.

[0147] For example, if the linked data is "There is someone in the entryway and all the living room lights are on", the trigger condition is "There is someone in the entryway", and the device control service is "All the living room lights are on", then based on this device control service, it can be determined that the space to which the target device belongs is the living room, and the space device refers to all the lights in the living room. Thus, it can be determined that at least one device with the same device attribute as the space device refers to all the lights in the living room, i.e., the target device.

[0148] It should be noted that the space to which the target device belongs can refer to the target space or another space distinct from the target space. Step 375: Based on the target device and the space device indicated by the device control service, perform the corresponding actions to generate device control instructions for the target device.

[0149] Using the previous example, assuming that only light d is installed in the living room, then based on the device control service "all living room lights on", once the target device is determined to be living room light d and the action to be performed is the turn-on action, the device control command "turn on light d" can be generated for living room light d.

[0150] After a device control command is sent to the target device, the target device can receive the command and execute the corresponding action. For example, after lamp d receives the device control command "turn on lamp d", it will turn on the lamp.

[0151] In the above process, the conversion between device control services and device control commands is realized. On the one hand, for users, the configuration based on the target device can be simplified to the configuration based on the space to which the target device belongs. This eliminates the need for users to know the number and type of target devices in the space, thereby simplifying the complexity of device control configuration, reducing the user's learning cost, and effectively solving the problem of overly cumbersome device control configuration in related technologies. On the other hand, regarding the device control services provided by the space, they are decoupled from the device status. Whether devices are added or removed, or online or offline, it will not affect the automated device control services provided by the electronic devices to users. Users can avoid intervention and configure from the space dimension, which is more intuitive and convenient, further reducing the complexity of device control configuration.

[0152] As mentioned earlier, when multiple devices with the same device attributes exist in a space, for example, assuming a bedroom includes a chandelier, a table lamp, and a nightlight, if a user configures the device control command "turn on the bedroom light," it's unclear which light will be turned on. In this case, the user not only needs to clearly understand the various types of lights in the bedroom, but also needs to configure corresponding device control commands for each type of light to explicitly specify which type of light to turn on. This makes the device control configuration process cumbersome and affects the user experience. To address this, the inventors provide a device control service that provides fuzzy commands. That is, the device targeted by the control command represented by the device control service is not clear enough or unique. In other words, within the space where the target device belongs, there are multiple devices with the same device attributes as the devices in that space, and the device control service does not explicitly indicate which device is the target device for the corresponding action. Now, in conjunction with... Figure 9The process of obtaining device control instructions for a target device from a device control service that provides fuzzy instructions is described in detail below:

[0153] Please see Figure 9 In one exemplary embodiment, step 373 may include the following steps:

[0154] Step 3731: Mining device usage habits based on historical behavioral data.

[0155] Step 3733: Select target devices that match the usage habits of the space devices from among the devices that have the same device attributes as the space devices.

[0156] Among them, the equipment control command is used to instruct the target equipment to perform actions, and the target equipment is a device that conforms to the usage habits of the equipment.

[0157] In this embodiment, the process of selecting the target device from devices that have the same device attributes as the space device is based on historical behavior data.

[0158] Historical behavior data describes a user's historical behavior when controlling devices at historical times. For example, if user A arrives home at 8 PM and turns on the living room air conditioner, setting it to cooling mode at 26°C, the living room air conditioner will generate a corresponding device log. This log will include at least the user (user A), device identifier (living room air conditioner), device status (on), start time (8 PM), and device operation (cooling mode 26°C). If user A enters the bedroom at 10 PM and turns on the bedroom air conditioner, setting it to sleep mode, the bedroom air conditioner will also generate a corresponding device log. This log will also include at least the user (user A), device identifier (bedroom air conditioner), device status (on), start time (10 PM), and device operation (sleep mode). Both the living room and bedroom air conditioner device logs will be reported to the backend for storage. Figure 1 Taking the illustrated implementation environment as an example, in one application scenario, the aforementioned device logs are reported to the network device via a local area network (LAN) path, and then forwarded to the server by the network device. In another application scenario, the aforementioned device logs are reported to the server via a wide area network (WAN) path. Based on this, after receiving the aforementioned device logs, the server can store the received device logs in user A's historical behavior data, so as to provide device control services to user A based on user A's historical behavior data. It should be understood that different users will have different historical behavior data.

[0159] As shown above, the amount of historical behavioral data stored in the background increases over time. This historical behavioral data describes the historical behavior of different users controlling various types of devices at different historical times. Therefore, for each user's historical behavioral data, this data can reflect the corresponding user's device usage habits. For example, if user B enters the bedroom to sleep at 11 PM every night and turns on the bedroom nightlight, then based on user B's historical behavioral data, it can be determined that user B's habit of turning on the bedroom nightlight is at 11 PM.

[0160] Therefore, based on the user's device usage habits, it is possible to convert between device control services that provide fuzzy instructions and device control instructions. That is, according to the user's device usage habits, the target device is selected from the devices that have the same device attributes as the space device, so that the target device conforms to the user's device usage habits. Using the previous example, for electronic devices, the target device is located in the bedroom. If the device control service providing the fuzzy instruction is "turn on the bedroom light" when user B enters the bedroom to sleep at 11 PM, it means that user B instructs any device in the bedroom (any light in the bedroom) with the same brightness attribute as the space device (bedroom light) to perform the turning action. At this time, the bedroom chandelier, bedroom table lamp, and bedroom night light are all devices with the same brightness attribute as the space device. Based on the analysis of historical behavior data, it can be seen that the bedroom night light is frequently turned on at 11 PM, that is, user B is accustomed to turning on the bedroom night light at 11 PM. Therefore, from the bedroom chandelier, bedroom table lamp, and bedroom night light that meet the brightness attribute, the target device is selected as the bedroom night light, thus obtaining the device control instruction "turn on the bedroom night light", thereby completing the conversion between the device control service providing the fuzzy instruction and the device control instruction.

[0161] In one possible implementation, the conversion between the device control service providing fuzzy instructions and the device control instructions is accomplished by calling a machine learning model, which is trained using historical behavior data as a training set.

[0162] In this approach, as the historical behavioral data stored in electronic devices changes, the user's device usage habits may also change, which in turn may lead to changes in the target device. This ensures that the device control services provided by electronic devices closely match the user's daily lifestyle, making it imperceptible to the user. This not only reduces the complexity of configuration in device control but also effectively optimizes the user experience.

[0163] Therefore, after the device control command is sent to the target device, the target device can receive the device control command and perform the corresponding action according to the instructions of the device control command. For example, after receiving the device control command "turn on the bedroom night light", the bedroom night light will perform the action of turning on.

[0164] Through the cooperation of the above embodiments, the conversion between device control services that provide fuzzy instructions and device control instructions is realized. This allows the process of selecting a target device from any device with the same device attributes as the space device to be transferred from the user to the background. In this way, the user does not need to know the number and type of devices, thereby simplifying the complexity of device control configuration, reducing the user's learning cost, and effectively solving the problem of overly cumbersome device control configuration in related technologies.

[0165] The following are embodiments of the apparatus described in this application, which can be used to execute the device control method involved in this application. For details not disclosed in the embodiments of the apparatus described in this application, please refer to the method embodiments of the device control method involved in this application.

[0166] Please see Figure 10 This application provides a device control apparatus 900, including but not limited to: a data acquisition module 910, a condition search module 930, a service determination module 950, and an instruction sending module 970.

[0167] The data acquisition module 910 is used to acquire resource data of the target space; the resource data is related to the status data reported by each device in the target space.

[0168] The condition lookup module 930 is used to search for trigger conditions that match the resource data of the target space in the configured linkage data; the trigger conditions in the linkage data are configured according to the resource data of the target space.

[0169] The service determination module 950 is used to determine the device control service that is associated with the found triggering condition based on the association relationship between the triggering condition and the device control service in the linkage data.

[0170] The instruction sending module 970 is used to obtain a device control instruction for a target device based on a determined device control service, and send the device control instruction to the target device so that the target device responds to the device control instruction and performs a corresponding action.

[0171] In an exemplary embodiment, the data acquisition module 910 includes: a first direct calculation unit, a subspace determination unit, a second direct calculation unit, and an indirect calculation unit.

[0172] The first direct calculation unit is used to calculate the resource data of the target space based on the status data reported by each device in the target space if the target space is a subspace.

[0173] The subspace determination unit is used to determine each subspace belonging to the target space if the target space is the parent space.

[0174] The second direct calculation unit is used to calculate the resource data of the target space based on the status data reported by each device in each subspace belonging to the target space.

[0175] The indirect calculation unit is used to calculate the resource data of each subspace belonging to the target space based on the reported status data of each device in each subspace belonging to the target space, and to synthesize the resource data of each subspace belonging to the target space into the resource data of the target space.

[0176] In one exemplary embodiment, a device control service is used to instruct a space device to perform a corresponding action, the space device being created based on the space to which the target device belongs.

[0177] The instruction sending module 970 includes: a candidate device determination unit, a target device determination unit, and an instruction generation unit.

[0178] The candidate device determination unit is used to determine, based on the device control service instruction, at least one device with the same device attributes as the space device in the space to which the target device belongs.

[0179] The target device determination unit is used to determine the target device based on devices that have the same device attributes as the space device.

[0180] The instruction generation unit is used to generate equipment control instructions for the target device based on the target device and the space device indicated by the equipment control service. The equipment control instructions are used to instruct the target device to perform the corresponding actions.

[0181] In one exemplary embodiment, the target device determination unit includes a habit mining subunit and a device screening subunit.

[0182] The habit mining subunit is used to mine device usage habits based on historical behavioral data.

[0183] The equipment screening subunit is used to select target equipment that conforms to the usage habits from among the equipment with the same equipment attributes as the space equipment.

[0184] In an exemplary embodiment, the instruction sending module 970 includes: a first direct sending unit, a third subspace determination unit, a first indirect sending unit, and a second direct sending unit.

[0185] The first direct sending unit is used to send device control commands to the target device if the space to which the target device belongs is a subspace.

[0186] The third subspace determination unit is used to determine each subspace in the space to which the target device belongs if the space to which the target device belongs is the parent space.

[0187] The first indirect transmission unit is used to send device control commands to each network device in each subspace of the target device's space, so that the device control commands are forwarded to the target device through each network device.

[0188] or

[0189] The second direct transmission unit is used to directly send device control commands to the target device.

[0190] In one exemplary embodiment, the device 900 further includes a space update module and a data update module.

[0191] The space update module is used to obtain the binding relationship between each device in the target space and the target space, and update the space to which each device belongs based on the binding relationship.

[0192] The data update module is used to receive status data reported by each device after updating its own space, and update the resource data of the target space according to the status data reported by each device in the target space.

[0193] In one exemplary embodiment, the apparatus 900 further includes a binding request receiving module and a connection establishment module.

[0194] The binding request receiving module is used to receive binding requests initiated by each device in the target space.

[0195] The connection establishment module is used to establish connections between the target space and its devices in response to binding requests, thereby enabling each device to store the binding relationship with the target space.

[0196] In one exemplary embodiment, the apparatus 900 further includes a push message generation module, a configuration request receiving module, and a data extraction module.

[0197] The push message generation module is used to generate a push message about the linkage configuration entry if the target space is consistent with the space of the target device, so as to display the linkage configuration entry in the client.

[0198] The configuration request receiving module is used to receive linkage configuration requests. These requests are generated through a trigger operation targeting the linkage configuration entry point, which indicates whether to configure the corresponding linkage data based on the resource data of the target space and the device control service.

[0199] The data extraction module is used to extract and store the linkage data configured by the linkage configuration entry point from the linkage configuration request, so as to find the triggering conditions that match the resource data of the target space in the configured linkage data.

[0200] It should be noted that the device control device provided in the above embodiments is only illustrated by the division of the above functional modules when controlling the device. In actual applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the device control device will be divided into different functional modules to complete all or part of the functions described above.

[0201] Furthermore, the embodiments of the device control apparatus and device control method provided in the above embodiments belong to the same concept, and the specific way in which each module performs operations has been described in detail in the method embodiments, and will not be repeated here.

[0202] Figure 11 A schematic diagram of the structure of an electronic device is shown according to an exemplary embodiment. The server is suitable for... Figure 1 The diagram shows the gateway 150 and the server 170 in the implementation environment.

[0203] It should be noted that this server is merely an example adapted to this application and should not be construed as providing any limitation on the scope of use of this application. Nor should this server be interpreted as requiring or depending on any specific feature. Figure 11 One or more components of the exemplary electronic device 2000 shown.

[0204] The hardware structure of electronic devices 2000 can vary significantly due to differences in configuration or performance, such as... Figure 11 As shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.

[0205] Specifically, power supply 210 is used to provide operating voltage for various hardware devices on electronic device 2000.

[0206] Interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. For example, to perform... Figure 1 The diagram illustrates the interaction between user terminal 110 and server 170 in the implementation environment.

[0207] Of course, in other examples adapted in this application, interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. Figure 11 As shown, this does not constitute a specific limitation.

[0208] The memory 250 serves as a carrier for resource storage and can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include the operating system 251, application programs 253, and data 255, etc., and the storage method can be temporary storage or permanent storage.

[0209] The operating system 251 is used to manage and control the various hardware devices and application programs 253 on the electronic device 2000, so as to enable the central processing unit 270 to perform calculations and processing on the massive data 255 in the memory 250. It can be Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0210] Application 253 is a computer program that performs at least one specific task based on operating system 251, and may include at least one module ( Figure 11 (Not shown), each module may contain a computer program for the electronic device 2000. For example, the device control device may be considered as an application program 253 deployed on the electronic device 2000.

[0211] Data 255 can be photos, pictures, etc. stored on a disk, or resource data, status data, linkage data, etc., stored in memory 250.

[0212] The central processing unit 270 may include one or more processors and is configured to communicate with the memory 250 via at least one communication bus to read computer programs stored in the memory 250, thereby performing operations and processing on massive amounts of data 255 stored in the memory 250. For example, a device control method may be implemented by the central processing unit 270 reading a series of computer programs stored in the memory 250.

[0213] Furthermore, this application can also be implemented through hardware circuits or a combination of hardware circuits and software. Therefore, the implementation of this application is not limited to any specific hardware circuit, software, or combination thereof.

[0214] Please see Figure 12 This application provides an electronic device 4000, which may include a gateway, a server, etc.

[0215] exist Figure 12 The electronic device 4000 includes at least one processor 4001, at least one communication bus 4002, and at least one memory 4003.

[0216] The processor 4001 and memory 4003 are connected, for example, via a communication bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.

[0217] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0218] The communication bus 4002 may include a path for transmitting information between the aforementioned components. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 12 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0219] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0220] The memory 4003 stores a computer program, and the processor 4001 reads the computer program stored in the memory 4003 through the communication bus 4002.

[0221] When the computer program is executed by the processor 4001, it implements the device control methods in the above embodiments.

[0222] Furthermore, this application provides a storage medium storing a computer program, which, when executed by a processor, implements the device control methods described in the above embodiments.

[0223] This application provides a computer program product comprising a computer program stored in a storage medium. A processor of a computer device reads the computer program from the storage medium and executes the computer program, causing the computer device to perform the device control methods described in the above embodiments.

[0224] Compared to related technologies, this approach, by supplementing device control services based on devices with space-based device control services, enables multiple linkages between devices, spaces, and other environments, enhancing the flexibility and openness of device control. Space-based device control services eliminate the need for users to worry about the quantity and type of devices in each space, significantly reducing management and learning costs. Users can configure devices in a more easily understood way, effectively reducing the complexity of device control configuration. Space-based device control services decouple automation from device status, making it suitable not only for flexible configuration of home devices but also ensuring that the online / offline status or failure of some devices does not affect the successful execution of automation. This significantly reduces user configuration costs and maintenance costs in device control, improving the efficiency of automation control and greatly increasing the success rate of device control service execution. Based on the automatic binding of devices and spaces, devices can be freely installed and deployed in different spaces without user intervention, further reducing the complexity of device control configuration caused by changes in the space to which the device belongs.

[0225] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0226] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A device control method characterized by, The method includes: Acquire resource data of the target space; when the target space is the parent space, the resource data is directly calculated from the status data reported by each device in each subspace belonging to the parent space, or indirectly calculated from the resource data of each subspace belonging to the parent space; wherein, the resource data of each subspace is calculated from the status data reported by each device in each subspace; the resource data is used to indicate the overall spatial status of the parent space and / or each of the subspaces. In the configured linkage data, find the triggering conditions that match the resource data of the target space; the triggering conditions in the linkage data are configured according to the resource data of the target space, and are related to the spatial state of the parent space when the target space is the parent space. Based on the correlation between the triggering conditions and the device control service in the linkage data, the device control service that is associated with the found triggering conditions is determined; the device control service is used to instruct the corresponding target device to perform a corresponding action when the spatial state of the parent space and / or each of the subspaces meets the triggering conditions; Based on the determined device control service, device control instructions are obtained for target devices in each of the subspaces of the parent space, and device control instructions are sent to the target devices in each of the subspaces respectively, so that the target devices respond to the device control instructions and perform corresponding actions.

2. The method of claim 1, wherein, The acquisition of resource data in the target space includes: If the target space is a subspace, then the resource data of the target space is calculated based on the status data reported by each device in the target space; If the target space is a parent space, then each subspace belonging to the target space is determined; Based on the status data reported by each device in each subspace belonging to the target space, the resource data of the target space is calculated; or Based on the reported status data of each device in each subspace belonging to the target space, the resource data of each subspace belonging to the target space is calculated, and the resource data of each subspace belonging to the target space is combined into the resource data of the target space.

3. The method of claim 1, wherein, The device control service is used to instruct the space device to perform corresponding actions; the space device is created based on the space to which the target device belongs. The step of obtaining device control instructions for target devices in each of the subspaces of the parent space based on the determined device control service includes: Based on the space device indicated by the device control service, at least one device with the same device attributes as the space device is identified in the space to which the target device belongs; The target device is determined based on devices that have the same device attributes as the space device. Based on the target device and the space device indicated by the device control service, the space device performs corresponding actions and generates device control instructions for the target device; the device control instructions are used to instruct the target device to perform corresponding actions.

4. The method of claim 3, wherein, The step of determining the target device based on devices having the same device attributes as the space device includes: Mining device usage habits based on historical behavioral data; From among the devices that have the same device attributes as the space device, the target device that conforms to the usage habits of the device is selected.

5. The method of claim 1, wherein, Sending device control commands to the target devices in each of the subspaces includes: The device control commands are sent to each network device in each of the subspaces, respectively, so that the device control commands are forwarded to the target device in the corresponding subspace through each of the network devices; or The device control commands are sent directly to the target devices in each of the subspaces.

6. The method according to any one of claims 1 to 5, characterized in that, Before acquiring the resource data of the target space, the method further includes: Obtain the binding relationship between each device in the target space and the target space, and update the space to which each device belongs based on the binding relationship; Receive status data reported by each device after updating its own space, and update the resource data of the target space according to the status data reported by each device in the target space.

7. The method as described in claim 6, characterized in that, Before obtaining the binding relationship between each device in the target space and the target space, the method further includes: Receive binding requests initiated by each device in the target space; In response to the binding request, a connection is established between the target space and each of the devices therein, through which each of the devices stores a binding relationship with the target space.

8. The method according to any one of claims 1 to 5, wherein, Before searching for triggering conditions that match resource data in the target space from the configured linkage data, the method further includes: If the target space is consistent with the space to which the target device belongs, a push message about the linkage configuration entry is generated to display the linkage configuration entry in the client. Receive a linkage configuration request; the linkage configuration request is generated by a trigger operation on the linkage configuration entry, the linkage configuration entry is used to indicate whether to configure the corresponding linkage data according to the resource data of the target space and the device control service; The linkage configuration entry instruction configuration linkage data is extracted from the linkage configuration request and stored, so as to find the triggering condition that matches the resource data of the target space in the configured linkage data.

9. An apparatus control device characterized by comprising: The device includes: The data acquisition module is used to acquire resource data of the target space; when the target space is a parent space, the resource data is directly calculated from the status data reported by each device in each subspace belonging to the parent space, or indirectly calculated from the resource data of each subspace belonging to the parent space; the resource data of each subspace is calculated from the status data reported by each device in each subspace; the resource data is used to indicate the overall spatial status of the parent space and / or each of the subspaces. The condition lookup module is used to search for triggering conditions that match the resource data of the target space in the configured linkage data; the triggering conditions in the linkage data are configured according to the resource data of the target space, and are related to the spatial state of the parent space when the target space is the parent space. The service determination module is used to determine the device control service that is associated with the found triggering condition based on the association relationship between the triggering condition and the device control service in the linkage data. The device control service Used to instruct the corresponding target device to perform a corresponding action when the spatial state of the parent space and / or each of the subspaces meets the triggering conditions; The instruction sending module is used to obtain device control instructions for target devices in each of the subspaces of the parent space according to the determined device control service, and send the device control instructions to the target devices in each of the subspaces respectively, so that the target devices respond to the device control instructions and perform corresponding actions.

10. An electronic device, comprising: include: At least one processor, at least one memory, and at least one communication bus, wherein, The memory stores a computer program, and the processor reads the computer program from the memory via the communication bus; When the computer program is executed by the processor, it implements the device control method according to any one of claims 1 to 8.

11. A storage medium having stored thereon a computer program, characterized in that When the computer program is executed by the processor, it implements the device control method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Equipment control method and device, equipment, system and storage medium

    CN114690658A

  • Equipment control method and device, electronic equipment and storage medium

    CN115793481A