Iot system and method of performing rules thereof, related devices

By generating a rule tree in the IoT system and updating the node status in real time, the problem of the lack of visualization in the rule engine is solved, enabling an intuitive display of rule execution and rapid problem localization, thus improving the user experience.

CN114298309BActive Publication Date: 2026-01-27BOE TECHNOLOGY GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111592326.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2026-01-27
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

The rule engines in existing IoT systems lack visualization of rule execution, making it difficult for users to view the overall execution status of rules and to quickly locate problems when rule execution is abnormal or fails.

Method used

By generating a rule tree, the execution status of rules is displayed, including the logical relationship between conditions and actions and the execution status. The node status is updated in real time and notifications are sent to designated devices, thus realizing the visualization of rule execution status.

Benefits of technology

It improves the user experience of intelligent scene linkage, can quickly locate problems in rule execution, and enhances user satisfaction with the effect of rule application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114298309B_ABST
    Figure CN114298309B_ABST
Patent Text Reader

Abstract

The present disclosure provides an Internet of Things system and a method for executing rules thereof, and related devices. The method comprises: receiving event data; determining rule data corresponding to the event data and a rule tree corresponding to the rule data; judging conditions in the rule data based on the event data and executing actions in the rule data when action execution conditions of rules are met; and updating node states in the rule tree according to judgment results of the conditions in the rule data and execution situations of the actions in the process of judging the conditions in the rule data and executing the actions in the rule data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to an Internet of Things (IoT) system and a method and related equipment for executing its rules. Background Technology

[0002] With the development of the Internet of Things (IoT), more and more terminal devices are being developed, forming a relatively broad application market. In addition to providing their own unique functions, IoT terminal devices may also have a need to establish certain linkages with other devices. In related technologies, rule engines can be used to meet these linkage needs. However, when implementing rule engines, these related technologies do not provide visualization of the rule execution process, making it difficult for users to see the overall execution status of the rules. Summary of the Invention

[0003] This disclosure proposes an Internet of Things (IoT) system and a method and related equipment for implementing its rules.

[0004] In a first aspect, this disclosure provides a method for executing rules based on an Internet of Things (IoT) system, applied to a server, including:

[0005] Receive event data;

[0006] Determine the rule data corresponding to the event data and the rule tree corresponding to the rule data;

[0007] Based on the event data, the conditions in the rule data are judged, and the action in the rule data is executed when the action execution conditions of the rule are met; and

[0008] During the process of judging the conditions in the rule data and executing the actions in the rule data, the node status in the rule tree is updated according to the judgment results of the conditions in the rule data and the execution status of the actions.

[0009] A second aspect of this disclosure provides a server, comprising:

[0010] One or more processors, memory; and

[0011] One or more programs;

[0012] The one or more programs are stored in the memory and executed by the one or more processors, the programs including instructions for performing the method described in the first aspect.

[0013] A third aspect of this disclosure provides an Internet of Things (IoT) system, comprising:

[0014] The server as described in the second aspect; and

[0015] The terminal device is configured to send event data to the server.

[0016] A fourth aspect of this disclosure provides a non-volatile computer-readable storage medium containing a computer program that, when executed by one or more processors, causes the processors to perform the method described in the first aspect.

[0017] A fifth aspect of this disclosure provides a computer program product including a computer-readable storage medium storing instructions that, when executed, cause at least one central processing unit of a computing device to perform the method according to the first aspect.

[0018] The IoT system and its rule execution method and related equipment disclosed herein provide a more intuitive display of rule execution status through a rule tree, which facilitates the viewing of rule execution status. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this disclosure or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A schematic diagram of an exemplary system provided by an embodiment of this disclosure is shown.

[0021] Figure 2A A schematic diagram of an exemplary rule tree according to an embodiment of the present disclosure is shown.

[0022] Figure 2B A schematic diagram of another exemplary rule tree according to an embodiment of this disclosure is shown.

[0023] Figure 2C A schematic diagram of yet another exemplary rule tree according to an embodiment of the present disclosure is shown.

[0024] Figure 2D A schematic diagram of another exemplary rule tree according to an embodiment of this disclosure is shown.

[0025] Figure 2E A schematic diagram of yet another exemplary rule tree according to an embodiment of the present disclosure is shown.

[0026] Figure 2F A schematic diagram of another exemplary rule tree according to an embodiment of this disclosure is shown.

[0027] Figure 3AA schematic diagram of an exemplary interface according to an embodiment of the present disclosure is shown.

[0028] Figure 3B A schematic diagram of another exemplary interface according to an embodiment of this disclosure is shown.

