Action resource creation method, execution method, electronic device and storage medium
By creating action state attributes and action time attributes in the action resources of the Internet of Things system, and based on the relevant dependency conditions of these attributes, the conflict problem of action resources is solved, the execution efficiency and accuracy of actions are improved, and the effective control of target resources in the Internet of Things system is ensured.
Patent Information
- Application Number
- CN201910893658.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-20
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2039-09-20
AI Technical Summary
In the Internet of Things system, the conflict problem of action resources makes it difficult to achieve effective control of target resources, especially in network connections between multiple applications, the complexity of triggering conditions and time parameters of action resources increases.
By creating action state attributes and action time attributes in action resources, and solving the conflict problem of action resources based on the relevant dependencies of these attributes, ensuring the effective execution of actions.
It effectively solves the conflict problem of action resources, improves the execution efficiency and accuracy of action, and ensures effective control of target resources in the Internet of Things system.
Smart Images

Figure CN112540540B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to a method for creating an action resource, a method for executing an action, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the rapid development of IoT technology in various application fields, more and more devices are connected to the IoT, and various new application fields such as smart home, smart transportation, and smart health have emerged. The Internet of Everything is the development trend of the IoT. In the IoT system, the application entity as an application can deploy services on the general service entity as a service platform. After the application service is deployed to the service platform, the process of implementing the application service can be realized without the participation of the application, but the operation of the service can be realized directly on the service platform. The service platform can provide public service functions for multiple different applications from different manufacturers, and realize the network connection between multiple different applications through the service platform, thereby realizing the Internet of Everything. Summary of the invention
[0003] At least one embodiment of the present disclosure provides a method for creating an action resource, comprising: receiving a first creation request, wherein the first creation request includes a first target resource; creating the first action resource according to the first creation request, wherein the first action resource is a resource for triggering a first action for the first target resource, wherein creating the first action resource comprises: creating a first action state attribute for the first action resource, wherein the first action state attribute represents a state of the first action.
[0004] For example, in a method provided by an embodiment of the present disclosure, creating the first action resource further includes: creating a first action time attribute for the first action resource, wherein the first action time attribute is used to indicate a time parameter related to the first action.
[0005] For example, the method provided by an embodiment of the present disclosure also includes: receiving a second creation request, wherein the second creation request includes a second target resource; creating the second action resource according to the second creation request, wherein the second action resource is a resource used to trigger a second action for the second target resource, and when a second trigger condition is met, the second action is triggered for the second target resource, wherein creating the second action resource includes: creating a second action state attribute for the second action resource, wherein the second action state attribute represents the state of the second action.
[0006] For example, in the method provided in an embodiment of the present disclosure, creating the second action resource further includes: creating a second action time attribute for the second action resource, wherein the second action time attribute is used to indicate a time parameter related to the second action.
[0007] For example, in a method provided by an embodiment of the present disclosure, the first target resource and the second target resource are the same target resource, and the first action and the second action conflict with each other.
[0008] For example, in the method provided by an embodiment of the present disclosure, the first creation request also includes dependent resource information, and creating the first action resource also includes: creating a first dependent sub-resource for the first action resource according to the dependent resource information, wherein the first dependent sub-resource includes a first dependent condition, the first dependent condition is related to the second action state attribute, and when the first trigger condition and the first dependent condition are simultaneously satisfied, the first action is triggered for the first target resource; or creating a second dependent sub-resource for the first action resource according to the dependent resource information, wherein the second dependent sub-resource includes a second dependent condition, the second dependent condition is related to the second action time attribute, and when the first trigger condition and the second dependent condition are simultaneously satisfied, the first action is triggered for the first target resource; or creating a first dependent sub-resource and a second dependent sub-resource for the first action resource according to the dependent resource information, wherein the first dependent sub-resource includes a first dependent condition, the second dependent sub-resource includes a second dependent condition, the first dependent condition is related to the second action state attribute, and the second dependent condition is related to the second action time attribute, and when at least one of the first dependent condition and the second dependent condition and the first trigger condition are simultaneously satisfied, the first action is triggered for the first target resource.
[0009] For example, in the method provided in one embodiment of the present disclosure, creating the first action resource also includes: creating a first opposite action attribute and a first state control attribute for the first action resource, and creating the second action resource also includes: creating a second opposite action attribute and a second state control attribute for the second action resource, wherein the first opposite action attribute represents an identification code of the second action resource, and the second opposite action attribute represents an identification code of the first action resource, the first state control attribute represents whether to change the attribute value of the first action state attribute or the attribute value of the second action state attribute, and the second state control attribute represents whether to change the attribute value of the second action state attribute or the attribute value of the first action state attribute.
[0010] For example, in the method provided by an embodiment of the present disclosure, the first dependency condition includes that the attribute value of the second action state attribute and the first set value satisfy a first preset logical relationship, and the first set value is valid or invalid; the second dependency condition includes that the attribute value of the second action time attribute and the preset action time satisfy a second preset logical relationship.
[0011] For example, in a method provided in an embodiment of the present disclosure, the first creation request also includes conflict policy resource information, and creating the first action resource further includes: creating a conflict policy sub-resource for the first action resource based on the conflict policy resource information.
[0012] For example, in the method provided in an embodiment of the present disclosure, creating the first action resource also includes: based on the second target resource, the second action, and the conflict strategy sub-resource satisfying a matching condition, creating a first dependent sub-resource for the first action resource, wherein the first dependent sub-resource includes a first dependent condition, and the first dependent condition is related to the second action state attribute, and when the first dependent condition and the first trigger condition are simultaneously satisfied, the first action is triggered for the first target resource; or creating the first action resource also includes: based on the second target resource, the second action, and the conflict strategy sub-resource satisfying a matching condition, creating a second dependent sub-resource for the first action resource, wherein the second dependent sub-resource includes a second dependent condition, and the second dependent condition is related to the second action state attribute. The second action time attribute is related, and when the second dependency condition and the first trigger condition are met at the same time, the first action is triggered for the first target resource; or creating the first action resource also includes: based on the second target resource, the second action and the conflict strategy sub-resource satisfying the matching condition, creating a first dependency sub-resource and a second dependency sub-resource for the first action resource, wherein the first dependency sub-resource includes a first dependency condition, and the first dependency condition is related to the second action state attribute, and the second dependency sub-resource includes a second dependency condition, and the second dependency condition is related to the second action time attribute, and when at least one of the first dependency condition and the second dependency condition and the first trigger condition are met at the same time, the first action is triggered for the first target resource.
[0013] For example, in the method provided in an embodiment of the present disclosure, creating a conflict strategy sub-resource for the first action resource includes: creating a conflict target resource identification attribute and a conflict execution method attribute for the first action resource, wherein the conflict target resource identification attribute represents the identification code of the first target resource, and the conflict execution method attribute represents the action that conflicts with the first action, and satisfying the matching condition includes: the identification code of the second target resource is the same as the conflict target resource identification attribute, and the second action is the same as the action represented by the conflict execution method attribute.
[0014] For example, in a method provided in an embodiment of the present disclosure, creating a conflict strategy sub-resource for the first action resource further includes: creating a conflict status attribute for the first action resource, wherein the attribute value of the conflict status attribute includes a first set value or a second set value.
[0015] For example, in the method provided in one embodiment of the present disclosure, the attribute value of the conflict state attribute is the first set value, the first dependency condition includes that the attribute value of the second action state attribute and the first set value satisfy a first preset logical relationship, the first set value is valid or invalid, the second action resource also includes a second action time attribute, and the second dependency condition includes that the attribute value of the second action time attribute and the preset action time satisfy a second preset logical relationship.
[0016] For example, in the method provided by an embodiment of the present disclosure, creating the first action resource also includes: creating a first state automatic control time attribute for the first action resource, wherein the attribute value of the first action state attribute includes a first set value and a second set value, the first set value and the second set value are opposite to each other, and the first state automatic control time represents: based on the attribute value of the first action state attribute being the first set value, and the attribute value of the first action time attribute being greater than or equal to the attribute value of the first state automatic control time attribute, the attribute value of the first action state attribute is changed from the first set value to the second set value.
[0017] For example, in the method provided by an embodiment of the present disclosure, creating the first action resource also includes: creating a first state automatic control time attribute for the first action resource, wherein the attribute value of the first action state attribute includes a first set value and a second set value, the first set value and the second set value are opposite to each other, and the first state automatic control time indicates: based on the attribute value of the first action state attribute being the first set value, and the attribute value of the first state automatic control time attribute being equal to 0, the attribute value of the first action state attribute is changed from the first set value to the second set value.
[0018] At least one embodiment of the present disclosure also provides a method for executing an action, including: determining a first action resource, wherein the first action resource is a resource used to trigger a first action for a first target resource, the first action resource includes a first action state attribute, and the first action state attribute indicates a state of the first action; triggering the first action for the first target resource; after triggering the first action, setting an attribute value of the first action state attribute to a first set value.
[0019] For example, in an execution method provided in an embodiment of the present disclosure, triggering the first action for the first target resource includes: receiving a first data resource; and triggering the first action for the first target resource based on the first data resource satisfying a first trigger condition.
[0020] For example, in an execution method provided by an embodiment of the present disclosure, the first action resource also includes a first action time attribute, and the first action time attribute is used to indicate a time parameter related to the first action. The execution method also includes: after triggering the first action, setting the attribute value of the first action time attribute.
[0021] For example, in an execution method provided by an embodiment of the present disclosure, the first action resource also includes a first state automatic control time attribute, and the execution method also includes: obtaining the attribute value of the first action time attribute; judging whether the attribute value of the first action time attribute is greater than or equal to the attribute value of the first state automatic control time attribute, and when the attribute value of the first action time attribute is greater than or equal to the attribute value of the first state automatic control time attribute, changing the attribute value of the first action state attribute from the first set value to the second set value, wherein the first set value and the second set value are opposite to each other.
[0022] For example, in an execution method provided in an embodiment of the present disclosure, the first action resource also includes a first dependent sub-resource, the first dependent sub-resource includes a first dependent condition, and triggering the first action for the first target resource includes: receiving a first data resource; obtaining a second action state attribute of a second action resource, wherein the second action resource is a resource used to trigger a second action for a second target resource, the second action resource includes the second action state attribute, and the second action state attribute indicates a state of the second action; based on the first data resource satisfying the first trigger condition and the attribute value of the second action state attribute satisfying the first dependent condition, the first action is triggered for the first target resource; or the first action resource also includes a second dependent sub-resource, the second dependent sub-resource includes a second dependent condition, and triggering the first action for the first target resource includes: receiving a first data resource; obtaining a second action time attribute of a second action resource, wherein the second action resource is a resource used to trigger a second action for a second target resource, the second action resource includes the second action time attribute, and the second action time attribute is used to indicate a time parameter related to the second action; based on the first data resource satisfying the first trigger condition and the attribute value of the second action time attribute satisfying the second dependent condition, the first action is triggered for the first target resource.
[0023] For example, in an execution method provided in an embodiment of the present disclosure, the first action resource also includes a first dependent sub-resource and a second dependent sub-resource, the first dependent sub-resource includes a first dependent condition, the second dependent sub-resource includes a second dependent condition, and triggering the first action for the first target resource includes: receiving a first data resource; obtaining a second action state attribute and a second action time attribute of a second action resource, wherein the second action resource is a resource for triggering a second action for a second target resource, the second action resource includes the second action state attribute and the second action time attribute, the second action state attribute represents the state of the second action, and the second action time attribute is used to indicate a time parameter related to the second action; based on the first data resource satisfying the first trigger condition and the attribute value of the second action state attribute satisfies the first dependent condition and / or the attribute value of the second action time attribute satisfies the second dependent condition, the first action is triggered for the first target resource.
[0024] For example, in the execution method provided by an embodiment of the present disclosure, the first dependency condition includes that the attribute value of the second action state attribute and the first setting value satisfy a first preset logical relationship, and the first setting value is valid or invalid, and the second dependency condition includes that the attribute value of the second action time attribute and the preset action time satisfy a second preset logical relationship.
[0025] For example, in an execution method provided by an embodiment of the present disclosure, the first target resource and the second target resource are the same target resource, and the first action and the second action conflict with each other.
[0026] For example, the execution method provided by an embodiment of the present disclosure also includes: after triggering the first action, setting the attribute value of the second action state attribute to a second set value, wherein the first set value and the second set value are opposite to each other; determining the second action resource; receiving a second data resource; based on the second data resource satisfying a second trigger condition, triggering the second action for the second target resource, and after triggering the second action, changing the attribute value of the second action state attribute from the second set value to the first set value, and changing the attribute value of the first action state attribute from the first set value to the second set value.
[0027] For example, in an execution method provided in an embodiment of the present disclosure, the first action resource further includes a first opposite action attribute and a first state control attribute, the second action resource further includes a second opposite action attribute and a second state control attribute, the first opposite action attribute represents an identification code of the second action resource, and the second opposite action attribute represents an identification code of the first action resource, before executing the operation of setting the attribute value of the second action state attribute to the second set value, the execution method further includes: judging whether the attribute value of the first state control attribute is true, and if it is determined that the attribute value of the first state control attribute is true, executing the operation of setting the attribute value of the second action state attribute to the second set value, and if it is determined that the attribute value of the first state control attribute is not true, not executing the operation of setting the attribute value of the second action state attribute to the second set value, and before executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, the execution method further includes: judging whether the attribute value of the second state control attribute is true, and if it is determined that the attribute value of the second state control attribute is true, executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, In the case where it is determined that the attribute value of the second state control attribute is not true, the operation of changing the attribute value of the first action state attribute from the first set value to the second set value is not performed; or before performing the operation of setting the attribute value of the second action state attribute to the second set value, the execution method further includes: judging whether the attribute value of the second state control attribute is true, and in the case where it is determined that the attribute value of the second state control attribute is true, the operation of setting the attribute value of the second action state attribute to the second set value is performed, and in the case where it is determined that the attribute value of the second state control attribute is not true, the operation of setting the attribute value of the second action state attribute to the second set value is not performed, and before performing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, the execution method further includes: judging whether the attribute value of the first state control attribute is true, and in the case where it is determined that the attribute value of the first state control attribute is true, the operation of changing the attribute value of the first action state attribute from the first set value to the second set value is performed, and in the case where it is determined that the attribute value of the first state control attribute is not true, the operation of changing the attribute value of the first action state attribute from the first set value to the second set value is not performed.
[0028] For example, the execution method provided in an embodiment of the present disclosure further includes: after triggering the second action, setting the attribute value of the second action time attribute.
[0029] For example, in an execution method provided in an embodiment of the present disclosure, setting the attribute value of the first action time attribute includes: after triggering the first action, establishing an action execution timer to start timing, and using the time value of the action execution timer as the attribute value of the first action time attribute.
[0030] At least one embodiment of the present disclosure further provides an electronic device, comprising: a memory for non-temporarily storing computer-readable instructions; and a processor for executing the computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, execute the creation method according to any of the above embodiments.
[0031] At least one embodiment of the present disclosure further provides an electronic device, comprising: a memory for non-temporarily storing computer-readable instructions; and a processor for executing the computer-readable instructions, wherein when the computer-readable instructions are executed by the processor, the processor executes the execution method described in any of the above embodiments.
[0032] At least one embodiment of the present disclosure further provides a computer-readable storage medium that non-temporarily stores computer-readable instructions, which, when executed by a computer, enable the computer to execute the creation method described in any of the above embodiments or the execution method described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure.
[0034] Figure 1A A schematic architecture diagram of the Internet of Things according to the present disclosure is disclosed;
[0035] Figure 1B A schematic diagram showing a server / client device according to an embodiment of the present disclosure;
[0036] Figure 1C A schematic diagram showing an example of action resources provided according to some embodiments of the present disclosure;
[0037] Figure 2 A schematic diagram of a smart home scenario in an Internet of Things environment provided by some embodiments of the present disclosure;
[0038] Figure 3A A flowchart of a method for creating an action resource provided by some embodiments of the present disclosure is shown;
[0039] Figure 3BA flowchart showing another method for creating an action resource provided by some embodiments of the present disclosure is shown;
[0040] Figure 4A A schematic diagram showing a first action resource provided by some embodiments of the present disclosure is shown;
[0041] Figure 4B A schematic diagram showing a second action resource provided by some embodiments of the present disclosure is shown;
[0042] Figure 5 An illustrative example of creating an action resource according to an embodiment of the present disclosure is shown;
[0043] Fig. 6A A schematic diagram showing another first action resource provided by some embodiments of the present disclosure is shown;
[0044] Figure 6B A schematic diagram showing another second action resource provided by some embodiments of the present disclosure is shown;
[0045] Figure 7 A schematic diagram showing another first action resource provided by some embodiments of the present disclosure is shown;
[0046] Fig. 8A A schematic diagram showing another first action resource provided by some embodiments of the present disclosure is shown;
[0047] Figure 8B A schematic diagram of a conflict strategy sub-resource in a first action resource provided by some embodiments of the present disclosure is shown;
[0048] Fig. 9 A schematic diagram showing a method for executing an action provided by some embodiments of the present disclosure;
[0049] Fig.10 A schematic diagram showing a process of creating and executing an action resource provided by some embodiments of the present disclosure is shown;
[0050] Fig.11 A schematic diagram showing an illustrative example of performing a trigger operation on a target resource provided by some embodiments of the present disclosure;
[0051] Fig.12 A schematic diagram of an electronic device provided for some embodiments of the present disclosure; and
[0052] Fig.13 A schematic diagram of a computer-readable storage medium provided for some embodiments of the present disclosure. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0054] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0055] In order to keep the following description of the embodiments of the present disclosure clear and concise, the present disclosure omits detailed descriptions of some known functions and known components.
[0056] The Internet of Things can be regarded as an extension of the Internet. It includes the Internet and all resources on the Internet, and is compatible with all Internet applications. The Internet of Things uses communication technologies such as local networks or the Internet to connect sensors, controllers, machines, people and objects in a new way, forming connections between people and objects, and between objects and objects.
[0057] With the development of IoT technology, more and more terminal devices (such as carbon monoxide detectors, smoke alarms, fire alarms, air detectors, etc.) are connected to the IoT platform. The IoT platform can be implemented as a common service entity (CSE), for example. The terminal device can connect to the common service entity by sending registration information to the common service entity, and the common service entity manages the terminal devices connected to the common service entity. The terminal device can be represented as an application entity (AE), and the application entity connected to the common service entity can perform operations such as data transmission and information interaction with the common service entity.
[0058] It should be noted that the application entity described in this article can be an IoT terminal device, or it can also be a software module in a device, etc. Application entities and general service entities are logical entities. Physical devices include logical entities. Simple terminal devices can only include application entities, complex terminal devices can include application entities and general service entities, and servers include at least general service entities and can include application entities. The difference between the general service entity included in the terminal device and the general service entity included in the server lies in the difference in functions. The general service entity of the server includes more functions, such as device management and other functions.
[0059] Figure 1A A schematic architecture diagram of the Internet of Things according to the present disclosure is disclosed. Figure 1A As shown, the client devices of various terminals access the network, and access the general service layer through the network, and the general service layer supports various applications, thus forming a terminal + network + application architecture. For example, in the field of smart home, various household devices can access the general service layer using a local area network (LAN), and such LAN access can be achieved in a wireless or wired manner. Optionally, the local area network can be a personal area network (PAN), for example, taking a wireless personal area network (WPAN) as an example, various technologies such as Bluetooth, IrDA, Home RF, ZigBee, or UWB (Ultra-Wideband Radio) can be used to achieve access.
[0060] In the present disclosure, the entities described, such as application entity AE, common service entity CSE, and data, can be represented by resources. A resource may have a unique identifier, which includes attributes, and may also include sub-resources according to circumstances, wherein the attributes are used to store information related to the resource, and the sub-resource is the next-level resource of the resource, and the resource includes an index pointing to the sub-resource.
[0061] For example, according to different usage scenarios, multiple different action resources can be set for the same target resource (i.e., target object) in different situations. The trigger conditions of the action resources set for the same target resource can be different, and the actions set for the target resource can be the same or different. Figure 1C The action resource shown in the figure is only an illustrative example. In fact, those skilled in the art can set any action triggering event according to actual conditions. In some embodiments, the action triggering event can be divided into location events (setting a certain location to generate an event), time events (setting a certain time to generate an event), operation events (setting a certain operation to generate an event), and user events (for example, sensing the presence of a certain user).
[0062] For example, in some examples, the operation for the small light may include turning on and off. For example, when it is detected that the owner gets up at night or during sleep, the small light can be turned on. When it is detected that the owner lies in bed after dreaming or during sleep, the small light can be turned off. For another example, when a sunny day, gas leak or smoke alarm is detected, the window can be opened. When it is detected that it is cloudy, rainy or snowy, the window can be closed.
[0063] In some embodiments, the action resource may also be directed to multiple target resources. For example, when the location sensor detects the presence of a person within a certain range, multiple target resources (such as air conditioners, air purifiers, lights, etc.) may be controlled to turn on.
[0064] In other embodiments, the action resource may also set multiple trigger conditions for the action on the target resource. For example, when the temperature sensor detects that the temperature is higher or lower than a preset temperature threshold, and the human body sensor detects that there is someone in the room, the air conditioner may be controlled to turn on.
[0065] In a complex usage environment (e.g., smart home scenario, etc.), in order to make the user experience better, it is necessary to set multiple different action resources for each application device so that each application device can perform appropriate functions in different usage environments. Therefore, in a smart home scenario, there may be multiple different action resources for the same target resource. Thus, there may be conflicting action instructions for the same target resource at the same time or successively. For example, under rainy weather conditions, the server will control the window to close, however, if the smoke alarm detects that the smoke content in the air exceeds the standard at the same time, the server will control the window to open. In this case, if the smoke content in the air is detected to exceed the standard first, the server will control the window to open, and if it is detected that it is raining later, the server will control the window to close.
[0066] It is understandable that if the smoke alarm detects that the smoke content in the air exceeds the standard, it means that there may be an emergency such as a fire in the room. In this case, if the server controls the window to close because it detects rain, it may cause danger to the people in the room. In addition, if the trigger conditions of two different actions for the same target resource are met at the same time, it will be difficult for the server to effectively control the target resource.
[0067] Figure 1B A schematic diagram of a server / client device according to an embodiment of the present disclosure is shown. In an Internet of Things system, the above service platform can be implemented by a server, and the above terminal device can be implemented by a client device.
[0068] Figure 1BThe computer device shown can be used to implement the server device or client device disclosed in the present disclosure. Such computers may include personal computers, laptops, tablet computers, mobile phones, personal digital assistance (PDA), smart glasses, smart watches, smart rings, smart helmets, and any smart portable devices or wearable devices. In some embodiments, using Figure 1B The architecture of the computer device shown in the figure can also implement various smart home terminal devices in the Internet of Things system, such as smart switches, smart gateways, smart rice cookers, smart purifiers, etc. The specific system in this embodiment uses a functional block diagram to explain a hardware platform including a user interface. This computer device can be a general-purpose computer device or a computer device with a specific purpose. Both computer devices can be used to implement the server device or terminal client device in this embodiment. The computer system can implement any component currently described to provide information required for Internet of Things communication. For example: the computer system can be implemented by a computer device through its hardware devices, software programs, firmware, and combinations thereof. For convenience, Figure 1B Only one computer device is drawn in the figure, but the relevant computer functions described in this embodiment for providing the information required for IoT communication can be implemented in a distributed manner by a group of similar platforms to disperse the processing load of the computer system.
[0069] like Figure 1B As shown, the computer system may include a communication port 250, connected to which is a network for implementing data communication. The computer system may also include a processor group 220 for executing program instructions. The processor group 220 may be composed of at least one processor (e.g., CPU). The computer system may include an internal communication bus 210. The computer system may include different forms of program storage units and data storage units, such as a hard disk 270, a read-only memory (ROM) 230, and a random access memory (RAM) 240, which can be used to store various data files used for computer processing and / or communication, as well as possible program instructions executed by the processor group 220. The computer system may also include an input / output component 260 to support input / output data flow between the computer system and other components (e.g., user interface 280). The computer system may also send and receive information and data through the communication port 250.
[0070] In some embodiments, the computer system described above may be used to form a server in an IoT communication system. The server of the IoT communication system may be a server hardware device or a server group. Each server in a server group may be connected via a wired or wireless network. A server group may be centralized, such as a data center. A server group may also be distributed, such as a distributed system.
[0071] use Figure 1B The computing system provided in can implement the client application entity AE, the client common service entity CSE, the server application entity AE and / or the server common service entity CSE involved in the present disclosure.
[0072] Figure 1C The action resource ( <action>) is a schematic diagram of an example.
[0073] Taking the oneM2M protocol architecture as an example, entities can be M2M (Machine to Machine) devices, M2M gateways, M2M application layers, etc. In the oneM2M architecture, resources can be uniquely addressed, and to represent such resources, the structure of the resources can be specified. Figure 1C As shown, an action resource may include at least one attribute and / or sub-resource. <action>The method may include: an action priority attribute (actionPriority) indicating the priority of the action resource, a subject resource address attribute (actionSubjectResource) indicating the object to be detected of the action resource, a subject resource identification attribute (SubjectResourceID) indicating the object to be detected of the action resource, an evaluation rule attribute (evalCriteria) indicating the action trigger condition of the action resource, a trigger mode attribute (evalMode) indicating the trigger mode of the action resource, a trigger mode control attribute (evalControlParam) indicating the trigger mode of the action resource, a target identification attribute (objectResourceID) indicating the control target of the action resource, an action attribute (activePrimitive) indicating the action mode of the action resource, an input attribute (input) indicating the action parameter of the action resource, an output resource identification attribute (outputResourceID) indicating the action result of the action resource, an action result attribute (actionResult) indicating the action result of the action resource, and a dependency subresource ( <dependency>). For example, an action resource can also include multiple dependent sub-resources.
[0074] It should be noted that the action priority indicates the priority between multiple action resources triggered by the same trigger condition. For example, when the carbon monoxide concentration in the air is greater than the preset threshold, both the windows and the doors can be controlled to open. The action priority indicates the priority between the action resources corresponding to controlling the window opening and the action resources corresponding to controlling the door opening, that is, the order of precedence. For example, when the action priority of the action resource with the window as the target resource takes precedence over the action priority of the action resource with the door as the target resource, when the carbon monoxide concentration in the air is greater than the preset threshold, first, the window is controlled to open, and then the door is controlled to open.
[0075] For example, the subject resource attribute of the action resource can be updated in a predefined manner. For example, an application entity registered on the server can send information to the server in a periodic, real-time or responsive manner to the occurrence of a preset event to update the subject resource attribute. When the information received from the application entity makes the evaluation rule of the action resource meet the action triggering condition of the action resource, a preset action can be performed for the target resource corresponding to the target identification attribute of the action resource. In this article, the subject resource attribute may also be referred to as the subject resource.
[0076] In some embodiments, the evaluation rule attribute may include at least one trigger condition, and the dependent sub-resource may include at least one dependency condition. Figure 1C The action resource shown is used to execute a preset action, ie, the action defined in the action attribute, for the target resource corresponding to the target identification attribute when the trigger condition included in the evaluation rule attribute and the dependency condition included in the dependency sub-resource are met.
[0077] Although an illustrative example of implementing action resources is shown in the present disclosure, those skilled in the art can understand that the above-mentioned action resources can also be set in other ways according to different actual situations.
[0078] Figure 2 A schematic diagram of a smart home scenario in an Internet of Things environment provided for some embodiments of the present disclosure.
[0079] For example, in one example, Figure 2 As shown, taking the smart home scene as an example, three application entities are set in the smart home scene, namely, a door and window control device, a gas monitoring device (for example, provided by a smart security provider) and an air monitoring and purification device (for example, provided by a smart home appliance provider). It can be understood that when there are multiple smart control devices in the IoT environment of a smart home, the application entity can deploy multiple services for the same target resource (i.e., target object), that is, create multiple action resources for the same target resource, and the multiple actions executed by the multiple action resources for the target resource and the triggering conditions of the multiple actions can be different.
[0080] like Figure 2 As shown, the application entity is correspondingly set at the application layer, and the general service entity is set at the service layer (ie, the Internet of Things platform). The actions provided by the gas monitoring device and the air monitoring and purification device through the service layer both act on the door and window control device.
[0081] The gas monitoring device can register action resource 1 on the general service entity, which indicates that the gas monitoring device detects the carbon monoxide concentration in the air through a carbon monoxide sensor. When the carbon monoxide concentration exceeds a preset threshold (for example, 20%), the general service entity can trigger the door and window control device to open the windows (or doors) for ventilation to reduce the concentration of combustible gases (for example, carbon monoxide).
[0082] The air monitoring and purification device can register action resource 2 on the general service entity, which indicates that the air monitoring and purification device uses an air quality monitoring sensor (such as a haze sensor) to detect the concentration of PM2.5 (haze) in the air. When the concentration of PM2.5 exceeds a preset threshold, the general service entity can trigger the door and window control device to close the windows (or doors) for sealing, and then start the air purification device to reduce the concentration of PM2.5 in the air.
[0083] The above two action resources are both related to controlling the same execution unit (i.e., the door and window control device), but action resource 1 controls the door and window control device to perform the window opening operation, and action resource 2 controls the door and window control device to perform the window closing operation, so there may be a conflict between action resource 1 and action resource 2. Here, the conflict may include: first, the two action resources need to be triggered at the same time, and the two operations performed by the door and window control device are opposite; second, another action resource is triggered after one action resource, but the specific effect actually produced by the other action resource is opposite to the effect that the one action resource needs to achieve.
[0084] The embodiments of the present disclosure provide a method for creating an action resource, a method for executing an action, an electronic device, and a computer-readable storage medium. In the method for creating an action resource, by adding an action state attribute to the action resource, based on the dependency conditions related to the action state attribute, the conflict problem of the action resource can be solved. It should be noted that in the embodiments of the present disclosure, the method for creating an action resource and the method for executing an action are both executed by, for example, a general service entity.
[0085] Flowcharts are used in the present disclosure to illustrate the steps of the method according to the embodiments of the present disclosure. It should be understood that the preceding or following steps are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more steps may be removed from these processes.
[0086] Figure 3A A flowchart of a method for creating an action resource provided by some embodiments of the present disclosure is shown. Figure 3B A flowchart of another method for creating an action resource provided by some embodiments of the present disclosure is shown. For example, taking the use environment of a smart home as an example, the general service entity can be implemented as a home management server, and the application entity (application) can be implemented as a home management application (e.g., carbon monoxide sensor, temperature sensor, door and window sensor, etc.).
[0087] For example, Figure 3A As shown, in some embodiments, the method for creating an action resource may include:
[0088] S101: receiving a first creation request, wherein the first creation request includes a first target resource;
[0089] S102: Create a first action resource according to a first creation request, wherein the first action resource is a resource used to trigger a first action for a first target resource.
[0090] For example, the first creation request is used to request the general service entity to create a first action resource.
[0091] For example, the first target resource may be a window, a door, an air purifier, a lamp, an air conditioner, and the like.
[0092] It should be noted that, in some embodiments provided in the present disclosure, taking the operation performed on a window as an example, that is, the first target resource is a window, the general service entity can send a notification to the window controller to control the opening and closing of the window.
[0093] For example, the first action may include any operation such as turning on, turning off, brightening the light, dimming the light, raising the temperature, lowering the temperature, etc. It should be noted that in the present disclosure, if the first target resource is an air conditioner, if it is necessary to perform an action of turning on the air conditioner for cooling, the first action may include the operation of turning on the air conditioner and the operation of setting the air conditioner to cooling mode. That is to say, in the present disclosure, the action corresponding to the action resource may include multiple operations for the target resource, so as to ultimately achieve the preset effect. For example, in the above example, the first action may include two operations, namely, the operation of turning on the air conditioner and the operation of setting the air conditioner to cooling mode, so as to achieve the effect of turning on the air conditioner for cooling.
[0094] For example, when the first trigger condition is met, the first action is triggered for the first target resource. The first trigger condition can be set according to the actual situation. For example, in some examples, the first trigger condition can be various conditions such as the concentration of carbon monoxide is higher than a preset threshold, the concentration of PM2.5 exceeds a preset threshold, the brightness of the indoor light is greater than or less than a preset threshold, a user is detected within a certain range (for example, in a bedroom, living room, etc.), the temperature is higher / lower than a preset temperature threshold, etc.
[0095] For example, the first creation request may be sent by an application entity (eg, an air monitoring and purification device) to a general service entity, or may be created by a user in the general service entity for the application entity.
[0096] For example, when an application entity wishes to deploy an action on a service platform, it can send a request to create an action resource for the action to the service platform, so that the general service entity deployed on the service platform can create the action resource. For example, in some examples, the first action resource is a resource for triggering the closing of a window (i.e., the first action) for a window (i.e., the first target resource). For example, the first action resource represents a resource for "when the PM2.5 concentration in the air is detected to be higher than a preset threshold value A (e.g., 100 or 150, etc.), a closing operation is performed on the window". The first trigger condition is that the PM2.5 concentration is higher than the preset threshold value A, the first target resource is the window, and the first action is to close the window. The preset threshold value A can be set according to actual application requirements. For example, an application entity can send a first creation request to a general service entity (e.g., a home management server), and after the general service entity passes the identity verification of the application entity, the first action resource is deployed on the general service entity: when the PM2.5 concentration in the air is detected to be higher than the preset threshold value A, a closing operation is performed on the window. For example, the PM2.5 concentration in the air can be detected by an air quality monitoring sensor registered to the service platform, and the window closing operation can be performed by a window controller registered to the service platform.
[0097] For example, in step S102, Figure 3A As shown, creating a first action resource includes S1021: creating a first action state attribute for the first action resource.
[0098] Figure 4A A schematic diagram of a first action resource provided by some embodiments of the present disclosure is shown.
[0099] For example, Figure 4A As shown, the first action resource ( <action1>) may include a first action status attribute (actionStatus). The first action status attribute indicates the status of the first action. The first action status attribute is a status value.
[0100] For example, in step S102, the attribute value of the first action state attribute includes a first set value and a second set value, and the state of the first action includes valid (active) or invalid (inactive). For example, when the attribute value of the first action state attribute is the first set value, the state of the first action is valid, that is, the first set value is active, indicating that the first action is triggered to execute; when the attribute value of the first action state attribute is the second set value, the state of the first action is invalid, that is, the second set value is inactive, indicating that the first action is not triggered to execute. For example, when the first action resource is created, but the first action is not triggered, the attribute value of the first action state attribute is the second set value, that is, the state of the first action is invalid; and when the first action resource is created and the first action is triggered, the attribute value of the first action state attribute is the first set value, that is, the state of the first action is valid.
[0101] For example, in a case where the first action resource is a resource used to trigger an action of opening a window (i.e., the first action) for a window (i.e., the first target resource), after the first action resource is created, but no notification is sent to the window controller to control the opening of the window, the attribute value of the first action state attribute is the second set value, and when a notification is sent to the window controller to control the opening of the window, the attribute value of the first action state attribute changes from the second set value to the first set value.
[0102] The embodiments of the present disclosure are described by taking the example that the first set value indicates that the state of the first action is valid, and the second set value indicates that the state of the first action is invalid, but the present disclosure is not limited thereto. In some embodiments, the first set value may also indicate that the state of the first action is invalid, and correspondingly, the second set value indicates that the state of the first action is valid. It should be noted that at any time, the attribute value of the first action state attribute is the first set value or the second set value, that is, the attribute value of the first action state attribute cannot be the first set value and the second set value at the same time.
[0103] It should be noted that, in some embodiments, the first action resource is also used to trigger a predefined action (e.g., closing the door) for a target resource (e.g., door) different from the first target resource (e.g., window) according to a first trigger condition (e.g., PM2.5 concentration is higher than a preset threshold value A). For example, in one example, the predefined action and the first action may be the same, and a closing operation may be triggered for a window according to the first trigger condition and a closing operation may be triggered for a door according to the first trigger condition; in other examples, the predefined action may be different from the first action, for example, a closing operation may be triggered for a window according to the first trigger condition and an opening operation may be triggered for an air purifier according to the first trigger condition. That is, the first action resource may include multiple target resources, and a predefined action may be performed on one or more of the multiple target resources when the trigger condition is met, and the multiple target resources are different, and the predefined actions corresponding to the multiple target resources may be different, or the predefined actions corresponding to at least some of the target resources may be the same.
[0104] For example, in step S102, creating the first action resource further includes: creating a first action time attribute for the first action resource. For example, the first action time attribute is used to indicate a time parameter related to the first action.
[0105] For example, Figure 4A As shown, the first action resource also includes a first action time attribute (actionActiveTime). The first action time attribute is a state value, and the first action time attribute represents the time that has elapsed after the first action has been triggered to execute. For example, after the first action resource is established, the first action is not triggered to execute, and the attribute value of the first action time attribute is not set, or is empty or does not exist, and the attribute value of the first action time attribute does not have a corresponding meaning; when the first action resource is established, when the first action is triggered to execute, a related timer can be established, and the timing value (time value) of the timer can be used as the attribute value of the first action time attribute. It should be noted that the timing value of the timer can include various values that can represent time, such as the duration recorded by the timer, the start time and / or end time of the timer timing.
[0106] For example, the time parameter associated with the first action may include at least one of the duration after triggering the first action, the start time of executing the first action, and the end time of executing the first action. It should be noted that, in some embodiments, the time parameter is not necessarily a direct time, but may also be an indirect time, such as the number of executions.
[0107] For example, in some embodiments, Figure 3B As shown, the creation method may also include:
[0108] S201: receiving a second creation request, wherein the second creation request includes a second target resource;
[0109] S202: Create a second action resource according to the second creation request, wherein the second action resource is a resource used to trigger a second action for a second target resource, and the second action is triggered for the second target resource when a second trigger condition is met.
[0110] For example, the second creation request is used to request the general service entity to create a second action resource.
[0111] For example, the first target resource and the second target resource are the same target resource. For example, in one example, the first target resource and the second target resource are both windows (one window or all windows in a room). However, the present disclosure is not limited thereto. In other examples, the first target resource and the second target resource may also be different target resources. For example, the first target resource is a window in a living room, while the second target resource is a window in a bedroom; or, the first target resource is a window (one window or all windows in a room), while the second target resource is a door (one door or all doors in a room).
[0112] For example, the second target resource may be a window, a door, an air purifier, a lamp, an air conditioner, and the like.
[0113] For example, the second action may include any operation such as turning on, turning off, brightening the light, dimming the light, raising the temperature, lowering the temperature, etc.
[0114] For example, the second action is different from the first action, that is, the second action may be any other action different from the first action. For example, in some examples, the first action and the second action conflict with each other. For example, the first action may refer to setting the air conditioner to 25°C, and the second action may refer to setting the air conditioner to 18°C. For example, in one example, the first action and the second action are opposite to each other. For example, when the first action includes performing an opening operation on the first target resource (e.g., opening a window, turning on a purifier), the second action may include performing a closing operation on the second target resource (e.g., closing a window, turning off a purifier). For example, in some examples, the first action may be opening a window, and the second action may be closing a window.
[0115] For example, the second trigger condition can be set according to actual conditions. For example, in some examples, the second trigger condition can be various conditions such as the concentration of carbon monoxide is higher than a preset threshold, the concentration of PM2.5 exceeds a preset threshold, the brightness of the indoor light is greater than or less than a preset threshold, a user is detected within a certain range (for example, in a bedroom, living room, etc.), the temperature is higher / lower than a preset temperature threshold, etc.
[0116] For example, in some examples, the second trigger condition may be different from the first trigger condition. For example, when the first action resource is used to close the window when the haze parameter (i.e., the concentration of PM2.5) is greater than a preset threshold value A, and the second action resource is used to open the window when the concentration of carbon monoxide in the air is higher than a preset threshold value B, the first trigger condition may be set to the haze parameter being greater than the preset threshold value A, and the second trigger condition may be set to the concentration of carbon monoxide being higher than the preset threshold value B.
[0117] For example, the second creation request may also be sent by the application entity (eg, a gas monitoring device) to the general service entity, or may be created by the user in the general service entity for the application entity.
[0118] For example, the application entity may send a second creation request to the general service entity. After the general service entity passes the identity verification of the application entity, a second action resource is deployed on the general service entity: when the concentration of carbon monoxide in the air is detected to be higher than a preset threshold B, an opening operation is performed on the window.
[0119] For example, in step S202, Figure 3B As shown, creating a second action resource includes S2021: creating a second action state attribute for the second action resource.
[0120] Figure 4B A schematic diagram of a second action resource provided by some embodiments of the present disclosure is shown.
[0121] For example, Figure 4B As shown, the second action resource ( <action2>) may include a second action status attribute (actionStatus). The second action status attribute indicates the status of the second action. The second action status attribute is a status value.
[0122] For example, the attribute value of the second action state attribute also includes the first set value and the second set value, that is, the state of the second action includes valid or invalid. For example, when the attribute value of the second action state attribute is the first set value, the state of the second action is valid, indicating that the second action is triggered to execute; when the attribute value of the second action state attribute is the second set value, the state of the second action is invalid, indicating that the second action is not triggered to execute. For the detailed description of the second action state attribute, please refer to the description of the first action state attribute above, and the repeated parts will not be repeated.
[0123] For example, in some examples, the second action resource may be a resource for triggering the opening of a window (i.e., the second action) for a window (i.e., the second target resource). For example, the second action resource may represent a resource for "when the concentration of carbon monoxide in the air is detected to be higher than a preset threshold value B (e.g., 20%), an opening operation is performed on the window." The second trigger condition is that the concentration of carbon monoxide is higher than the preset threshold value B, the second target resource is the window, and the second action is to open the window. For example, the concentration of carbon monoxide in the air can be detected by a carbon monoxide sensor registered to the service platform, and the preset threshold value B can be set according to actual application requirements.
[0124] For example, creating the second action resource further includes: creating a second action time attribute for the second action resource. For example, the second action time attribute is used to indicate a time parameter related to the second action. For example, the time parameter related to the second action includes at least one of a duration after executing the second action, a start time of executing the second action, and an end time of executing the second action.
[0125] For example, Figure 4B As shown, the second action resource also includes a second action time attribute (actionActiveTime). The second action time attribute is a state value, and the second action time attribute represents the time elapsed after the second action has been triggered to execute. It should be noted that, for the detailed description of the second action state attribute, reference can be made to the description of the first action time attribute above, and the repeated parts will not be repeated. In the following embodiments of the present disclosure, if not explicitly stated, the first action time attribute is used to indicate the duration after executing the first action and the second action time attribute is used to indicate the duration after executing the second action in order to describe the embodiments of the present disclosure.
[0126] It is worth noting that Figure 4A and 4B As shown, each of the first action resource or the second action resource may also include: a dependency priority attribute (evalPriority) indicating the priority of the dependency condition of the action resource, an action priority attribute (actionPriority), a subject resource attribute (actionSubjectResource), a subject resource identification attribute (SubjectResourceID), an evaluation rule attribute (evalCriteria), a trigger mode attribute (evalMode), a trigger mode control attribute (evalControlParam), a target identification attribute (objectResourceID), an action attribute of the action mode (activePrimitive), an input attribute of the action parameter (input), an output resource identification attribute of the action result (outputResourceID), an action result attribute (actionResult), and a dependent sub-resource ( <dependency>). For example, the action result is a state value. It should be noted that the dependency priority attribute of the first action resource indicates the judgment order of the multiple dependency conditions when the first action resource has multiple dependency conditions; the dependency priority attribute of the second action resource indicates the judgment order of the multiple dependency conditions when the second action resource has multiple dependency conditions.
[0127] It should be noted that, in the present disclosure, multiple attribute values of the first action resource or the second action resource can be created based on the same creation request, or can be created based on multiple creation requests. For example, in some examples, the remaining attributes of the first action resource except for the dependent sub-resources (e.g., the first dependent sub-resource and / or the second dependent sub-resource) can be created based on the first creation request, and the dependent sub-resources of the first action resource can be created based on the third creation request sent to the general service entity; or, the first action state attribute and the first action time attribute of the first action resource can be created based on the first creation request, and the remaining attributes of the first action resource except for the first action state attribute and the first action time attribute can be created based on the third creation request sent to the general service entity. The present disclosure does not impose specific restrictions on the specific creation time and process of each attribute in the first action resource and the second action resource.
[0128] For example, in some embodiments, the first creation request also includes dependent resource information.
[0129] For example, in some examples, creating the first action resource further includes: creating a first dependent sub-resource for the first action resource according to the dependent resource information. For example, the first dependent resource includes a first dependent condition, and the first dependent condition is related to the second action state attribute. For example, when the first trigger condition and the first dependent condition are met at the same time, the first action is triggered for the first target resource.
[0130] For example, when the first action resource includes a first dependent sub-resource, when the first trigger condition is met, the general service entity can determine whether the first dependency condition in the first dependent sub-resource is met based on the second action state attribute; when the second action state attribute satisfies the first dependency condition, the first action can be triggered for the first target resource; when the second action state attribute does not satisfy the first dependency condition, the first action is not triggered.
[0131] For example, in some other examples, creating the first action resource further includes: creating a second dependent sub-resource for the first action resource according to the dependent resource information. For example, the second dependent sub-resource includes a second dependent condition, and the second dependent condition is related to the second action time attribute. For example, when the first trigger condition and the second dependent condition are met at the same time, the first action is triggered for the first target resource.
[0132] For example, when the first action resource includes a second dependent sub-resource, when the first trigger condition is met, the general service entity can determine whether the second dependency condition in the second dependent sub-resource is met based on the second action time attribute; when the second action time attribute meets the second dependency condition, the first action can be triggered for the first target resource; when the second action time attribute does not meet the second dependency condition, the first action is not triggered.
[0133] For example, in some other examples, creating the first action resource further includes: creating a first dependent sub-resource and a second dependent sub-resource for the first action resource according to the dependent resource information. For example, the first dependent resource includes a first dependent condition, the first dependent condition is related to the second action state attribute, and the second dependent sub-resource includes a second dependent condition, the second dependent condition is related to the second action time attribute. For example, when at least one of the first dependent condition and the second dependent condition and the first trigger condition are satisfied at the same time, the first action is triggered for the first target resource.
[0134] For example, in the case where the first action resource includes multiple dependent sub-resources, the relationship between the multiple dependent sub-resources can be a necessary relationship or a sufficient relationship. If the relationship between the multiple dependent sub-resources is a sufficient relationship, when any one of the multiple dependent sub-resources is satisfied, the first action can be triggered for the first target resource; if the relationship between the multiple dependent sub-resources is a necessary relationship, the first action can be triggered for the first target resource only when all the multiple dependent sub-resources are satisfied. For example, in one embodiment, the first action resource includes a first dependent sub-resource and a second dependent sub-resource. If the first dependent sub-resource and the second dependent sub-resource are in a sufficient relationship, when the first trigger condition is met, the first dependent sub-resource is first verified. If the first dependent sub-resource is verified, the second dependent sub-resource does not need to be verified, that is, the first action can be triggered for the first target resource. If the first dependent sub-resource is not verified, the second dependent sub-resource is verified. If the second dependent sub-resource is verified, the first action can be triggered for the first target resource. If the second dependent sub-resource is not verified, the first action cannot be triggered for the first target resource. If the first dependent sub-resource and the second dependent sub-resource are in a necessary relationship, when the first trigger condition is met, the first dependent sub-resource is verified first. If the first dependent sub-resource passes the verification, the second dependent sub-resource is verified. If the second dependent sub-resource passes the verification, the first action can be triggered for the first target resource. If either the first dependent sub-resource or the second dependent sub-resource fails the verification, the first action cannot be triggered for the first target resource.
[0135] For example, when the first action resource includes the first dependent sub-resource and the second dependent sub-resource, and the first dependent sub-resource and the second dependent sub-resource are in a sufficient relationship, when the first trigger condition is met, the general service entity can first determine whether the first dependency condition in the first dependent sub-resource is met according to the second action state attribute, and when the second action state attribute satisfies the first dependency condition, the first action can be triggered for the first target resource; when the second action state attribute does not meet the first dependency condition, it is determined whether the second dependency condition in the second dependent sub-resource is met according to the second action time attribute, and when the second action time attribute meets the second dependency condition, the first action can be triggered for the first target resource. When the second action state attribute does not meet the first dependency condition, and the second action time attribute does not meet the second dependency condition, the first action cannot be triggered.
[0136] For example, based on the dependent resource information, the general service entity can create a first dependent sub-resource and / or a second dependent sub-resource for the first action resource. The number of dependent sub-resources of the first action resource can be set according to actual application requirements, and the present disclosure does not limit this.
[0137] For example, the first dependency condition includes that the attribute value of the second action state attribute and the first setting value satisfy the first preset logical relationship, and the first setting value is valid or invalid. The second dependency condition includes that the attribute value of the second action time attribute and the preset action time satisfy the second preset logical relationship.
[0138] For example, in some examples, for a state, the first preset logical relationship may include equal to or not equal to, that is, the first preset logical relationship may indicate that the attribute value of the second action state attribute is equal to the first set value, or the attribute value of the second action state attribute is not equal to the first set value. If the first set value is valid, the first preset logical relationship may indicate that the attribute value of the second action state attribute is equal to valid or the attribute value of the second action state attribute is not equal to valid; if the first set value is invalid, the first preset logical relationship may indicate that the attribute value of the second action state attribute is equal to invalid or the attribute value of the second action state attribute is not equal to invalid.
[0139] For example, in some examples, with respect to time, the second preset logical relationship may include equal to, not equal to, greater than, less than, greater than or equal to, less than or equal to, longer than, shorter than, longer than or equal to, shorter than or equal to, etc. For example, in some examples, if the second action time attribute represents the duration after the second action is triggered, and the preset action time represents the time range in which the second action resource has exclusive use of the second target resource after the second action is executed, then the second preset logical relationship may represent that the attribute value of the second action time attribute is greater than or greater than or equal to, or longer than or equal to, or longer than the preset action time. For example, in other examples, if the second action time attribute represents the remaining time in which the second action resource has exclusive use of the second target resource after the second action is executed, the preset action time may be 0, and then the second preset logical relationship may represent that the attribute value of the second action time attribute is equal to the preset action time.
[0140] For example, the preset action time can be preset according to actual application requirements. For example, the preset action time can be 0, 5 minutes, 72 hours, etc.
[0141] It should be noted that in the present disclosure, if not explicitly stated, the first set value is valid, the first dependency condition indicates that the attribute value of the second action state attribute is not equal to the first set value; the second action time attribute indicates the duration after triggering the second action, the preset action time indicates the time range in which the second action resource has exclusivity for the target resource after the second action is executed, and the second dependency condition indicates that the second action time attribute is greater than the preset action time as an example.
[0142] For example, each dependent sub-resource of the first action resource may include at least one dependent condition. For example, in some embodiments, the first action resource may include only one dependent sub-resource, and the dependent sub-resource includes two dependent conditions, and the two dependent conditions are respectively that the attribute value of the second action state attribute is not equal to the first set value and the attribute value of the second action time attribute is greater than the preset action time.
[0143] For example, in some embodiments, the first action resource is a resource for triggering closing a window (i.e., a first action) for a window (i.e., a first target resource). For example, when the concentration of PM2.5 detected in the air is higher than a preset threshold value A (e.g., 150), a closing operation is performed on the window. The second action resource is a resource for triggering opening a window (i.e., a second action) for a window (i.e., a second target resource). For example, when the concentration of carbon monoxide detected in the air is higher than a preset threshold value B (e.g., 20%), an opening operation is performed on the window. Table 1 below shows the various attribute values of the second action resource in an example of this embodiment, and Table 2 below shows the various attribute values of the first action resource in an example of this embodiment.
[0144] Table 1: Action2
[0145]
[0146] For example, Table 1 shows 12 attribute values of the second action resource. In Table 1, attribute value 8 is the same as the data packaged in content in attribute value 7. For example, attribute value 8 can also be represented as resourceID (resource identification code) or the URI of a resource attribute (URI (Universal Resource Identifier) of a resource attribute).
[0147] Table 2: Action1
[0148]
[0149] For example, Table 2 shows 12 attribute values of the first action resource, the first dependent sub-resource 1, and the second dependent sub-resource 2. In Table 2, attribute value 8 is the same as the data packaged in content in attribute value 7. For example, attribute value 8 can also be represented as resourceID (resource identification code) or the URI of a resource attribute (URI (Universal Resource Identifier) of a resource attribute), etc.
[0150] Table 3 shows the first dependent sub-resource 1 of the first action resource; Table 4 shows the second dependent sub-resource 2 of the first action resource.
[0151] Table 3
[0152]
[0153] Table 4
[0154]
[0155] For example, it can be seen from Tables 3 and 4 above that the first dependent sub-resource 1 includes three attribute values. The second dependent sub-resource 2 also includes three attribute values, and the three attribute values in the first dependent sub-resource 1 or the second dependent sub-resource 2 are respectively a logic attribute (logic), a dependent resource identification attribute (dependentResourceID), and an evaluation rule attribute (evalCriteria).
[0156] The logic attribute value in the first dependent sub-resource 1 or the second dependent sub-resource 2 indicates the relationship between multiple dependent sub-resources, and the logic attribute value includes sufficient (SUFFICIENT) and necessary (NECESSARY). When the logic attribute value is sufficient (SUFFICIENT), it means that as long as any one of the multiple dependent sub-resources is satisfied, the corresponding action can be triggered for the target resource; when the logic attribute value is necessary (NECESSARY), it means that multiple dependent sub-resources need to be satisfied at the same time before the corresponding action can be triggered for the target resource.
[0157] For example, the first dependent sub-resource 1 includes a first dependent condition, and the first dependent condition is that the attribute value of the second action state attribute is not equal to the first set value. It can be seen from Tables 3 and 4 above that the first set value is valid (i.e., Active), that is, the first dependent condition includes that the attribute value of the second action state attribute is not equal to valid; the second dependent sub-resource 2 includes a second dependent condition, and the second dependent condition is that the attribute value of the second action time attribute is greater than the preset action time. It can be seen from Tables 3 and 4 above that the preset action time is 72 hours, that is, the second dependent condition is that the attribute value of the second action time attribute is greater than 72 hours.
[0158] For example, in some embodiments, the first action resource is a resource for triggering an action of closing a window when the concentration of PM2.5 in the air is detected to be higher than a preset threshold; the second action resource is a resource for triggering an action of opening a window when the concentration of carbon monoxide in the air is detected to be higher than a preset threshold. In the embodiments of the present disclosure, it can be seen from the above Tables 1-4 that when the first trigger condition of the first action resource is met, if the second action is not triggered for execution or the second action has been triggered for execution for more than 72 hours, the first action can be triggered for the window. The second action state attribute and the second action time attribute in the second action resource can be fully utilized in the dependent sub-resources of the first action resource, avoiding conflicts in action triggering resources and improving the execution efficiency of the action.
[0159] Figure 5 FIG. 2 shows an illustrative example of creating an action resource according to an embodiment of the present disclosure. Figure 5 As shown, the second action resource of the second action 2 already exists in the general service entity. The second action 2 can be used to open the window when the concentration of carbon monoxide (CO) is greater than or equal to the preset threshold value B. Then, the general service entity can receive an action resource creation request for the first action 1, and the first action 1 can be used to close the window when the concentration of PM2.5 is greater than the preset threshold value A.
[0160] exist Figure 5 In the example shown, the first dependency condition of the first action 1 can be set according to the second action state attribute in the second action resource of the second action 2, for example, the first dependency condition is that the attribute value of the second action state attribute is not equal to the first set value; and / or, the second dependency condition of the first action 1 can be set according to the second action time attribute in the second action resource of the second action 2, for example, the second dependency condition is that the attribute value of the second action time attribute is greater than the preset action time.
[0161] According to the creation method provided by the present disclosure, a first action resource of a first action 1 can be created, and the trigger condition of the first action 1 (i.e., the first trigger condition) is that the concentration of PM2.5 is greater than a preset threshold value A, and the first dependent condition is that the attribute value of the second action state attribute is not equal to the first set value and / or the second dependent condition is that the attribute value of the second action time attribute is greater than the preset action time. In this case, when at least one of the following conditions is satisfied: the concentration of PM2.5 is greater than the preset threshold value A, the attribute value of the second action state attribute is not equal to the first set value, and the attribute value of the second action time attribute is greater than the preset action time, the window closing operation can be performed.
[0162] For example, in some embodiments, creating a first action resource further includes: creating a first opposite action attribute and a first state control attribute for the first action resource. For example, creating a second action resource further includes: creating a second opposite action attribute and a second state control attribute for the second action resource.
[0163] Fig. 6A A schematic diagram showing another first action resource provided by some embodiments of the present disclosure is shown. Figure 6B A schematic diagram of another second action resource provided by some embodiments of the present disclosure is shown.
[0164] For example, Fig. 6A As shown, the first action resource also includes a first reverse action attribute (reverseAction) and a first state control attribute (statusControl); Figure 6B As shown, the second action resource also includes a second reverse action attribute (reverseAction) and a second status control attribute (statusControl).
[0165] By setting the first opposite action attribute, the first state control attribute, the second opposite action attribute and the second state control attribute, it can be ensured that the attribute value of the first action state attribute and the attribute value of the second action state attribute are opposite to each other at any time (except the initial time).
[0166] For example, in some embodiments, when the temperature is greater than 27 degrees Celsius (i.e., the first trigger condition), the operation of turning on the air conditioning refrigeration can be triggered for the air conditioner, and when the temperature is less than 23 degrees Celsius (i.e., the second trigger condition), the operation of turning off the air conditioning refrigeration can be triggered for the air conditioner. A first action resource can be deployed on the general service entity: when the temperature is detected to be greater than 27 degrees Celsius, the operation of turning on the air conditioning refrigeration is performed for the air conditioner. A second action resource can also be deployed on the general service entity: when the temperature is detected to be less than 23 degrees Celsius, the operation of turning off the air conditioning refrigeration is performed for the air conditioner. That is, the first action is to turn on the air conditioning refrigeration, and the second action is to turn off the air conditioning refrigeration. At this time, the first opposite action attribute represents the identification code of the second action resource, and the second opposite action attribute represents the identification code of the first action resource, that is, in this case, the first action corresponding to the first action resource and the second action corresponding to the second action resource are opposite actions to each other. The first state control attribute represents whether to change the attribute value of the first action state attribute or the attribute value of the second action state attribute, and the second state control attribute represents whether to change the attribute value of the second action state attribute or the attribute value of the first action state attribute.
[0167] For example, the attribute value of the first state control attribute may include true or false, and the attribute value of the second state control attribute may also include true or false. When the attribute value of the first state control attribute is true, it may indicate that the second action state attribute may be changed, for example, the attribute value of the second action state attribute may be changed according to the attribute value of the first action state attribute; or it may indicate that the first action state attribute may be changed, for example, the attribute value of the first action state attribute may be changed according to the attribute value of the second action state attribute. When the attribute value of the second state control attribute is true, it may indicate that the first action state attribute may be changed, for example, the attribute value of the first action state attribute may be changed according to the attribute value of the second action state attribute; or it may indicate that the second action state attribute may be changed, for example, the attribute value of the second action state attribute may be changed according to the attribute value of the first action state attribute. When the attribute value of the first state control attribute is false, it indicates that the attribute value of the second action state attribute cannot be changed, for example, the attribute value of the second action state attribute cannot be changed according to the attribute value of the first action state attribute; or, it may also indicate that the attribute value of the first action state attribute cannot be changed, for example, the attribute value of the first action state attribute cannot be changed according to the attribute value of the second action state attribute; when the attribute value of the second state control attribute is false, it indicates that the attribute value of the first action state attribute cannot be changed, for example, the attribute value of the first action state attribute cannot be changed according to the attribute value of the second action state attribute; or, it may also indicate that the attribute value of the second action state attribute cannot be changed, for example, the attribute value of the second action state attribute cannot be changed according to the attribute value of the first action state attribute. That is to say, in the present disclosure, the state control attribute in the action resource can be used to indicate whether the attribute value of the action state attribute of the action resource itself can be changed, and it can also indicate whether the attribute value of the action state attribute of an action resource that is mutually exclusive with the action resource can be changed.
[0168] For example, in some examples, the attribute value of the first state control attribute is true, and the attribute value of the second state control attribute is also true. When the first action resource and the second action resource are both established, at the initial moment, the attribute value of the first action state attribute of the first action resource is the second set value (i.e., inactive), and the attribute value of the second action state attribute of the second action resource is the second set value (i.e., inactive). When the second action is triggered at moment t1, the attribute value of the second action state attribute of the second action resource changes from the second set value (i.e., inactive) to the first set value (i.e., active). At this time, since the attribute value of the second action state attribute is the first set value, and the attribute value of the first action state attribute and the attribute value of the second action state attribute need to remain mutually exclusive, the attribute value of the first action state attribute of the first action resource is the second set value (which does not actually change). At time t2 after time t1, after the first action is triggered, the attribute value of the first action state attribute of the first action resource changes from the second set value to the first set value. At this time, since the attribute value of the first action state attribute is the first set value, and the attribute value of the first action state attribute and the attribute value of the second action state attribute need to remain mutually exclusive, the attribute value of the second action state attribute of the second action resource changes from the first set value to the second set value, so as to ensure that the attribute value of the first action state attribute and the attribute value of the second action state attribute are opposite to each other. The above process is repeated, so that at subsequent moments, the attribute value of the first action state attribute alternates between the first set value and the second set value, and correspondingly, the attribute value of the second action state attribute alternates between the second set value and the first set value, so as to ensure that the attribute value of the first action state attribute and the attribute value of the second action state attribute are opposite to each other.
[0169] For example, in some embodiments, the first action resource is a resource for triggering the air conditioning cooling operation to be turned on (i.e., the first action includes turning on the air conditioning cooling operation) for the air conditioner (i.e., the first target resource), for example, the first action is to perform the turning on of the air conditioning cooling operation for the air conditioner when the temperature is detected to be higher than 27 degrees Celsius. The second action resource is a resource for triggering the turning off of the air conditioning cooling (i.e., the second action includes turning off the air conditioning cooling operation) for the air conditioner (i.e., the second target resource), for example, the first action is to perform the turning off of the air conditioning cooling operation for the air conditioner when the temperature is detected to be lower than 23 degrees Celsius.
[0170] Table 5 below shows various attribute values of the second action resource in an example of this embodiment, and Table 6 below shows various attribute values of the first action resource in an example of this embodiment.
[0171] Table 5: Action2
[0172]
[0173] For example, Table 5 shows 14 attribute values of the second action resource.
[0174] Table 6: Action1
[0175]
[0176]
[0177] For example, Table 6 shows 14 attribute values of the first action resource, the first dependent sub-resource 1, and the second dependent sub-resource 2.
[0178] Table 7 shows the first dependent sub-resource 1 of the first action resource; Table 8 shows the second dependent sub-resource 2 of the first action resource.
[0179] Table 7
[0180]
[0181] Table 8
[0182]
[0183] For example, the first dependent sub-resource 1 includes a first dependent condition, and the first dependent condition is that the attribute value of the second action state attribute is not equal to the first set value. It can be seen from Tables 7 and 8 above that the first set value is valid (i.e., Active); the second dependent sub-resource 2 includes a second dependent condition, and the second dependent condition is that the attribute value of the second action time attribute is greater than the preset action time. It can be seen from Tables 3 and 4 above that the preset action time is 5 minutes.
[0184] For example, in some examples, when the position of the temperature sensor is not set reasonably, the air conditioning cooling action will not be executed accurately. For example, if the temperature sensor is located near the air outlet of the air conditioner, at this time, although the air conditioner is set to adjust the temperature to 25 degrees Celsius, the temperature near the air outlet of the air conditioner is about 15 degrees Celsius. For example, at time t1, the temperature monitored by the temperature sensor is higher than 27 degrees Celsius, and the second action is triggered to execute, that is, the air conditioner is turned on to achieve cooling, and the air conditioner starts cooling; at time t2 after time t1, the temperature monitored by the temperature sensor becomes about 15 degrees Celsius, so at time t2, the first action is immediately triggered to turn off the air conditioner. The interval between moments t1 and t2 is short (for example, 1 minute, 2 minutes, etc.), so the temperature in the space does not drop below 27 degrees Celsius at moment t2. Then, at moment t3 after moment t2 (for example, the interval between moments t2 and t3 is also short (for example, 1 minute, 2 minutes, etc.)), the temperature monitored by the temperature sensor is higher than 27 degrees Celsius, and the second action is triggered again. As a result, the first action and the second action are repeatedly triggered in a short time, and the purpose of cooling down is not achieved.
[0185] According to the embodiments shown in Tables 5-8 above of the present disclosure, at time t1, the temperature is higher than 27 degrees Celsius, that is, the temperature monitored by the temperature sensor meets the second trigger condition (the temperature is higher than 27 degrees Celsius), the second action is triggered to be executed, the air conditioner is turned on to achieve cooling, and at the same time, the attribute value of the second action state attribute becomes the first set value, and the attribute value of the first action state attribute becomes the second set value; at time t2 after time t1, although the temperature monitored by the temperature sensor becomes about 15 degrees Celsius, that is, the temperature monitored by the temperature sensor meets the first trigger condition (the temperature is lower than 23 degrees Celsius), however, since the attribute value of the second action state attribute is the first set value, that is, the attribute value of the second action state attribute does not meet the first dependency condition in the first dependency sub-resource of the first action resource, and the time interval between time t2 and time t1 is 1 minute, that is, the attribute value of the second action time attribute is 1 minute, that is, the attribute value of the second action time attribute does not meet the second dependency condition in the second dependency sub-resource of the first action resource, and thus the first action cannot be triggered. At time t4 after time t1, the temperature detected by the temperature sensor (for example, about 15 degrees Celsius) meets the first trigger condition (temperature below 23 degrees Celsius). Although the attribute value of the second action state attribute (first set value) does not meet the first dependency condition in the first dependency sub-resource of the first action resource, since the time interval between time t4 and time t1 is 6 minutes, that is, the attribute value of the second action time attribute is 6 minutes, the attribute value of the second action time attribute meets the second dependency condition in the second dependency sub-resource of the first action resource. At this time, the first action is triggered to execute, and the air conditioner is turned off. At the same time, the attribute value of the first action state attribute becomes the first set value, and the attribute value of the second action state attribute becomes the second set value. Moreover, at time t4, since the air conditioner is turned on for a long time (for example, 6 minutes), the temperature in the space may have dropped below 27 degrees Celsius at time t4. Therefore, after the air conditioner is turned off, the second action will not be triggered immediately, but after the temperature detected by the temperature sensor is higher than 27 degrees Celsius, the second action will be triggered again. Finally, there will be no conflict between the first action resource and the second action resource, the air conditioner performs constant temperature setting according to the first action resource and the second action resource, and the temperature sensor can be set at any position.
[0186] It should be noted that each time the first action is triggered, the attribute value of the first action time attribute can be reset, that is, the attribute value of the first action time attribute can be cleared to zero; similarly, each time the second action is triggered, the attribute value of the second action time attribute can also be reset, that is, the attribute value of the second action time attribute can be cleared to zero.
[0187] Figure 7 A schematic diagram of yet another first action resource provided by some embodiments of the present disclosure is shown.
[0188] For example, in some embodiments, creating the first action resource further includes: creating a first state automatic control time attribute for the first action resource.
[0189] For example, Figure 7 As shown, the first action resource also includes a first status automatic control time attribute (StatusAutoControl).
[0190] For example, the attribute value of the first action state attribute includes a first setting value and a second setting value, and the first setting value and the second setting value are opposite to each other.
[0191] For example, in some examples, the first state automatic control time may represent: based on the attribute value of the first action state attribute being the first set value, and the attribute value of the first action time attribute being greater than or equal to the attribute value of the first state automatic control time attribute, the attribute value of the first action state attribute is changed from the first set value to the second set value. For example, when the first action is triggered, the attribute value of the first action state attribute is set to the first set value, and when the duration after the first action is executed is greater than or equal to the attribute value of the first state automatic control time attribute, the attribute value of the first action state attribute may be changed from the first set value to the second set value.
[0192] For example, in some other examples, the first state automatic control time can also be represented by: based on the attribute value of the first action state attribute being the first set value, and the attribute value of the first state automatic control time attribute being equal to 0, the attribute value of the first action state attribute is changed from the first set value to the second set value. For example, when the first action is triggered, the attribute value of the first action state attribute is set to the first set value, and at this time, the countdown starts based on the attribute value of the first state automatic control time attribute. When the attribute value of the first state automatic control time attribute is equal to 0, it means that the duration after the first action is executed is equal to the attribute value of the first state automatic control time attribute, so that the attribute value of the first action state attribute can be changed from the first set value to the second set value.
[0193] For example, in some embodiments, creating the second action resource further includes: creating a second state automatic control time attribute for the second action resource.
[0194] For example, the attribute value of the second action state attribute includes a first set value and a second set value, the first set value and the second set value are opposite to each other, and in some examples, the second state automatic control time indicates: based on the attribute value of the second action state attribute being the first set value, and the attribute value of the second action time attribute being greater than or equal to the attribute value of the second state automatic control time attribute, the attribute value of the second action state attribute is changed from the first set value to the second set value. In other examples, the second state automatic control time attribute may also indicate: based on the attribute value of the second action state attribute being the first set value, and the attribute value of the second state automatic control time attribute being equal to 0, the attribute value of the second action state attribute is changed from the first set value to the second set value.
[0195] For example, in some embodiments, the first action resource may be a resource for triggering opening a window (i.e., the first action) for a window (i.e., the first target resource), for example, when the concentration of carbon monoxide in the air is detected to be higher than a preset threshold value B (e.g., 20%), an opening operation is performed for the window. Table 9 below shows various attribute values of the first action resource in an example of this embodiment.
[0196] Table 9: Action1
[0197]
[0198] For example, Table 9 shows 15 attribute values of the second action resource, wherein attribute value 13 and attribute value 14 are set to null, that is, the two attribute values point to null.
[0199] For example, in the example shown in Table 9, when the concentration of carbon monoxide in the air is detected to be higher than a preset threshold, the first action is triggered for the window, that is, the operation of opening the window, and the attribute value of the first action state attribute is set to a first set value. When the duration after triggering the first action exceeds the attribute value of the first state automatic control time attribute (for example, in Table 9, it is 6 hours), the attribute value of the first action state attribute is changed from the first set value to the second set value.
[0200] Fig. 8A A schematic diagram of another first action resource provided by some embodiments of the present disclosure is shown. Figure 8B A schematic diagram of a conflict strategy sub-resource in a first action resource provided by some embodiments of the present disclosure is shown.
[0201] For example, in some embodiments, the first create request also includes conflicting policy resource information.
[0202] For example, creating the first action resource further includes: creating a conflict policy sub-resource for the first action resource based on the conflict policy resource information.
[0203] For example, in the case where the first action resource includes a conflict strategy sub-resource, creating the first action resource may further include: creating a first dependent sub-resource for the first action resource based on the second target resource, the second action, and the conflict strategy sub-resource satisfying a matching condition. Alternatively, creating the first action resource may further include: creating a second dependent sub-resource for the first action resource based on the second target resource, the second action, and the conflict strategy sub-resource satisfying a matching condition; or creating the first action resource may further include: creating a first dependent sub-resource and a second dependent sub-resource for the first action resource based on the second target resource, the second action, and the conflict strategy sub-resource satisfying a matching condition.
[0204] For example, the first dependent sub-resource includes a first dependent condition, the first dependent condition is related to the second action state attribute, and the second dependent sub-resource includes a second dependent condition, the second dependent condition is related to the second action time attribute. When at least one of the first dependent condition and the second dependent condition and the first trigger condition are satisfied at the same time, the first action is triggered for the first target resource. For example, when the first action resource includes the first dependent sub-resource, when the first dependent condition and the first trigger condition are satisfied at the same time, the first action is triggered for the first target resource; when the first action resource includes the second dependent sub-resource, when the second dependent condition and the first trigger condition are satisfied at the same time, the first action is triggered for the first target resource; when the first action resource includes the first dependent sub-resource and the second dependent sub-resource, when at least one of the first dependent condition and the second dependent condition and the first trigger condition are satisfied at the same time, the first action is triggered for the first target resource.
[0205] For example, Fig. 8A As shown, the first action resource also includes a conflict policy sub-resource (conflictPolicy).
[0206] For example, creating a conflict strategy sub-resource for a first action resource includes: creating a conflict target resource identification attribute and a conflict execution method attribute for the first action resource.
[0207] For example, Figure 8B As shown, the conflict strategy sub-resource includes a conflict target resource identification attribute (conflictObjectResourceID) and a conflict execution method attribute (conflictInput). For example, the conflict target resource identification attribute represents the identification code of the first target resource, and the conflict execution method attribute represents the action that conflicts with the first action.
[0208] For example, satisfying the matching condition includes: the identification code of the second target resource is the same as the conflict target resource identification attribute, and the second action is the same as the action represented by the conflict execution method attribute.
[0209] For example, in some embodiments, creating a conflict policy sub-resource for the first action resource further includes: creating a conflict status attribute for the first action resource.
[0210] It should be noted that in some other examples, the conflicting execution method attribute represents the first action. At this time, the matching conditions include: the identification code of the target resource of the second action resource is the same as the conflicting target resource identification attribute, and the second action conflicts with the action represented by the conflicting execution method attribute (ie, the first action).
[0211] For example, Figure 8B As shown, the conflict strategy sub-resource includes a conflict status attribute (conflictStatus), and the attribute value of the conflict status attribute may include a first set value or a second set value. For example, the first target resource and the second target resource are the same target resource, and the first action and the second action conflict with each other, which means that the second target resource, the second action and the conflict strategy sub-resource meet the matching condition. At this time, if the attribute value of the conflict status attribute is set to the first set value, it means that when the attribute value of the second action status attribute is the first set value, the first action cannot be triggered, and when the attribute value of the second action status attribute is the second set value, the first action can be triggered; on the contrary, if the attribute value of the conflict status attribute is set to the second set value, it means that when the attribute value of the second action status attribute is the second set value, the first action cannot be triggered, and when the attribute value of the second action status attribute is the first set value, the first action can be triggered.
[0212] For example, when the attribute value of the conflict state attribute is the first set value, the first dependent condition includes that the attribute value of the second action state attribute is not equal to the first set value, and the first set value is valid or invalid, and when the attribute value of the conflict state attribute is the second set value, the first dependent condition includes that the attribute value of the second action state attribute is not equal to the second set value. The second dependent condition includes that the attribute value of the second action time attribute is greater than the preset action time.
[0213] For example, in some examples, if a second action resource has been deployed on a general service entity, and the second action resource is a resource for triggering a second action for a second target resource, the second target resource is a window, and the second action includes an opening operation, that is, an operation of opening a window. For a first action resource, the first action resource is a resource for triggering a first action for a first target resource, if the second target resource is the same as the first target resource, that is, the first target resource is also a window, the first action includes a closing operation, that is, an operation of closing a window, and the first action and the second action conflict with each other, then in order to prevent the first action resource and the second action resource from conflicting, when creating the first action resource, based on the conflict strategy sub-resource of the first action resource, the general service entity can automatically add a dependency sub-resource related to the second action resource to the first action resource, that is, a first dependency sub-resource and / or a second dependency sub-resource related to the second action resource can be established under the first action resource. The first dependency sub-resource may include a first dependency condition, when the attribute value of the conflict state attribute is a first set value, the first dependency condition includes that the attribute value of the second action state attribute is not equal to the first set value, the second dependency sub-resource includes a second dependency condition, and the second dependency condition includes that the attribute value of the second action time attribute is greater than the preset action time.
[0214] For example, in some embodiments, the first action resource is a resource for triggering closing a window (i.e., a first action) for a window (i.e., a first target resource), for example, when the concentration of PM2.5 in the air is detected to be higher than a preset threshold value A, a closing operation is performed on the window. The second action resource is a resource for triggering opening a window (i.e., a second action) for a window (i.e., a second target resource), for example, when the concentration of carbon monoxide in the air is detected to be higher than a preset threshold value B, an opening operation is performed on the window.
[0215] Table 10 below shows various attribute values of the second action resource in an example of this embodiment, and Table 11 below shows various attribute values of the first action resource in an example of this embodiment.
[0216] Table 10: Action2
[0217]
[0218] Table 11: Action1
[0219]
[0220]
[0221] Table 12 shows the conflict strategy sub-resource of the first action resource.
[0222] Table 12
[0223] Property Value 1 conflictObjectResourceID ID of <container2>(Target resource: window switch) Property value 2 conflictInput Close command (string) Property value 3 conflictStatus active
[0224] For example, as shown in Table 12, the conflict strategy sub-resource includes three attribute values, and the three attribute values are respectively a conflict target resource identification attribute (conflictObjectResourceID), a conflict execution method attribute (conflictInput), and a conflict status attribute (conflictStatus).
[0225] As shown in Tables 10-12 above, when the first action resource is created, according to the conflict strategy sub-resource of the first action resource, it can be seen that the first action resource and the second action resource match, so that the general service entity automatically creates a first dependent sub-resource 1 related to the second action resource under the first action resource. Table 13 shows the first dependent sub-resource 1 of the first action resource.
[0226] Table 13
[0227]
[0228] For example, in some other examples, if a third action resource and a fourth action resource are also deployed on the general service entity, and the third target resource of the third action resource is a window, the third action corresponding to the third action resource includes an opening operation, and the fourth target resource of the fourth action resource is a window, and the fourth action corresponding to the fourth action resource includes an opening operation. In other words, the third action resource and the fourth action resource also match the first action resource, so in order to prevent the first action resource from conflicting with any of the third action resource and the fourth action resource, when creating the first action resource, based on the conflict strategy sub-resource of the first action resource, the general service entity can automatically add the dependent sub-resource related to the third action resource and the dependent sub-resource related to the fourth action resource, that is, the third dependent sub-resource and / or the fourth dependent sub-resource related to the third action resource, and the fifth dependent sub-resource and / or the sixth dependent sub-resource related to the fourth action resource can be established under the first action resource. The third dependent sub-resource may include a third dependent condition, the third dependent condition is related to the third action state attribute of the third action resource, when the attribute value of the conflict state attribute is the first set value, the third dependent condition includes that the attribute value of the third action state attribute is not equal to the first set value, the fourth dependent sub-resource includes a fourth dependent condition, the fourth dependent condition is related to the third action time attribute of the third action resource, the fourth dependent condition includes that the attribute value of the third action time attribute is greater than the preset action time. The fifth dependent sub-resource may include a fifth dependent condition, the fifth dependent condition is related to the fourth action state attribute of the fourth action resource, when the attribute value of the conflict state attribute is the first set value, the fifth dependent condition includes that the attribute value of the fourth action state attribute is not equal to the first set value, the sixth dependent sub-resource includes a sixth dependent condition, the sixth dependent condition is related to the fourth action time attribute of the fourth action resource, the sixth dependent condition includes that the attribute value of the fourth action time attribute is greater than the preset action time.
[0229] For detailed descriptions of the third dependent sub-resource and the fifth dependent sub-resource, reference may be made to the above description of the first dependent sub-resource. For detailed descriptions of the fourth dependent sub-resource and the sixth dependent sub-resource, reference may be made to the above description of the second dependent sub-resource.
[0230] When creating the first action resource, according to the conflict strategy sub-resource of the first action resource, it can be known that the first action resource matches the third action resource, so the general service entity automatically creates a third dependent sub-resource related to the third action resource under the first action resource, and the first action resource matches the fourth action resource, so the general service entity automatically creates a fifth dependent sub-resource related to the fourth action resource under the first action resource. Table 14 shows the third dependent sub-resource of the first action resource, and Table 15 shows the fifth dependent sub-resource of the first action resource.
[0231] Table 14
[0232]
[0233] Table 15
[0234]
[0235]
[0236] It can be seen from the above Tables 13-15 that since the relationship between the first dependent sub-resource, the third dependent sub-resource and the fifth dependent sub-resource of the first action resource is necessary (NECESSARY), the first action corresponding to the first action resource can only be triggered when the attribute value of the second action state attribute of the second action resource, the attribute value of the third action state attribute of the third action resource and the attribute value of the fourth action state attribute of the fourth action resource are all the second set value (i.e. invalid).
[0237] It should be noted that in this disclosure, the description of the first action resource is applicable to the second action resource in the absence of conflict. That is to say, for example, the second action resource may also include a state automatic control time attribute; the second creation request may also include conflicting policy resource information, and the second action resource may also include conflicting policy sub-resources, etc.
[0238] Fig. 9 A schematic diagram of a method for executing an action provided by some embodiments of the present disclosure is shown. Fig. 9 As shown, the execution method of the action may include:
[0239] S301: Determine a first action resource, wherein the first action resource is a resource used to trigger a first action for a first target resource, and the first action resource includes a first action state attribute, and the first action state attribute indicates a state of the first action;
[0240] S302: triggering a first action for a first target resource;
[0241] S303: After triggering the first action, setting the attribute value of the first action state attribute to a first set value.
[0242] By utilizing the action execution method provided by the present disclosure, by adding action state attributes to action resources, the conflict problem of action resources can be solved based on dependency conditions related to the action state attributes, thereby improving the execution efficiency of the action.
[0243] For example, in some embodiments, step S302 may include: receiving a first data resource; and triggering a first action for a first target resource based on the first data resource satisfying a first trigger condition.
[0244] It should be noted that in the present disclosure, "triggering the first action" may include executing the first action; but not limited to this, "triggering the first action" may also include monitoring the first data resource used for the first action resource, determining that the first data resource meets the matching condition in the first action resource (i.e., the condition represented by the evaluation rule attribute (evalCriteria) in the action resource), and executing the first action for the first target resource, that is, "triggering the first action" may represent the complete process from monitoring the first data resource to finally executing the first action. The meaning of "triggering the second action" is similar to that of "triggering the first action". In addition, the first trigger condition may indicate that the data in the monitored first data resource meets the matching condition in the first action resource.
[0245] For example, in some embodiments, sensor data can be received through various sensors to determine the first data resource (also referred to as the first subject resource, i.e., the subjectResource attribute of the action resource). For example, the first data resource can be carbon monoxide concentration, PM2.5 concentration, temperature, etc. For example, in the use environment of a smart home, sensor data can be received through sensors such as carbon monoxide sensors, rain sensors, air quality monitoring sensors, etc., and the first data resource can be updated using the received sensor data. The first action corresponding to the first action resource indicates: when the concentration of PM2.5 in the air is detected to be higher than a preset threshold value A (e.g., 100), a closing operation is performed on the window. At this time, the first data resource is the PM2.5 concentration detected by the air quality monitoring sensor. When the PM2.5 concentration is higher than 100, a closing operation can be performed on the window.
[0246] For example, an application entity (e.g., a sensor) may transmit data to a general service entity to update the first data resource. This update may be real-time or periodic, or may be triggered by a certain condition; for example, when the data detected by the application entity reaches a certain threshold, the data exceeding the threshold may be transmitted to the general service entity for updating, or when another application entity requests to obtain the first data resource, the update may be performed.
[0247] For example, in some embodiments, the first action resource further includes a first action time attribute, which is used to indicate a time parameter related to the first action. The time parameter related to the first action may include at least one of a duration after triggering the first action, a start time of executing the first action, and an end time of executing the first action.
[0248] For example, the execution method further includes: after triggering the first action, setting the attribute value of the first action time attribute. For example, setting the attribute value of the first action time attribute includes: after triggering the first action, establishing an action execution timer to start timing, and using the time value of the action execution timer as the attribute value of the first action time attribute. For example, the action execution timer starts timing from 0 each time.
[0249] For example, in some embodiments, the first action resource further includes a first state automatic control time attribute.
[0250] For example, in some examples, the first state automatic control time may represent: based on the attribute value of the first action state attribute being the first set value, and the attribute value of the first action time attribute being greater than or equal to the attribute value of the first state automatic control time attribute, the attribute value of the first action state attribute is changed from the first set value to the second set value. For example, after triggering the first action, the execution method further includes: obtaining the attribute value of the first action time attribute; determining whether the attribute value of the first action time attribute is greater than or equal to the attribute value of the first state automatic control time attribute, and when the attribute value of the first action time attribute is greater than or equal to the attribute value of the first state automatic control time attribute, changing the attribute value of the first action state attribute from the first set value to the second set value.
[0251] For example, in some other examples, the first state automatic control time may also represent: based on the attribute value of the first action state attribute being the first set value, and the attribute value of the first state automatic control time attribute being equal to 0, the attribute value of the first action state attribute is changed from the first set value to the second set value. For example, after triggering the first action, the execution method further includes: starting a countdown based on the attribute value of the first state automatic control time attribute; obtaining the attribute value of the first state automatic control time attribute; determining whether the attribute value of the first state automatic control time attribute is equal to 0, and when the attribute value of the first state automatic control time attribute is equal to 0, changing the attribute value of the first action state attribute from the first set value to the second set value.
[0252] For example, the first setting value and the second setting value are opposite to each other. In some examples, the first setting value may be valid, and correspondingly, the second setting value may be invalid.
[0253] For example, in some examples, the first action resource also includes a first dependent sub-resource, and the first dependent sub-resource includes a first dependent condition. Step S302 may include: receiving a first data resource; obtaining a second action state attribute of a second action resource, wherein the second action resource is a resource for triggering a second action for a second target resource, and the second action resource includes a second action state attribute, and the second action state attribute indicates the state of the second action; based on the first data resource satisfying the first trigger condition and the attribute value of the second action state attribute satisfying the first dependent condition, triggering the first action for the first target resource. In other words, when the first action resource includes a first dependent sub-resource, it is necessary to trigger the first action for the first target resource when the first data resource satisfies the first trigger condition and the attribute value of the second action state attribute satisfies the first dependent condition.
[0254] For example, in some other examples, the first action resource also includes a second dependent sub-resource, and the second dependent sub-resource includes a second dependent condition. Step S302 may include: receiving the first data resource; obtaining the second action time attribute of the second action resource, wherein the second action resource is a resource used to trigger a second action for a second target resource, and the second action resource includes a second action time attribute, and the second action time attribute is used to indicate a time parameter related to the second action; based on the first data resource satisfying the first trigger condition and the attribute value of the second action time attribute satisfying the second dependent condition, triggering the first action for the first target resource. In other words, when the first action resource includes the first dependent sub-resource, it is necessary to trigger the first action for the first target resource when the first data resource satisfies the first trigger condition and the attribute value of the second action time attribute satisfies the second dependent condition.
[0255] For example, in some other examples, the first action resource also includes a first dependent sub-resource and a second dependent sub-resource, the first dependent sub-resource includes a first dependent condition, and the second dependent sub-resource includes a second dependent condition, and step S302 may include: receiving a first data resource; obtaining a second action state attribute and a second action time attribute of a second action resource, wherein the second action resource is a resource for triggering a second action for a second target resource, the second action resource includes a second action state attribute and a second action time attribute, the second action state attribute indicates the state of the second action, and the second action time attribute is used to indicate a time parameter related to the second action; based on the first data resource satisfying the first trigger condition and the attribute value of the second action state attribute satisfies the first dependent condition and / or the attribute value of the second action time attribute satisfies the second dependent condition, the first action is triggered for the first target resource. That is, when the first action resource includes a first dependent sub-resource and a second dependent sub-resource, the first action can be triggered for the first target resource when the first data resource satisfies the first trigger condition, and the attribute value of the second action state attribute satisfies the first dependent condition and the attribute value of the second action time attribute satisfies any one of the second dependent conditions.
[0256] For example, the first dependent condition includes that the attribute value of the second action state attribute is not equal to the first set value, and the first set value is valid or invalid. The second dependent condition includes that the attribute value of the second action time attribute is greater than the preset action time.
[0257] For example, the first target resource and the second target resource are the same target resource.
[0258] For example, the first action and the second action are not the same, for example, the first action and the second action conflict with each other.
[0259] For example, the execution method may also include: after triggering the first action, setting the attribute value of the second action state attribute to a second set value, wherein the first set value and the second set value are opposite to each other; determining the second action resource; receiving the second data resource; triggering the second action for the second target resource based on the second data resource satisfying the second trigger condition, and after triggering the second action, changing the attribute value of the second action state attribute from the second set value to the first set value, and changing the attribute value of the first action state attribute from the first set value to the second set value. In this embodiment, the first action and the second action are opposite to each other, for example, the first action is an opening operation, and the second action is a closing operation. It should be noted that in the present disclosure, "triggering the second action" may include executing the second action.
[0260] For example, in one embodiment, the first action resource also includes a first opposite action attribute and a first state control attribute, the second action resource also includes a second opposite action attribute and a second state control attribute, the first opposite action attribute represents an identification code of the second action resource, and the second opposite action attribute represents an identification code of the first action resource.
[0261] For example, in some examples, before executing the operation of setting the attribute value of the second action state attribute to the second set value, the execution method further includes: determining whether the attribute value of the first state control attribute is true, and in the case where it is determined that the attribute value of the first state control attribute is true, executing the operation of setting the attribute value of the second action state attribute to the second set value, and in the case where it is determined that the attribute value of the first state control attribute is not true, not executing the operation of setting the attribute value of the second action state attribute to the second set value. That is, after triggering the first action, it is first necessary to determine whether the attribute value of the first state control attribute is true, and in the case where it is determined that the attribute value of the first state control attribute is true, then the attribute value of the second action state attribute is set to the second set value, and in the case where it is determined that the attribute value of the first state control attribute is not true, no operation is performed on the attribute value of the second action state attribute.
[0262] For example, in some other examples, before executing the operation of setting the attribute value of the second action state attribute to the second set value, the execution method further includes: judging whether the attribute value of the second state control attribute is true, and in the case where it is determined that the attribute value of the second state control attribute is true, executing the operation of setting the attribute value of the second action state attribute to the second set value, and in the case where it is determined that the attribute value of the second state control attribute is not true, not executing the operation of setting the attribute value of the second action state attribute to the second set value. That is to say, after triggering the first action, it is first necessary to judge whether the attribute value of the second state control attribute is true, and in the case where it is determined that the attribute value of the second state control attribute is true, then the attribute value of the second action state attribute is set to the second set value, and in the case where it is determined that the attribute value of the second state control attribute is not true, no operation is performed on the attribute value of the second action state attribute.
[0263] For example, in some examples, before executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, the execution method further includes: judging whether the attribute value of the second state control attribute is true, and in the case where it is determined that the attribute value of the second state control attribute is true, executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, and in the case where it is determined that the attribute value of the second state control attribute is not true, not executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value. That is, after triggering the second action, it is first necessary to judge whether the attribute value of the second state control attribute is true, and in the case where it is determined that the attribute value of the second state control attribute is true, the attribute value of the first action state attribute is changed from the first set value to the second set value, and in the case where it is determined that the attribute value of the second state control attribute is not true, the attribute value of the first action state attribute is not operated.
[0264] For example, in some other examples, before executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, the execution method further includes: judging whether the attribute value of the first state control attribute is true, and in the case where it is determined that the attribute value of the first state control attribute is true, executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, and in the case where it is determined that the attribute value of the first state control attribute is not true, not executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value. That is to say, after triggering the second action, it is first necessary to judge whether the attribute value of the first state control attribute is true, and in the case where it is determined that the attribute value of the first state control attribute is true, the attribute value of the first action state attribute is changed from the first set value to the second set value, and in the case where it is determined that the attribute value of the first state control attribute is not true, no operation is performed on the attribute value of the first action state attribute.
[0265] For example, in the present disclosure, only when the attribute value of the first state control attribute is true, can the attribute value of the second action state attribute (or the first action state attribute) be operated after the first action is performed, and only when the attribute value of the second state control attribute is true, can the attribute value of the first action state attribute (or the second action state attribute) be operated after the second action is performed. That is, after the first action is performed, it is necessary to determine whether the attribute value of the first state control attribute is true, if it is true, it is necessary to change the attribute value of the second action state attribute to the second set value (at this time, the attribute value of the first action state attribute is the first set value), if it is not true (i.e. false), it is not necessary to perform the operation of changing the attribute value of the second action state attribute; after the second action is performed, it is necessary to determine whether the attribute value of the second state control attribute is true, if it is true, it is necessary to change the attribute value of the first action state attribute to the second set value (at this time, the attribute value of the second action state attribute is the first set value), if it is not true (i.e. false), it is not necessary to perform the operation of changing the attribute value of the first action state attribute.
[0266] For example, sensor data may be received through various sensors to determine a second data resource (also referred to as a second subject resource). For example, the second data resource may also be carbon monoxide concentration, PM2.5 concentration, temperature, etc. It should be noted that the second trigger condition may indicate that the data in the monitored second data resource meets the matching condition in the second action resource. In the present disclosure, the description of the first data resource, in the absence of conflict, is applicable to the second data resource.
[0267] For example, the first data resource and the second data resource are different. In some examples, the first data resource may be PM2.5 concentration, while the second data resource may be carbon monoxide concentration.
[0268] For example, the application entity (eg, a sensor) may transmit data to the general service entity to update the second data resource.
[0269] It should be noted that there is no time sequence for triggering the first action and triggering the second action. For example, when the first data resource meets the first trigger condition and the attribute value of the second action state attribute meets the first dependency condition and / or the attribute value of the second action time attribute meets the second dependency condition, the first action can be triggered; when the second data resource meets the second trigger condition, the second action can be triggered. It should be noted that when the second action resource includes a corresponding dependency condition, the second action can be triggered when the second data resource meets the second trigger condition and the corresponding dependency condition of the second action resource is met. For example, in some examples, the second action can be triggered first, and then the first action; in other examples, the first action can be triggered first, and then the second action.
[0270] For example, the second action resource further includes a second action time attribute, and the second action time attribute is used to indicate a time parameter related to the second action. The execution method further includes: after triggering the second action, setting an attribute value of the second action time attribute. The method of setting the attribute value of the second action time attribute can be the same as the method of setting the attribute value of the first action time attribute, and the repeated parts are not repeated.
[0271] It should be noted that each time the first action is triggered, the attribute value of the first action time attribute can be reset, that is, the attribute value of the first action time attribute can be cleared to zero; similarly, each time the second action is triggered, the attribute value of the second action time attribute can also be reset, that is, the attribute value of the second action time attribute can be cleared to zero.
[0272] In addition, in the embodiment of the action execution method, the detailed description of the first action resource and the second action resource can refer to the relevant description in the embodiment of the action resource creation method, and the repeated parts will not be repeated here.
[0273] Fig.10 A schematic diagram of a process of creating and executing an action resource provided by some embodiments of the present disclosure is shown. Fig.10 The examples shown take the action resources shown in Tables 1-4 above as an example.
[0274] For example, Fig.10 As shown, first, the air monitoring device / application and the gas monitoring device / application respectively send registration requests to the universal service entity to realize registration. When the registration is completed, the universal service entity can return a successful registration response to the air monitoring device / application and the gas monitoring device / application.
[0275] Then, the air monitoring device / application sends a first creation request to the general service entity. After the general service entity passes the identity verification of the air monitoring device / application, according to the first creation request, the general service entity can create a first action resource (action1) for the air monitoring device / application. When the first action resource is successfully created, the general service entity can return a successful creation response to the air monitoring device / application. At this time, the attribute value of the first action state attribute of the first action resource is the second set value (i.e., inactive), and the attribute value of the first action time attribute of the first action resource can be empty. For example, the first action resource is a resource used to trigger a first action for a first target resource.
[0276] The gas monitoring device / application sends a second creation request to the general service entity. After the general service entity passes the identity verification of the gas monitoring device / application, according to the second creation request, the general service entity can create a second action resource (action2) for the gas monitoring device / application. When the second action resource is successfully created, the general service entity can return a successful creation response to the gas monitoring device / application. At this time, the attribute value of the second action state attribute of the second action resource is the second set value (i.e., inactive), and the attribute value of the second action time attribute of the second action resource can be empty. For example, the second action resource is a resource used to trigger a second action for a second target resource, and the second target resource is the same as the first target resource.
[0277] Next, for the second action resource, when the second data resource meets the second trigger condition, then, it is determined whether the dependency condition of the second action resource is met. Since the second action resource does not include the dependency condition, when the second data resource meets the second trigger condition, the second action can be executed, that is, the operation of opening the window (that is, the second target resource) is triggered (that is, the second action includes the opening operation). After executing the second action, the attribute value of the second action state attribute is set to the first set value (that is, active), and at the same time, the attribute value of the second action time attribute is set to start timing to record the duration after executing the second action.
[0278] For the first action resource, the first action resource includes two dependent sub-resources, one dependent sub-resource depends on the attribute value of the second action state attribute of the second action resource being the second set value, and the other dependent sub-resource depends on the time after the second action is executed (i.e., the attribute value of the second action time attribute) being greater than the preset action time. When the first data resource meets the first trigger condition, it is determined whether the dependency condition of the first action resource is met. When the attribute value of the second action state attribute of the second action resource is the second set value, it is determined that the trigger execution is successful, so that the first action is executed; when the attribute value of the second action state attribute of the second action resource is the first set value, it can be determined whether the attribute value of the second action time attribute is greater than the preset action time. When the attribute value of the second action time attribute is greater than the preset action time, it is determined that the trigger execution is successful, so that the first action is executed; when the attribute value of the second action state attribute of the second action resource is the first set value, and the attribute value of the second action time attribute is less than or equal to the preset action time, it is determined that the trigger execution fails, so that the first action is not executed. For example, after executing the first action, the attribute value of the first action state attribute is set to the first set value (ie, active), and at the same time, the attribute value of the first action time attribute is set to start timing to record the duration after executing the first action.
[0279] In the action resource creation method and action execution method provided by the present disclosure, by adding action state attributes to the action resources, the conflict problem of action resources can be solved based on the dependency conditions related to the action state attributes.
[0280] Fig.11 A schematic diagram showing an illustrative example of triggering operations on target resources provided by some embodiments of the present disclosure. Fig.11 The examples shown take the implementation examples of the action resources shown in Tables 1-4 above as an example.
[0281] For example, Fig.11 As shown, the PM 2.5 sensor AE1 (eg, an air monitoring device), the carbon monoxide sensor AE2 (eg, a gas monitoring device), and the window controller AE3 are respectively registered with the home management server CSE (ie, common service entity).
[0282] During the process of creating action resources, the carbon monoxide sensor AE2 can send a second creation request to the home management server CSE. The second creation request is used to request the home management server CSE to create a second action resource. The second creation request includes an action trigger subject (carbon monoxide sensor AE2), a second target resource (window), a second trigger condition (carbon monoxide concentration is greater than a preset threshold B) and a control action (opening the window).
[0283] According to the second creation request sent by the carbon monoxide sensor AE2, the home management server CSE can create a second action resource. In some embodiments, before creating the second action resource, it can be determined whether there are other action resources for the same second target resource in the home management server CSE. In the absence of other action resources for the same second target resource, the second action resource can be created according to the creation request sent by the home management application AE1.
[0284] The PM 2.5 sensor AE1 can send a first creation request to the home management server CSE, and the first creation request is used to request the home management server CSE to create a first action resource. The first creation request includes an action trigger subject (PM 2.5 sensor AE1), a first target resource (window), a first trigger condition (PM 2.5 concentration is greater than a preset threshold A), a dependent condition (the attribute value of the second action state attribute is a second preset value or the attribute value of the second action time attribute is greater than the preset action time) and a control action (closing the window).
[0285] According to the first creation request sent by the PM 2.5 sensor AE1, the home management server CSE can create the first action resource. It should be noted that after the second action resource has been created, the PM 2.5 sensor AE1 sends the first creation request to the home management server CSE to request the creation of the first action resource. If the first creation request does not include a dependency condition, the home management server CSE judges and determines that the first action resource to be created may conflict with the existing second action resource, then the home management server CSE may refuse to create the first action resource, that is, the creation of the first action resource fails.
[0286] For example, after creating the first action resource, the home management service CSE can return a response of successful action resource creation to the PM 2.5 sensor AE1, indicating that the first action resource was successfully created; after creating the second action resource, the home management service CSE can return a response of successful action resource creation to the carbon monoxide sensor AE2, indicating that the second action resource was successfully created.
[0287] During operation, the home management server CSE may receive an update request from the carbon monoxide sensor AE2 to update the corresponding second data resource (i.e., the second subject resource). The update request may include data of the carbon monoxide content currently detected by the carbon monoxide sensor AE2. The home management server CSE may send a corresponding update response to the carbon monoxide sensor AE2 after receiving the update request sent by the carbon monoxide sensor AE2.
[0288] Then, the home management server CSE can determine whether the data received from the carbon monoxide sensor AE2 meets the trigger condition of the second action resource (i.e., the second trigger condition). If the second data resource meets the trigger condition of the second action resource, the home management server CSE can send an action request to the window controller AE3 and notify the window controller AE3 to perform the operation of opening the window. After the opening operation is performed, the window controller AE3 can send an action response to the home management server CSE.
[0289] The home management server CSE may also receive an update request from the PM 2.5 sensor AE1 to update the corresponding first data resource (i.e., the first subject resource). For example, the update request includes the PM 2.5 concentration data currently detected by the PM 2.5 sensor AE1. In some embodiments, such an update request may be sent regularly at a preset frequency, or may be sent in response to changes in the detection data. For example, an update request may be sent to the home management server CSE when it is determined that the detection data is higher than a preset threshold value A. The home management server CSE may send a corresponding update response to the PM 2.5 sensor AE1 after receiving the update request sent by the PM 2.5 sensor AE1.
[0290] Then, the home management server CSE can determine whether the trigger condition of the first action resource (i.e., the first trigger condition) is met based on the PM 2.5 concentration data in the updated first data resource, and determine whether the dependency condition of the first action resource (including the first dependency condition and / or the second dependency condition described in the above embodiment) is met based on the second action state attribute and the second action time attribute. If the trigger condition and the dependency condition of the first action resource are met, an action request can be sent to the window controller AE3. The window controller AE3 can perform an operation to close the window according to the received operation request. After the closing operation is executed, the window controller AE3 can send an action response to the server CSE.
[0291] It should be noted that, in the present disclosure, the update request may include requesting the home management server CSE to update or set any attribute value in the first action resource or the second action resource, for example, the attribute value of the first action state attribute, the attribute value of the first action time attribute, the attribute value of the first opposite action attribute, the attribute value of the first state control attribute, etc. in the first action resource may be updated or set. The present disclosure does not limit this.
[0292] Some embodiments of the present disclosure also provide an electronic device. Fig.12 A schematic diagram of an electronic device provided for some embodiments of the present disclosure.
[0293] For example, Fig.12 As shown, the electronic device 500 may include: a memory 510 and a processor 520. It should be noted that Fig.12 The components of the electronic device 500 shown are merely exemplary and non-limiting. The electronic device 500 may also have other components according to actual application requirements.
[0294] For example, the memory 510 is used to non-temporarily store computer-readable instructions; the processor 520 is used to execute the computer-readable instructions, and when the computer-readable instructions are executed by the processor 520, the method for creating an action resource according to any of the above embodiments is executed.
[0295] For example, components such as the memory 510 and the processor 520 can communicate with each other through a network connection. The network may include a wireless network, a wired network, and / or any combination of a wireless network and a wired network. The network may include a local area network, the Internet, a telecommunications network, an Internet of Things based on the Internet and / or a telecommunications network, and / or any combination of the above networks. For example, a wired network may communicate using twisted pair, coaxial cable, or optical fiber transmission, and a wireless network may use, for example, 3G / 4G / 5G mobile communication networks, Bluetooth, Zigbee, or WiFi. The present disclosure does not limit the type and function of the network.
[0296] For example, the processor 520 can control other components in the electronic device 500 to perform desired functions. The processor 520 can be a device with data processing capabilities and / or program execution capabilities, such as a central processing unit (CPU), a microprocessor, etc. The central processing unit (CPU) can be an X86 or ARM architecture, etc.
[0297] For example, the memory 510 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer-readable instructions may be stored on the computer-readable storage medium, and the processor 510 may execute the computer-readable instructions to implement various functions of the electronic device 500. Various applications and various data may also be stored in the storage medium.
[0298] For example, for a detailed description of the process of the electronic device 500 executing the creation of action resources, reference may be made to the relevant description in the embodiment of the method for creating action resources, and the repeated parts will not be repeated.
[0299] Some embodiments of the present disclosure also provide an electronic device. For example, the electronic device may include: a memory and a processor. The memory is used to non-temporarily store computer-readable instructions; the processor is used to run computer-readable instructions, and when the computer-readable instructions are run by the processor, the processor executes the execution method of the action described in any of the above embodiments. It should be noted that the detailed description of the memory and the processor can refer to the above-mentioned related description, which will not be repeated here. The detailed description of the process of the electronic device executing an action can refer to the relevant description in the embodiment of the above-mentioned method for executing the action, and the repeated parts will not be repeated.
[0300] Some embodiments of the present disclosure also provide a computer-readable storage medium. Fig.13 A schematic diagram of a computer-readable storage medium provided for some embodiments of the present disclosure. Fig.13 As shown, one or more computer-readable instructions 901 may be non-temporarily stored on the computer-readable storage medium 900. For example, when the computer-readable instructions 901 are executed by a computer, the computer may execute one or more steps in the method for creating an action resource or the method for executing an action according to any of the above embodiments.
[0301] For example, the computer-readable storage medium 900 may be applied to the electronic device described in any of the above embodiments. For example, it may be a memory in the electronic device.
[0302] For example, the description of the computer-readable storage medium 900 may refer to the description of the memory in the embodiment of the electronic device described in any of the above embodiments, and the repeated parts will not be repeated.
[0303] There are a few points to note about this disclosure:
[0304] (1) The drawings of the embodiments of the present disclosure only relate to the structures related to the embodiments of the present disclosure, and other structures may refer to the general design.
[0305] (2) For the sake of clarity, the thickness and size of layers or structures are exaggerated in the drawings used to describe embodiments of the present invention. It is understood that when an element such as a layer, film, region, or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element, or there may be intervening elements.
[0306] (3) In the absence of conflict, the embodiments of the present disclosure and the features therein may be combined with each other to obtain new embodiments.
[0307] The above description is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. The protection scope of the present disclosure shall be based on the protection scope of the claims.< / dependency> < / dependency> < / action> < / action>
Claims
1. A method for creating an action resource, comprising: Receiving a first creation request, wherein the first creation request includes a first target resource; creating a first action resource according to the first creation request, wherein the first action resource is a resource used to trigger a first action for the first target resource, The step of creating the first action resource includes: creating a first action state attribute for the first action resource, wherein the first action state attribute represents a state of the first action; The creation method also includes: receiving a second creation request, wherein the second creation request includes a second target resource; creating a second action resource according to the second creation request, wherein the second action resource is a resource used to trigger a second action for the second target resource, and triggering the second action for the second target resource when a second trigger condition is met, The step of creating the second action resource includes: A second action state attribute is created for the second action resource, wherein the second action state attribute indicates a state of the second action.
2. The creation method according to claim 1, wherein: Creating the first action resource further includes: creating a first action time attribute for the first action resource, The first action time attribute is used to indicate a time parameter related to the first action.
3. The creation method according to claim 1, wherein: Creating the second action resource further includes: creating a second action time attribute for the second action resource, The second action time attribute is used to indicate a time parameter related to the second action.
4. The creation method according to claim 1, wherein: The first target resource and the second target resource are the same target resource, and the first action and the second action conflict with each other.
5. The creation method according to claim 3, wherein: The first creation request also includes dependent resource information, and creating the first action resource also includes: creating a first dependent sub-resource for the first action resource according to the dependent resource information, wherein the first dependent sub-resource includes a first dependent condition, the first dependent condition is related to the second action state attribute, and when the first trigger condition and the first dependent condition are satisfied at the same time, triggering the first action for the first target resource; or creating a second dependent sub-resource for the first action resource according to the dependent resource information, wherein the second dependent sub-resource includes a second dependent condition, the second dependent condition is related to the second action time attribute, and the first action is triggered for the first target resource when the first trigger condition and the second dependent condition are satisfied at the same time; or According to the dependent resource information, a first dependent sub-resource and a second dependent sub-resource are created for the first action resource, wherein the first dependent sub-resource includes a first dependent condition, the second dependent sub-resource includes a second dependent condition, the first dependent condition is related to the second action state attribute, and the second dependent condition is related to the second action time attribute, and the first action is triggered for the first target resource when at least one of the first dependent condition and the second dependent condition and a first trigger condition are satisfied simultaneously.
6. The creation method according to claim 5, wherein: Creating the first action resource further includes: creating a first opposite action attribute and a first state control attribute for the first action resource, Creating the second action resource further includes: creating a second opposite action attribute and a second state control attribute for the second action resource, Among them, the first opposite action attribute represents the identification code of the second action resource, and the second opposite action attribute represents the identification code of the first action resource, the first state control attribute represents whether to change the attribute value of the first action state attribute or the attribute value of the second action state attribute, and the second state control attribute represents whether to change the attribute value of the second action state attribute or the attribute value of the first action state attribute.
7. The creation method according to claim 5 or 6, wherein: The first dependency condition includes that the attribute value of the second action state attribute and the first setting value satisfy a first preset logical relationship, and the first setting value is valid or invalid. The second dependency condition includes that the attribute value of the second action time attribute and the preset action time satisfy a second preset logical relationship.
8. The creation method according to claim 3, wherein: The first creation request also includes conflicting policy resource information, Creating the first action resource further includes: Based on the conflict policy resource information, a conflict policy sub-resource for the first action resource is created.
9. The creation method according to claim 8, wherein: Creating the first action resource further includes: Based on the second target resource, the second action, and the conflict strategy sub-resource satisfying a matching condition, creating a first dependency sub-resource for the first action resource, wherein the first dependency sub-resource includes a first dependency condition, the first dependency condition is related to the second action state attribute, and when the first dependency condition and the first trigger condition are simultaneously satisfied, triggering the first action for the first target resource; or Creating the first action resource further includes: Based on the second target resource, the second action, and the conflict strategy sub-resource satisfying a matching condition, creating a second dependent sub-resource for the first action resource, wherein the second dependent sub-resource includes a second dependent condition, the second dependent condition is related to the second action time attribute, and when the second dependent condition and the first trigger condition are simultaneously satisfied, triggering the first action for the first target resource; or Creating the first action resource further includes: Based on the second target resource, the second action and the conflict strategy sub-resource satisfying the matching conditions, a first dependent sub-resource and a second dependent sub-resource are created for the first action resource, wherein the first dependent sub-resource includes a first dependency condition, which is related to the second action state attribute, and the second dependent sub-resource includes a second dependency condition, which is related to the second action time attribute, and when at least one of the first dependency condition and the second dependency condition and a first trigger condition are simultaneously satisfied, the first action is triggered for the first target resource.
10. The creation method according to claim 9, wherein: Creating a conflict strategy sub-resource for the first action resource includes: creating a conflict target resource identification attribute and a conflict execution method attribute for the first action resource, The conflicting target resource identification attribute represents the identification code of the first target resource, and the conflicting execution method attribute represents the action that conflicts with the first action. Satisfying the matching condition includes: the identification code of the second target resource is the same as the identification attribute of the conflicting target resource, and the second action is the same as the action represented by the conflicting execution method attribute.
11. The creation method according to claim 10, wherein: Creating a conflict strategy sub-resource for the first action resource further includes: creating a conflict status attribute for the first action resource, The attribute value of the conflict state attribute includes a first set value or a second set value.
12. The creation method according to claim 11, wherein: The attribute value of the conflict state attribute is the first set value, the first dependent condition includes that the attribute value of the second action state attribute and the first set value satisfy a first preset logical relationship, and the first set value is valid or invalid, The second dependency condition includes that the attribute value of the second action time attribute and the preset action time satisfy a second preset logical relationship.
13. The creation method according to claim 2, wherein: Creating the first action resource further includes: creating a first state automatic control time attribute for the first action resource, The attribute value of the first action state attribute includes a first set value and a second set value, and the first set value and the second set value are opposite to each other. Based on the attribute value of the first action state attribute being the first set value and the attribute value of the first action time attribute being greater than or equal to the attribute value of the first state automatic control time attribute, the attribute value of the first action state attribute is changed from the first set value to the second set value.
14. The creation method according to claim 1, wherein: Creating the first action resource further includes: creating a first state automatic control time attribute for the first action resource, The attribute value of the first action state attribute includes a first set value and a second set value, and the first set value and the second set value are opposite to each other. Based on the attribute value of the first action state attribute being the first set value and the attribute value of the first state automatic control time attribute being equal to 0, the attribute value of the first action state attribute is changed from the first set value to the second set value.
15. A method for executing an action, comprising: Determine a first action resource, wherein the first action resource is a resource used to trigger a first action for a first target resource, and the first action resource includes a first action state attribute, and the first action state attribute indicates a state of the first action; triggering the first action for the first target resource; After triggering the first action, setting the attribute value of the first action state attribute to a first set value; The execution method further includes: Determine a second action resource, wherein the second action resource is a resource used to trigger a second action for a second target resource, and when a second trigger condition is met, the second action is triggered for the second target resource, and the second action resource includes a second action state attribute, and the second action state attribute indicates a state of the second action.
16. The execution method according to claim 15, wherein: Triggering the first action for the first target resource includes: receiving a first data resource; Based on the first data resource satisfying a first trigger condition, the first action is triggered for the first target resource.
17. The execution method according to claim 15, wherein: The first action resource further includes a first action time attribute, where the first action time attribute is used to indicate a time parameter related to the first action. The execution method further includes: After the first action is triggered, the attribute value of the first action time attribute is set.
18. The execution method according to claim 17, wherein: The first action resource further includes a first state automatic control time attribute, and the execution method further includes: Obtaining an attribute value of the first action time attribute; determining whether the attribute value of the first action time attribute is greater than or equal to the attribute value of the first state automatic control time attribute, and when the attribute value of the first action time attribute is greater than or equal to the attribute value of the first state automatic control time attribute, changing the attribute value of the first action state attribute from the first set value to a second set value, The first setting value and the second setting value are opposite to each other.
19. The execution method according to claim 17, wherein: The first action resource further includes a first dependent sub-resource, the first dependent sub-resource includes a first dependent condition, and triggering the first action for the first target resource includes: receiving a first data resource; Obtaining the second action state attribute of the second action resource; triggering the first action for the first target resource based on that the first data resource satisfies the first trigger condition and the attribute value of the second action state attribute satisfies the first dependency condition; or The first action resource further includes a second dependent sub-resource, the second dependent sub-resource includes a second dependent condition, and triggering the first action for the first target resource includes: receiving a first data resource; Acquire a second action time attribute of the second action resource, wherein the second action resource includes the second action time attribute, and the second action time attribute is used to indicate a time parameter related to the second action; Based on the first data resource satisfying the first trigger condition and the attribute value of the second action time attribute satisfying the second dependency condition, the first action is triggered for the first target resource.
20. The execution method according to claim 17, wherein: The first action resource further includes a first dependent sub-resource and a second dependent sub-resource, the first dependent sub-resource includes a first dependent condition, the second dependent sub-resource includes a second dependent condition, and triggering the first action for the first target resource includes: receiving a first data resource; Acquire the second action state attribute and the second action time attribute of the second action resource, wherein the second action resource further includes the second action time attribute, and the second action time attribute is used to indicate a time parameter related to the second action; The first action is triggered for the first target resource based on the fact that the first data resource satisfies the first trigger condition and the attribute value of the second action state attribute satisfies the first dependency condition and / or the attribute value of the second action time attribute satisfies the second dependency condition.
21. The execution method according to claim 19 or 20, wherein: The first dependency condition includes that the attribute value of the second action state attribute and the first setting value satisfy a first preset logical relationship, and the first setting value is valid or invalid. The second dependency condition includes that the attribute value of the second action time attribute and the preset action time satisfy a second preset logical relationship.
22. The execution method according to claim 19 or 20, wherein: The first target resource and the second target resource are the same target resource, and the first action and the second action conflict with each other.
23. The execution method according to claim 19 or 20, further comprising: After triggering the first action, setting the attribute value of the second action state attribute to a second set value, wherein the first set value and the second set value are opposite to each other; determining the second action resource; receiving a second data resource; Based on the second data resource satisfying the second trigger condition, the second action is triggered for the second target resource, and after triggering the second action, the attribute value of the second action state attribute is changed from the second set value to the first set value, and the attribute value of the first action state attribute is changed from the first set value to the second set value.
24. The execution method according to claim 23, wherein: The first action resource further includes a first opposite action attribute and a first state control attribute, the second action resource further includes a second opposite action attribute and a second state control attribute, the first opposite action attribute represents an identification code of the second action resource, and the second opposite action attribute represents an identification code of the first action resource, Before executing the operation of setting the attribute value of the second action state attribute to the second set value, the execution method further includes: judging whether the attribute value of the first state control attribute is true, and if it is determined that the attribute value of the first state control attribute is true, executing the operation of setting the attribute value of the second action state attribute to the second set value, and if it is determined that the attribute value of the first state control attribute is not true, not executing the operation of setting the attribute value of the second action state attribute to the second set value, Before executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, the execution method further includes: judging whether the attribute value of the second state control attribute is true, and if it is determined that the attribute value of the second state control attribute is true, executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, and if it is determined that the attribute value of the second state control attribute is not true, not executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value; or Before executing the operation of setting the attribute value of the second action state attribute to the second set value, the execution method further includes: judging whether the attribute value of the second state control attribute is true, and if it is determined that the attribute value of the second state control attribute is true, executing the operation of setting the attribute value of the second action state attribute to the second set value, and if it is determined that the attribute value of the second state control attribute is not true, not executing the operation of setting the attribute value of the second action state attribute to the second set value, Before executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value, the execution method also includes: judging whether the attribute value of the first state control attribute is true, and when it is determined that the attribute value of the first state control attribute is true, executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value; and when it is determined that the attribute value of the first state control attribute is not true, not executing the operation of changing the attribute value of the first action state attribute from the first set value to the second set value.
25. The execution method according to claim 23, further comprising: After the second action is triggered, the attribute value of the second action time attribute is set.
26. The execution method according to claim 17, wherein: Setting the attribute value of the first action time attribute includes: After the first action is triggered, an action execution timer is established to start timing, and the time value of the action execution timer is used as the attribute value of the first action time attribute.
27. An electronic device comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, Wherein, when the computer-readable instructions are executed by the processor, the creation method according to any one of claims 1-14 is executed.
28. An electronic device comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, When the computer-readable instructions are executed by the processor, the processor executes the execution method according to any one of claims 15-26.
29. A computer-readable storage medium non-transitorily storing computer-readable instructions, wherein: When the computer-readable instructions are executed by a computer, the computer is enabled to execute the creation method according to any one of claims 1 to 14 or the execution method according to any one of claims 15 to 26.
Citation Information
Patent Citations
Method and system for realizing multi-task management input and output resources
CN102566996A
Method for creating resource, corresponding registration method, server apparatus, and client apparatus
CN109309654A