[0029] Figure 3C A schematic diagram of yet another exemplary interface according to an embodiment of the present disclosure is shown.

[0030] Figure 4 A flowchart illustrating an exemplary method provided in an embodiment of this disclosure is shown.

[0031] Figure 5 A schematic diagram of the hardware structure of an exemplary electronic device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0033] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this disclosure should have the ordinary meaning understood by one of ordinary skill in the art to which this disclosure pertains. The terms "first," "second," and similar terms used in the embodiments of this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0034] This disclosure provides a system for pushing meeting information, which can, to some extent, solve the problem of low efficiency in pushing meeting information in high-concurrency scenarios. In some embodiments, the system can be developed based on the Android system, which has the advantage of openness, making it easy to develop and adapt to a wide variety of hardware products.

[0035] Figure 1 A schematic diagram of an exemplary system 100 provided in an embodiment of this disclosure is shown.

[0036] like Figure 1 As shown, the system 100 may include a server 200 and a terminal device 300.

[0037] Server 200 can be a server deployed within an enterprise or a commercial server purchased or leased by the enterprise. When system 100 is an IoT system, server 200 can be implemented as an IoT platform. The number of servers 200 can be one or more. When there are multiple servers 200, a distributed architecture can be used to form a server cluster.

[0038] Terminal device 300 can be various types of devices. For example, such as... Figure 1 As shown, for example, terminal device 300 may be a smart alarm clock 302, personal computer 304, smart speaker 306, thermometer and hygrometer 308, television 310, lighting equipment (e.g., table lamp, ceiling light) 312, camera 314, air conditioner 316, etc.

[0039] In this IoT system 100, it may be necessary to achieve intelligent scene linkage among various terminal devices 300, that is, to establish linkage between terminal devices or between terminal devices and other things according to user scenario needs. For the implementation of such linkage, such as... Figure 1 As shown, this can be achieved by setting up a rule engine 202 in server 200. A rule engine can refer to a software system that processes rules, integrating a set of events (facts) and a set of rules passed to the system to trigger one or more rules. Here, a rule can refer to the laws governing operation or behavior. In a rule engine, rules can refer to the relationships between terminal devices and between terminal devices and time, typically expressed as "if certain conditions are met, then perform certain actions." For example, if the door is open, then turn on the lights. Or, if it's 6 AM every morning, then turn on the streetlights.

[0040] In some embodiments, such as Figure 1 As shown, the system 100 may also include a control device 400. The control device 400 may include different types of devices, such as devices 402 and 404. For example, control device 402 may be controlled by an end user, who can set the linkage rules between various terminal devices within their controllable range (e.g., the user's home environment) and generate corresponding rule data 402. As another example, control device 404 may be operated by developers of an IoT service provider or personnel with corresponding control permissions, and can generate general rule data 402 based on some common rules.

[0041] like Figure 1As shown, the control device 400 can send these rule data 402 to the server 200, and then the rule engine in the server 200 processes the rule data 402 based on the input event data (Fact) (e.g., matching the conditions of the rule data). However, in related technologies, rule engines typically lack visualization of rule execution, which makes it difficult to view the rules as a whole when there are many conditions and actions contained in the rules. Moreover, it is impossible to quickly locate these problems in the rules after issues such as rule execution anomalies or failures.

[0042] In view of this, the present disclosure provides an Internet of Things system that can visualize the rule execution status, display the rules more intuitively, facilitate the viewing of the rule execution status, and quickly locate the problem in the rule when a problem occurs in the rule execution.

[0043] In the initial state, the control device 400 generates some rule data 402 as needed, and then sends this rule data 402 to the server 200.

[0044] In some embodiments, server 200 can first parse the rule data 402 to determine the conditions and actions within it. For example, rule engine 202 in server 200 can parse the rule data 402 to obtain corresponding rule scripts, and then store these rule scripts in rule base 204 for easy access. The content of a rule script is in the form of: rule "rule name" "description" {when door lock (001) is open; then light (light01) is on}. Simultaneously, by parsing the rule data 402, the corresponding conditions and actions can be obtained. For example, the condition in the aforementioned rule script is "door lock (001) is open," and the action is "light (light01) is on."

[0045] After parsing the actions and conditions in the rule data 402, the rule engine 202 can create the corresponding rule tree 206 based on these conditions and actions.

[0046] Figure 2A A schematic diagram of an exemplary rule tree 206 according to an embodiment of the present disclosure is shown.

[0047] like Figure 2A As shown, the rule tree 206 may include multiple nodes 2062 to 2078. The root node 2062 may include the name and description of the rule corresponding to the rule tree 206. The root node 2062 includes two child nodes 2064 and 2066. Child node 2064 may include all the conditions of the rule corresponding to the rule tree 206, thus forming a condition set. Child node 2066 may include all the actions of the rule corresponding to the rule tree 206, thus forming an action set.

[0048] In some embodiments, when creating a rule tree 206, condition branches of the rule tree 206 can be constructed based on conditions in the condition set, and action branches of the rule tree 206 can be constructed based on actions in the action set.

[0049] When there are two or more conditions in the condition set, in some embodiments, the condition branch can be constructed based on the logical relationship between the conditions.

[0050] For example, the condition set of rule tree 206 can include multiple conditions. Rule engine 202 can first determine the first and second conditions from the condition set.

[0051] Then, rule engine 202 can determine the logical relationship between the first and second conditions based on the content parsed from rule data 402. In rules, there are generally two types of logical relationships between conditions: an AND relationship and an OR relationship.

[0052] If the first and second conditions are in an OR relationship, rule engine 202 can set the node corresponding to the first condition (e.g., node 2068) and the node corresponding to the second condition (e.g., node 2070) to the same level in that condition branch, such as... Figure 2A As shown. If the first condition and the second condition are related by AND, the rule engine 202 can set the node corresponding to the first condition as the parent node of the node corresponding to the second condition in that condition branch.

[0053] Then, rule engine 202 can determine the third condition from the set of conditions. Then, it determines the logical relationship between the third condition and the first and second conditions in the manner described above.

[0054] If the third condition is ORed with the first condition, rule engine 202 can set the nodes corresponding to the first and third conditions to the same level in that conditional branch. If the first and third conditions are ANDed, rule engine 202 can set the node corresponding to the first condition (e.g., node 2068) as the parent node of the node corresponding to the third condition (e.g., node 2072) in that conditional branch. Figure 2A As shown.

[0055] If there is no logical relationship between the third condition and the first condition, then the logical relationship between the third condition and the second condition can be further determined. Then, based on the logical relationship between the third condition and the second condition, the corresponding nodes can be established in the condition branches according to the above method.

[0056] If there is no logical relationship between the third condition and the second condition, then in this conditional branch, the node corresponding to the third condition can be set to the same level as the node corresponding to the first condition and the node corresponding to the second condition.

[0057] By following the above method in sequence, until all conditions in the condition set have been traversed, the condition branches of rule tree 206 are constructed. Figure 2A An example of the conditional branches of the rule tree 206 is shown. It should be noted that the above method of constructing conditional branches can be constructed by randomly selecting conditions from the condition set. However, it is understandable that when there is a judgment order of conditions in the rule, when determining the first condition, the second condition, the third condition, etc., can be determined by sequentially selecting conditions from the condition set as the corresponding first condition, second condition, or third condition, etc., according to the judgment order of these conditions.

[0058] When there are two or more actions in the action set, in some embodiments, the action branches of the rule tree 206 can be constructed based on the execution relationship between the actions.

[0059] For example, the action set of rule tree 206 may include multiple actions. Rule engine 202 may first determine the first action and the second action from the action set.

[0060] Then, rule engine 202 can determine the execution relationship between the first action and the second action based on the content parsed from rule data 402. In rules, the execution relationship between actions generally falls into two categories: parallel and sequential.

[0061] If the first and second actions are parallel, the rule engine 202 can set the node corresponding to the first action (e.g., node 2074) and the node corresponding to the second action (e.g., node 2076) to the same level in that action branch, such as... Figure 2A As shown. If the first action and the second action are sequential, the rule engine 202 can set the node corresponding to the first action as the parent node of the node corresponding to the second action in that action branch.

[0062] Then, rule engine 202 can determine the third action from the action set. Then, it determines the execution relationship between the third action and the first and second actions in the manner described above.

[0063] If the third action and the first action are parallel, rule engine 202 can set the node corresponding to the third action and the node corresponding to the first action to the same level in this action branch. If the third action and the first action are sequential, rule engine 202 can set the node corresponding to the first action (e.g., node 2074) as the parent node of the node corresponding to the third action (e.g., node 2078) in this action branch, such as... Figure 2A As shown.

[0064] If there is no execution relationship between the third action and the first action, the execution relationship between the third action and the second action can be further determined. Then, based on the execution relationship between the third action and the second action, the corresponding nodes can be established in the action branch according to the above method.

[0065] If there is no execution relationship between the third action and the second action, then in this action branch, the node corresponding to the third action can be set to the same level as the node corresponding to the second action and the node corresponding to the first action.

[0066] By following the above method in sequence, until all actions in the action set have been traversed, the action branches of rule tree 206 are constructed. Figure 2A An example of the action branch of rule tree 206 is shown in the figure. Figure 2A The rule corresponding to rule tree 206 can be represented as: rule "rule name" "description" {when(condition 1 and condition 3) or (condition 2); then(action 1 and action 3) or (action 2)}.

[0067] It should be noted that the above method of constructing action branches can be based on randomly selecting actions from the action set. However, it is understandable that when there is an execution order of actions in the rules, when determining the first, second, and third actions, actions from the action set can be selected sequentially as the corresponding first, second, or third actions based on the execution order of these actions.

[0068] This completes the creation of the rule tree. An example rule tree 206 is shown below. Figure 2A As shown.

[0069] It is understood that the above embodiments only describe an example of a rule being created as a rule tree. In some cases, the control device 400 can upload a lot of rule data to the server 200. These rule data can be created into corresponding rule trees by the rule engine 202 of the server 200 and then stored in the server 200. In this way, the rule engine 202 of the server 200 can determine the rule tree corresponding to the target rule data (the rule data that matches the event data) from the rule trees stored in the server 200 as needed.

[0070] After creating the rule tree, the rule engine 202 of the server 200 can listen for external events (e.g., the device status of the terminal device 300) based on this rule data and the corresponding rule tree in order to obtain the corresponding event data. In some embodiments, the rule engine 202 can listen for three types of events: reporting device status events, triggering timed events, and terminating listening events.

[0071] Back Figure 1 For reported device status events, terminal device 300 can upload corresponding event data 320 in real time or at a preset frequency. After server 200 receives event data 320, rule engine 202 responds to the event data 320 and enters the loop of processing rules.

[0072] The rule engine 202 can determine the rule data corresponding to the event data 320. In some embodiments, the corresponding rule data can be matched in the rule base 204 based on the source of the event data 320. For example, if the event data 320 is uploaded by the terminal device 302, and the rule data containing the device information of the terminal device 302 (e.g., device ID) is matched in the rule base 204, it can be determined that the rule data is the rule data corresponding to the event data 320. Accordingly, the corresponding rule tree can be further determined based on the rule data corresponding to the event data 320.

[0073] In some embodiments, after determining the rule data corresponding to event data 320, the validity of the rule data can be determined based on preset conditions to determine whether the rule corresponding to the rule data needs to be executed. The preset conditions can be a set condition for the rule data, such as executing the rule only between 8 PM and 10 PM, or executing the rule only on rainy days, etc. If the preset conditions are met, the rule data is deemed valid, and the corresponding rule can be executed.

[0074] In some embodiments, the node states of the rule tree may include an initial state, a pending state, a failed state, and a successful state. Different states can be labeled with different tags to represent the rule tree. When the rule tree is initially created, the state of each node can be the initial state. Before executing rules, the rule engine 202 can first generate the state data of the root node 2062, the condition set node 2064 (the root node of the condition branch), and the first condition node 2068 of the rule tree (e.g., rule tree 206) corresponding to the changed rule data, and then update the node states of the rule tree 206 based on this state data, such as... Figure 2B As shown. When the corresponding rule is executed, the state of the root node 2062, the condition set node 2064, and the first condition node 2068 can switch from the initial state to the pending state.

[0075] Next, the rule engine 202 can judge (or evaluate) the conditions in the rule data based on the event data 302. In some embodiments, for each condition in the rule data, the rule engine 202 can generate a corresponding marker to update the node state in the rule tree based on the judgment result of whether the event data 302 satisfies the corresponding condition. In some embodiments, the conditions can be evaluated in order. For example, first, the first condition is judged. If the first condition is satisfied, the rule engine 202 can update the node state of the node 2068 corresponding to the first condition from the pending state to the successful state, and then further judge whether the third condition, which is ANDed with the first condition, is satisfied. If the first condition is not satisfied, the rule engine 202 can update the node state of the node 2068 corresponding to the first condition from the pending state to the failed state, such as... Figure 2C As shown. In some embodiments, if the first condition has been determined to be unsatisfied, the third condition, which has an AND relationship with the first condition, does not need to be evaluated, thereby saving system resources. Then, the second condition can be evaluated. In some embodiments, the node 2070 corresponding to the second condition in the rule tree 206 can be switched from the initial state to the pending state before the second condition is evaluated. If the second condition is satisfied, the rule engine 202 can update the node state of the node 2070 corresponding to the second condition from the pending state to the success state. This process continues until any condition in the condition set satisfies the condition of the rule and the corresponding action can be executed.

[0076] like Figure 2B , 2CAs shown, during the process of judging any condition in the condition set, the rule engine 202 can mark the corresponding node of the rule tree 206 with a corresponding status based on the judgment result. In some embodiments, the rule engine 202 can send a notification message 220 to a designated device (e.g., control device 400) based on the change in the node status in the rule tree 206, so that the designated device can display the node status of the rule tree 206 through the interface. Figure 3A A schematic diagram of an exemplary interface 410 displayed on the designated device is shown. For example... Figure 3A As shown, after receiving notification message 220, the designated device can generate a corresponding rule tree in interface 410 based on notification message 220, and mark the corresponding status information on the corresponding node of the rule tree in interface 410 according to notification message 220. In some embodiments, when the node status includes two or more status types, such as Figure 3A As shown, in this interface 410, different types of node states can be highlighted using different display methods. For example, different background colors or patterns can be used to distinguish different node states. In this way, users on the terminal device can intuitively determine the current execution state of the corresponding rule based on the node states of the rule tree in interface 410. In some embodiments, to make it clearer to the user what state the node markers in the rule tree represent, such as... Figure 3A As shown, the device can display corresponding status descriptions in the blank space of interface 410. For example, from... Figure 3A In interface 410, the user can see that the rule corresponding to the rule tree is currently in a state where the conditions have been determined to be met and the corresponding action is about to be executed. Furthermore, when determining the conditions corresponding to the rule, the first condition is not met (and therefore the third condition, which is ANDed with the first condition, is not determined accordingly), but the second condition is met, thus satisfying the execution conditions of the rule. In some embodiments, each processing action of the rule can cause a change in the node state in the rule tree 206. Each time the node state in the rule tree 206 changes, the rule engine 202 can send a notification message 220 to a designated device (e.g., control device 400), so that the rule tree and the interface of the designated device can dynamically update the rule representation as the rule is executed. In some embodiments, the edges between nodes in the rule tree can also dynamically change as the rule execution progresses.

[0077] Figure 2D A schematic diagram of a rule tree is shown. (For example...) Figure 2D As shown, the first condition of node 2068 is determined to be unsatisfied, and the second condition of node 2070 is determined to be satisfied, so that the execution condition of the action corresponding to the rule is satisfied and the corresponding action can be executed.

[0078] In some embodiments, before starting to execute an action, the rule engine 202 may first generate state data for the node 2066 of the action set that changes the rule tree 206 and the node 2074 of the first action, and then update the node state of the rule tree 206 based on this state data, such as... Figure 2D As shown. When the corresponding action begins to be executed, the state of node 2066 of the action set and node 2074 of the first action can switch from the initial state to the pending state.

[0079] Next, the rule engine 202 can execute the actions in the rule data based on the event data 302. For example, the rule engine 202 can send an instruction to the corresponding device to execute the corresponding action and receive a message from the device indicating whether the execution was successful or not.

[0080] In some embodiments, for each action in the rule data, the rule engine 202 can generate a corresponding flag to update the node state in the rule tree based on whether the action was successfully executed. In some embodiments, the actions can be executed in order. For example, the first action can be executed first, and since the first and second actions are parallel, the second action can also be executed simultaneously. If the first action is successfully executed, the rule engine 202 can update the node state of the node 2074 corresponding to the first action from the pending state to the successful state, such as... Figure 2E As shown. If the first action fails, the rule engine 202 can update the node status of node 2074 corresponding to the first action from the pending state to the failed state. Similarly, it can mark the status of node 2076 corresponding to the second action based on the execution result of the second action. If the first action succeeds, the third action can be executed, and the status of node 2078 corresponding to the third action can be marked based on the execution result of the third action. This process continues until all actions in the action set have been traversed.

[0081] like Figures 2D-2F As shown, during the execution of any action in the action set, the rule engine 202 can mark the corresponding node of the rule tree 206 with a corresponding status based on the execution result. In some embodiments, the rule engine 202 can send a notification message 220 to a designated device (e.g., control device 400) based on the change in the node status in the rule tree 206, so that the designated device can display the node status of the rule tree 206 through the interface. Figure 3B and Figure 3C Schematic diagrams of an exemplary interface 410 displayed on the designated device are shown respectively. For example... Figure 3B and Figure 3CAs shown, after receiving notification message 220, the designated device can generate a corresponding rule tree in interface 410 based on notification message 220, and mark the corresponding status information on the corresponding node of the rule tree in interface 410 according to notification message 220. In some embodiments, when the node status includes two or more status types, such as Figure 3B and Figure 3C As shown, in this interface 410, different types of node states can be highlighted using different display methods. For example, different background colors or patterns can be used to distinguish different node states. In this way, users on the terminal device can intuitively determine the current execution state of the corresponding rule based on the node states of the rule tree in interface 410. In some embodiments, to make it clearer to the user what state the node markers in the rule tree represent, such as... Figure 3B and Figure 3C As shown, the device can display corresponding status descriptions in the blank space of interface 410. For example, from... Figure 3B In interface 410, the user can see that for the rule corresponding to this rule tree, only the first action was executed successfully, while the second and third actions failed, resulting in rule execution failure. For example, from... Figure 3C In the interface 410, the user can see that the first action, the second action, and the third action of the rule corresponding to the rule tree have all been executed successfully, thus making the rule execution successful.

[0082] Once a rule is executed, the corresponding rule tree is also updated. Rule engine 202 can then extract the rule corresponding to event data 320 from rule base 204 again, until all rules corresponding to event data 320 have been executed or the subsequently extracted rules are invalid (e.g., within a time period not in which the rule is executed). At this point, rule engine 202 can exit the rule processing loop triggered by event data 320 and return to the position of listening to external events.

[0083] In some embodiments, when the rule engine 202 receives a triggered timed event, the rule engine 202 may also enter a loop of processing rules similar to those described above. The processing flow is similar to the processing flow of receiving a reported device status event. The difference is that the rule engine 202 extracts rules from the rule base 204 that match the current timed event (e.g., the timed task at the current moment).

[0084] In some embodiments, when the rule engine 202 receives a termination listening event, the rule engine 202 may stop working, for example, by no longer listening to the state of the terminal device 300.

[0085] The IoT system provided in this disclosure visualizes rule execution by generating rule execution data, updating nodes in the rule tree, and sending change notifications to designated devices. This enhances the user experience of intelligent scene linkage and solves the problem that users cannot view the overall execution status of rules. By converting rules into a rule tree, this disclosure allows for a more intuitive understanding of the rule structure. Furthermore, it displays rule execution in real time, facilitating timely monitoring of execution progress and improving user satisfaction with rule application effectiveness.

[0086] The application scenarios of this disclosure are not limited to IoT scenarios in a home environment, but can also include application scenarios such as outdoor advertising machines in buildings, supermarket shelf signs, and meteorological environmental observation instruments, which, in addition to providing their own unique functions, also need to establish certain linkages with other devices.

[0087] It should be noted that the embodiments disclosed herein are not limited to viewing rules for IoT devices. In theory, in any scenario where rules are used to solve problems, the execution of the rules can be visualized to present the overall execution status of the rules and achieve better feedback.

[0088] This disclosure also provides a method for executing rules based on an Internet of Things (IoT) system. Figure 4 A flowchart illustrating an exemplary method 500 provided in an embodiment of this disclosure is shown. This method 500 can be implemented by the aforementioned server 200. Figure 4 As shown, the method 500 may further include the following steps.

[0089] In step 502, server 200 may receive event data (e.g., Figure 1 Event data 320).

[0090] In step 504, server 200 can determine the rule data corresponding to the event data (e.g., Figure 1 The rule data 402) and the rule tree corresponding to the rule data (e.g., Figure 1 (Rule tree 206).

[0091] In some embodiments, method 500 further includes creating a rule tree corresponding to the rule data (e.g., Figure 2A The rule tree 206 specifically includes: receiving rule data; parsing the rule data to obtain the conditions and actions in the rule data; and creating a rule tree corresponding to the rule data based on the conditions and actions; wherein the rule tree includes condition branches constructed based on the conditions and action branches constructed based on the actions.

[0092] In some embodiments, the number of conditions is two or more. Based on the conditions and the actions, a rule tree corresponding to the rule data is created, including: determining a first condition and a second condition among the two or more conditions; determining the logical relationship between the first condition and the second condition; in response to the first condition and the second condition being in an OR relationship, setting the node corresponding to the first condition and the node corresponding to the second condition to the same level in the condition branch; or in response to the first condition and the second condition being in an AND relationship, setting the node corresponding to the first condition as the parent node of the node corresponding to the second condition in the condition branch.

[0093] In some embodiments, the number of actions is two or more. Based on the conditions and the actions, a rule tree corresponding to the rule data is created, including: determining a first action and a second action among the two or more actions; determining the execution relationship between the first action and the second action; in response to the first action and the second action being in a parallel relationship, setting the node corresponding to the first action and the node corresponding to the second action to the same level in the action branch; or in response to the first action and the second action being in a serial relationship, setting the node corresponding to the first action as the parent node of the node corresponding to the second action in the condition branch.

[0094] In step 506, the server 200 can judge the conditions in the rule data based on the event data and execute the action in the rule data when the action execution conditions of the rule are met.

[0095] In step 508, during the process of judging the conditions in the rule data and executing the actions in the rule data, the server 200 can update the node status in the rule tree according to the judgment result of the conditions and the execution status of the actions.

[0096] In some embodiments, updating the node status in the rule tree based on the judgment result of the condition and the execution status of the action further includes: in response to the update of the node status in the rule tree, outputting a notification message to a designated device so that the designated device displays the node status of the rule tree through an interface; wherein, in the interface, different types of node status are highlighted using different display formats.

[0097] In some embodiments, the node state includes an initial state and a pending state. After determining the rule data corresponding to the event data, the method further includes: updating the node state of the root node of the condition branch of the rule tree and the node corresponding to the first condition from the initial state to the pending state, such as... Figure 2B As shown.

[0098] In some embodiments, the node state further includes a failure state and a success state. Updating the node state in the rule tree based on the judgment result of the condition includes: in response to the first condition not being met, updating the node state of the node corresponding to the first condition from the pending state to the failure state; or in response to the first condition being met, updating the node state of the node corresponding to the first condition from the pending state to the success state, such as... Figure 2C or Figure 2D As shown.

[0099] In some embodiments, the node state includes an initial state and a pending state. Before executing the action in the rule data when the condition is met, the method further includes: updating the node state of the root node of the action branch of the rule tree and the node corresponding to the first action from the initial state to the pending state, such as... Figure 2D As shown.

[0100] In some embodiments, the node state further includes a failure state and a success state. Updating the node state in the rule tree based on the execution status of the action includes: in response to the failure of the first action, updating the node state of the node corresponding to the first action from the pending state to the failure state; or in response to the success of the first action, updating the node state of the node corresponding to the first action from the pending state to the success state, such as... Figure 2E or Figure 2F As shown.

[0101] It should be noted that the method of this disclosure embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this disclosure embodiment, and the multiple devices will interact with each other to complete the method described.

[0102] It should be noted that the above description describes some embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0103] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this disclosure also provides an electronic device that can be used to implement various devices in system 100, such as server 200, terminal device 300, and control device 400. The electronic device may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method 500 described in any of the above embodiments.

[0104] Figure 5 This diagram illustrates the hardware structure of a more specific electronic device 600 provided in this embodiment. The device 600 may include: a processor 602, a memory 604, an input / output interface 606, a communication interface 608, and a bus 610. The processor 602, memory 604, input / output interface 606, and communication interface 608 are interconnected internally via the bus 610.

[0105] The processor 602 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0106] The memory 604 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 604 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 604 and is called and executed by the processor 602.

[0107] The input / output interface 606 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0108] The communication interface 608 is used to connect the communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0109] Bus 610 includes a pathway for transmitting information between various components of the device, such as processor 602, memory 604, input / output interface 606, and communication interface 608.

[0110] It should be noted that although the above-described device only shows the processor 602, memory 604, input / output interface 606, communication interface 608, and bus 610, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0111] The electronic devices described above are used to implement the corresponding method 500 in any of the foregoing embodiments and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0112] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method 500 as described in any of the above embodiments.

[0113] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0114] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the method 500 as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0115] Based on the same inventive concept, corresponding to the method 500 of any of the above embodiments, this disclosure also provides a computer program product, which includes a computer program. In some embodiments, the computer program is executable by one or more processors to cause the processors to perform the method 500. Corresponding to the execution entity for each step in each embodiment of method 500, the processor executing the corresponding step may belong to the corresponding execution entity.

[0116] The computer program product of the above embodiments is used to cause the processor to execute the method 500 as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0117] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this disclosure (including the claims) is limited to these examples; within the framework of this disclosure, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this disclosure as described above, which are not provided in detail for the sake of brevity.

[0118] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this disclosure, the provided drawings may or may not show well-known power / ground connections to integrated circuit (IC) chips and other components. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this disclosure, and this also takes into account the fact that the details of implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this disclosure will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuitry) have been set forth to describe exemplary embodiments of this disclosure, it will be apparent to those skilled in the art that the embodiments of this disclosure may be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0119] Although this disclosure has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0120] This disclosure is intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for executing rules based on an Internet of Things (IoT) system, applied to a server, comprising: Receive event data; Determine the rule data corresponding to the event data and the rule tree corresponding to the rule data. The rule tree includes a condition branch constructed based on the conditions in the rule data and an action branch constructed based on the actions in the rule data. The condition branch includes a condition node, and the action branch includes an action node. Based on the event data, the conditions in the rule data are judged, and the action in the rule data is executed when the action execution conditions of the rule are met; as well as During the process of judging the conditions in the rule data and executing the actions in the rule data, the node states of the condition nodes and / or action nodes in the rule tree are updated according to the judgment results of the conditions in the rule data and the execution status of the actions, so that the rule tree presents the execution status of the rule data; wherein, the node state includes at least one of the following: initial state, pending state, failure state, and success state; The process of updating the node status in the rule tree based on the judgment results of the conditions in the rule data and the execution status of the action further includes: In response to an update of the node status in the rule tree, a notification message is output to a designated device so that the designated device can display the node status of the rule tree through an interface. In the interface, different types of node states are highlighted in different ways.

2. The method of claim 1, further comprising creating a rule tree; in, The creation of the rule tree specifically includes: Receive rule data; Parse the rule data to obtain the conditions and actions within the rule data; and Based on the conditions and the actions, create the rule tree.

3. The method as described in claim 2, wherein, The number of conditions is two or more. Based on the conditions and the actions, a rule tree is created, including: Determine the logical relationship between the two or more conditions; In response to the OR relationship between the first and second conditions in the two or more conditions, the node corresponding to the first condition and the node corresponding to the second condition are set to the same level in the conditional branch; or In response to the first and second conditions being in an AND relationship, the node corresponding to the first condition is set as the parent node of the node corresponding to the second condition in the conditional branch.

4. The method of claim 2, wherein, The number of actions is two or more. Based on the conditions and the actions, the rule tree is created, including: Determine the execution relationship between the two or more actions; In response to the fact that the first action and the second action in one of the two or more actions are parallel, the node corresponding to the first action and the node corresponding to the second action are set to the same level in the action branch; or In response to the fact that the first action and the second action in the two or more actions are sequential, the node corresponding to the first action is set as the parent node of the node corresponding to the second action in the conditional branch.

5. The method of claim 3, wherein, The conditional branches of the rule tree include a root node and a node corresponding to the first condition, wherein the node corresponding to the first condition is a child node of the root node of the conditional branch. The node state includes an initial state and a pending state. After determining the rule data corresponding to the event data, it also includes: The node states of the root node of the conditional branch of the rule tree and the node corresponding to the first condition are updated from the initial state to the pending state.

6. The method of claim 5, wherein, The node status also includes failure and success states. The node status in the rule tree is updated based on the judgment result of the conditions, including: In response to the first condition not being met, the node state of the node corresponding to the first condition is updated from the pending state to the failed state; or In response to the first condition being met, the node state of the node corresponding to the first condition is updated from the pending state to the successful state.

7. The method of claim 4, wherein, The action branch of the rule tree includes a root node and a node corresponding to the first action, wherein the node corresponding to the first action is a child node of the root node of the action branch. The node state includes an initial state and a pending state. Before executing the action in the rule data when the condition is met, it also includes: The node states of the root node of the action branch of the rule tree and the node corresponding to the first action are updated from the initial state to the pending state.

8. The method of claim 7, wherein, The node status also includes failure and success states. The node status in the rule tree is updated based on the execution status of the action, including: In response to the failure of the first action, the node state of the node corresponding to the first action is updated from the pending state to the failed state; or In response to the successful execution of the first action, the node state of the node corresponding to the first action is updated from the pending state to the successful state.

9. A server, comprising: One or more processors and memory; as well as One or more programs; The one or more programs are stored in the memory and executed by the one or more processors, the programs including instructions for performing the method according to any one of claims 1-8.

10. An Internet of Things (IoT) system, comprising: The server as described in claim 9; as well as The terminal device is configured to send event data to the server.

11. The system of claim 10, further comprising a control device configured to send rule data to the server.

12. The system of claim 11, wherein, The node states of the rule tree include two or more state types; The server is configured to: output a notification message to the control device in response to an update of the node status in the rule tree; The control device is configured to: determine the node status of each node in the rule tree according to the notification message; and display an interface including the rule tree, wherein different types of node status are highlighted in different display formats in the interface.

13. A non-volatile computer-readable storage medium comprising a computer program, which, when executed by one or more processors, causes the processors to perform the method of any one of claims 1-8.

14. A computer program product comprising a computer-readable storage medium storing instructions which, when executed, cause at least one central processing unit of a computing device to perform the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Method and device for tracking logic nodes during automatic testing, equipment and medium

    CN113268409A

  • Device linkage relationship display method and device, electronic equipment and storage medium

    CN113495491A

  • Integrated Alert System

    US20100281405A1