IoT Automated Rule Derivation and Representation Method and Device
By building a validation set from event logs and generating condition tree expressions in an IoT system, the automation rules are represented as finite state machine state transitions. This solves the problem of idealization in the acquisition of assumptions for automation rules in existing technologies, improves the robustness and applicability of the analysis, and is suitable for security scenarios such as model verification and dynamic simulation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, the automation rules in IoT systems are assumed to be open source and directly available, resulting in low robustness and applicability of static analysis techniques, which cannot meet the needs of security researchers, especially in heterogeneous IoT systems where cross-platform automated rule correlation analysis is not possible.
By establishing a validation set from the event logs of heterogeneous IoT systems, generating and evolving condition tree expressions until they meet the validation set, and then representing automation rules as state transitions in a finite state machine, the idealized assumptions of automation rule acquisition are resolved, and the robustness and applicability of the analysis are improved.
It realizes a robust automated rule derivation and representation that is widely applicable in heterogeneous IoT systems, suitable for security scenarios such as model verification and dynamic simulation, and simplifies the operation process.
Smart Images

Figure CN116781328B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer, communication and information security technology, and in particular to a method and apparatus for automating rule deduction and representation in the Internet of Things. Background Technology
[0002] In related technologies, static analysis methods are mainly used, all of which assume that the automation rules are open source and directly available. Soteria and IoTGuard use model verification and runtime to perform monitoring technology to analyze potential security attribute violations in the behavioral state model. In addition, the IoTMon framework discovers possible physical interactions by analyzing the generated interaction chains, thereby defining different risk levels of the interaction chains and identifying potential high-risk interactions in real environments.
[0003] However, the related technologies all assume that the automation rules are open source and directly available, which is rather idealistic. The related static analysis techniques have low robustness and limited applicability, and cannot meet the needs of security researchers, so they urgently need to be addressed. Summary of the Invention
[0004] This application is based on the inventor's understanding and insights into the following issues:
[0005] In typical IoT application scenarios such as smart homes, smart cities, and industrial control systems, a device / node directly interacts with the environment and associates with other system devices / nodes, influencing them. This association is typically achieved through TAP (Trigger-Action Programming), which describes "if...then..." automated rules. That is, when a specified trigger event (e.g., a motion sensor detects motion) occurs, a specified device will respond (e.g., turn on a light). Users can leverage the automation rule mechanism of the IoT platform to formulate complex TAP logic across diverse devices.
[0006] In existing IoT scenarios, users can introduce devices from different manufacturers and automate their control through various platforms, such as Samsung's SmartThings, Apple's HomeKit, Xiaomi's Mi Home and Home Assistant, and third-party platforms like IFTTT. The integration of heterogeneous devices in IoT systems greatly enhances the user experience, but it also presents challenges for analyzing the correlation between different types of TAP logic on different platforms. The mutual influence between TAP logics (such as conflicts and chain triggers) may violate security and privacy policies, threatening users' information, privacy, and even personal safety. Therefore, in IoT systems, it is necessary to combine the potential physical interaction effects in the environment (such as temperature, humidity, light intensity, sound, etc.) to explain the unexpected impact of automation rule associations, assess the security of device behavior, and verify whether it violates security and privacy policies.
[0007] Existing research assumes that automation rules are open-source and directly accessible. However, in real-world heterogeneous IoT systems, security researchers cannot access all automation rules across all platforms. For example, in a heterogeneous smart home system, users deploy Samsung and Xiaomi devices. Users can set automation rules for Xiaomi devices in the Mi Home app, but the Mi Home app does not provide an interface for accessing these rules. Therefore, existing research can only study the correlation between automation rules on the Samsung platform and cannot perform cross-platform automation rule correlation analysis. Furthermore, different platforms represent automation rules differently, and similar studies mainly focus on the "dependency" relationships between events. Such simple "dependency" relationships are insufficient to describe the complex logic of automation rules.
[0008] This application provides a method and apparatus for deducing and representing automated rules in the Internet of Things (IoT) to address the problem that related technologies all assume that the automated rules are open source and directly available, which is rather idealistic. The robustness and applicability of related static analysis techniques are low, which cannot meet the needs of security researchers.
[0009] The first aspect of this application provides a method for inferring and representing automated rules in the Internet of Things (IoT), comprising the following steps: establishing a validation set from event logs of a heterogeneous IoT system; generating and evolving different candidate conditions in the form of a condition tree expression until the validation set is satisfied, thereby obtaining a condition expression tree that satisfies the validation set; and representing the inferred automated rules as state transitions in a finite state machine based on the condition expression tree that satisfies the validation set.
[0010] Optionally, in one embodiment of this application, the step of establishing a verification set from the event log of a heterogeneous Internet of Things system includes: traversing the event log, maintaining a state list, and recording the state changes of candidate devices; when traversing the state change events of a target device, setting the value of the output field according to the specific state change, and using the corresponding state list as the input field, concatenating the input field with the output field to obtain the input-output pair in the verification set.
[0011] Optionally, in one embodiment of this application, generating and evolving different candidate conditions in the form of a condition tree expression includes: based on the condition tree expression consisting of branch nodes composed of logical connectors and terminal nodes composed of different sub-conditions, representing a sub-condition as a logical expression that a certain device should satisfy a certain state, and further dividing the terminal condition node into a device node, a logical operator node and a state value node.
[0012] Optionally, in one embodiment of this application, the step of generating and evolving different candidate conditions in the form of a condition tree expression until they meet the verification set, thereby obtaining a condition expression tree that meets the verification set, includes: randomly generating initial candidate conditions in the form of the condition tree expression and iteratively evolving them; in each generation, calculating the fitness level of the current candidate condition on the verification set, and selecting candidate conditions whose fitness level reaches a preset condition as the parent of the next generation; performing crossover and mutation operations on the parent's condition expression tree with a preset probability to generate a condition expression tree that meets the verification set as the state transition condition of the target device.
[0013] Optionally, in one embodiment of this application, representing the inferred automation rules as state transitions in a finite state machine includes: representing the state space of a device as a finite state machine, and representing the inferred conditions that conform to the verification set as conditions for a device state transition.
[0014] A second aspect of this application provides an IoT automation rule deduction and representation apparatus, comprising: a building module for building a verification set from event logs of a heterogeneous IoT system; a generation module for generating and evolving different candidate conditions in the form of a condition tree expression until they conform to the verification set, thereby obtaining a condition expression tree that conforms to the verification set; and a representation module for representing the deduced automation rules as state transitions in a finite state machine based on the condition expression tree that conforms to the verification set.
[0015] Optionally, in one embodiment of this application, the establishment module includes: a traversal unit, used to traverse the event log, maintain a state list, and record the state changes of candidate devices; and an acquisition unit, used to set the value of the output field according to the specific state change when traversing the state change events of the target device, and use the corresponding state list as the input field, and concatenate the input field with the output field to obtain the input-output pair in the verification set.
[0016] Optionally, in one embodiment of this application, generating and evolving different candidate conditions in the form of a condition tree expression includes, based on the condition tree expression consisting of branch nodes composed of logical connectors and terminal nodes composed of different sub-conditions, representing a sub-condition as a logical expression that a certain device should satisfy a certain state, and further dividing the terminal condition node into a device node, a logical operator node and a state value node.
[0017] Optionally, in one embodiment of this application, the generation module includes: a generation unit, configured to randomly generate initial candidate conditions in the form of the condition tree expression and continuously iterate and evolve them; in each generation, calculate the fitness degree of the current candidate condition on the verification set, select the candidate condition whose fitness degree reaches a preset condition as the parent of the next generation, and perform crossover and mutation operations on the condition expression tree of the parent with a preset probability to generate a condition expression tree that conforms to the verification set as the state transition condition of the target device.
[0018] Optionally, in one embodiment of this application, the representation module includes: a representation unit, used to represent the state space of a device as a finite state machine, and to represent the inferred conditions that conform to the verification set as conditions for a device state transition.
[0019] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the Internet of Things automated rule deduction and representation method as described in the above embodiments.
[0020] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for the deduction and representation of IoT automation rules.
[0021] This application's embodiments can establish a validation set from the event logs of heterogeneous IoT systems, generate and evolve different candidate conditions in the form of conditional tree expressions until they meet the validation set, resulting in a conditional expression tree that generates the validation set. This allows the inferred automation rules to be represented as state transitions in a finite state machine, effectively applicable to security scenarios such as model verification and dynamic simulation. This makes the deduction and representation of IoT automation rules widely applicable, robust, and easy to operate. Therefore, it solves the problem that related technologies all assume that automation rules are open-source and directly obtainable, which is rather idealistic, and that related static analysis techniques have low robustness and applicability, failing to meet the needs of security researchers.
[0022] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0023] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0024] Figure 1 This is a flowchart of an IoT automated rule derivation and representation method provided according to an embodiment of this application;
[0025] Figure 2 This is a schematic diagram illustrating the representation of IoT device state transition conditions using a tree structure, according to a specific embodiment of this application.
[0026] Figure 3 This is a flowchart of a verification set generation algorithm according to a specific embodiment of this application;
[0027] Figure 4 This is a flowchart of the candidate condition generation and evolution algorithm of a specific embodiment of this application;
[0028] Figure 5 This is a schematic diagram of the structure of the IoT automation rule deduction and representation device according to an embodiment of this application;
[0029] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0030] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0031] The following description, with reference to the accompanying drawings, describes an IoT automation rule deduction and representation method and apparatus according to embodiments of this application. Addressing the problem that the related technologies mentioned in the background section all assume that automation rules are open-source and directly obtainable, which is rather idealistic, and that the robustness and applicability of related static analysis techniques are low, failing to meet the needs of security researchers, this application provides an IoT automation rule deduction and representation method. In this method, a validation set can be established from the event logs of a heterogeneous IoT system. Different candidate conditions are generated and evolved in the form of a condition tree expression until they meet the validation set, resulting in a condition expression tree that generates the validation set. This allows the deduced automation rule to be represented as a state transition in a finite state machine, effectively applicable to security scenarios such as model verification and dynamic simulation. This makes the IoT automation rule deduction and representation widely applicable, robust, and easy to operate. Therefore, it solves the problem that the related technologies all assume that automation rules are open-source and directly obtainable, which is rather idealistic, and that the robustness and applicability of related static analysis techniques are low, failing to meet the needs of security researchers.
[0032] In this embodiment, the TAP rule can be represented as the state transition of the target device under corresponding environmental conditions. Therefore, this embodiment uses a finite state machine to represent the state space of device d, which can be represented as a quintuple. in, The set of (finite) states of the device represents the set of environmental conditions. Represents the final state set, Represents the initial state. Representing the state transition function, embodiments of this application may use Represents a (limited) set of devices in the current IoT environment, and uses Representative equipment The set of states, therefore, under environmental conditions ∈ ∑, the state of device d. Transfer to It can be represented as or Wherein, ∈ can be a single environmental condition, or multiple environmental conditions connected by ∧ (logical AND) or ∨ (logical NOT). For example, for an automation rule "When motion sensor M senses motion (ON) and temperature sensor T is greater than 20 degrees, turn on air conditioner AC", this embodiment of the application can represent the automation rule as the state transition of air conditioner AC. Therefore, for ease of description, the embodiments of this application will be described accordingly.
[0033] Specifically, Figure 1 This is a flowchart illustrating an IoT automated rule derivation and representation method provided in an embodiment of this application.
[0034] like Figure 1 As shown, the IoT automation rule derivation and representation method includes the following steps:
[0035] In step S101, a verification set is established from the event log of the heterogeneous Internet of Things system.
[0036] It is understood that the embodiments of this application can establish a verification set from the event logs of the heterogeneous IoT system in the following steps, which effectively improves the executability of IoT automated rule deduction and representation.
[0037] Optionally, in one embodiment of this application, establishing a verification set from the event log of a heterogeneous Internet of Things system includes: traversing the event log, maintaining a state list, and recording the state changes of candidate devices; when traversing the state change events of the target device, setting the value of the output field according to the specific state change, and using the corresponding state list as the input field, concatenating the input field and the output field to obtain the input-output pair in the verification set.
[0038] In actual execution, for a target device D tar If the target device state transition is simulated To determine the conditions, a verification set can first be established, consisting of "input-output" pairs. The input is the state of all candidate devices, and the output is whether a state transition has occurred for the target device in the current state. In this embodiment, "1" can be used to indicate that a state transition has occurred, and "0" to indicate that a state transition has not occurred. For example, regarding the state transition of the target device, air conditioner AC, in the above steps... The "input-output" pair (assuming the candidate devices are motion sensor M and temperature sensor T) can include (M=ON, T=25, output=1), (M=OFF, T=23, output=0), (M=ON, T=15, output=0), etc.
[0039] Furthermore, in this embodiment, the event log E is traversed, and a state list v is maintained. When a state change event of a candidate device is encountered, the value of the corresponding device v[device] in the state list v is updated. When a state change event of a target device is encountered, the value in the "output" field is set according to the specific state change, and the state list at this time is used as the "input" field. The "input" field and the "output" field are concatenated to form an "input-output" pair in the verification set, thereby constructing the verification set V, which effectively improves the executability of IoT automated rule deduction and representation.
[0040] In step S102, different candidate conditions are generated and evolved in the form of a condition tree expression until they meet the validation set, thus obtaining a condition expression tree that meets the validation set.
[0041] It is understood that the embodiments of this application can generate and evolve different candidate conditions in the form of condition tree expressions in the following steps until they meet the validation set, thereby obtaining a condition expression tree that meets the validation set, thus effectively improving the applicability of IoT automation rules to IoT scenarios.
[0042] Optionally, in one embodiment of this application, different candidate conditions are generated and evolved in the form of a condition tree expression, including: based on the condition tree expression of branch nodes composed of logical connectors and terminal nodes composed of different sub-conditions, a sub-condition is represented as a logical expression that a certain device should satisfy a certain state, and the terminal condition node is further divided into a device node, a logical operator node and a state value node.
[0043] In some embodiments, the condition tree expression in this application is a tree structure, which may include branch nodes based on logical connectors and terminal nodes composed of different sub-conditions. A sub-condition is represented as a logical expression of "a certain device should satisfy a certain state". The terminal condition node is further divided into a device node, a logical operator node, and a state value node, for example, such as... Figure 2 As shown, the state transition of the target device AC in the above steps can be represented as follows: Figure 2 It can represent the condition tree structure of the environmental condition M=ON∧T>20.
[0044] Optionally, in one embodiment of this application, generating and evolving different candidate conditions in the form of a condition tree expression until they meet the validation set, thereby obtaining a condition expression tree that meets the validation set, includes: randomly generating initial candidate conditions in the form of a condition tree expression and iteratively evolving them; in each generation, calculating the fitness of the current candidate condition on the validation set, and selecting candidate conditions whose fitness reaches a preset condition as the parent of the next generation; performing crossover and mutation operations on the parent's condition expression tree with a preset probability to generate a condition expression tree that meets the validation set as the state transition condition of the target device.
[0045] As one possible approach, for target device D tar State transition In this embodiment, initial candidate conditions can be randomly generated in the form of a condition tree expression and continuously iterated. In each generation, the fitness of the current candidate condition on the validation set can be calculated. Specifically, for each "input-output" pair in the validation set, the value of the "input" field is substituted into the candidate condition expression, the value of the current condition expression is calculated, and it is checked whether the value of the current condition expression is the same as the value of the "output" field. If they are different, the current candidate condition is not suitable for the current "input-output" pair, and the fitness score is incremented by one.
[0046] Furthermore, in this embodiment, the fitness scores of all candidate conditions on the current validation set can be sorted in descending order, and the top n candidate conditions can be selected as the "parents" of the next generation. Two condition trees, tree1 and tree2, from the parent trees can be randomly selected, and the results can be evaluated with a certain probability. c Swap a subtree of tree1 with a subtree of tree2 to generate a new condition tree newTree. For the new condition tree newTree, use a certain probability to... m The mutation of a subtree can include generating a new subtree, modifying the value of a node such as a device node, logical operator node, or state value node, and so on. This process iterates through the candidate condition tree until a condition representation tree that fully meets the validation set is generated, i.e., the fitness score is 0, which is then used as the target device state transition. In addition, the embodiments of this application can set an iteration threshold N. When the number of iterations exceeds the iteration threshold, the iteration stops and it is considered that there is no target device state transition in the current IoT environment.
[0047] In step S103, based on the conditional representation tree that meets the verification set, the inferred automation rules are represented as state transitions in a finite state machine.
[0048] It is understood that the embodiments of this application can represent the inferred automation rules as state transitions in a finite state machine based on the conditional expression tree that meets the verification set in the following steps. This can be effectively applied to security scenarios such as model verification and dynamic simulation, and is not affected by the closed source of platform rules or the different expression of rules on heterogeneous platforms. It has wide applicability, strong robustness, and is simple and easy to operate.
[0049] Optionally, in one embodiment of this application, the inferred automation rules are represented as state transitions in a finite state machine, including: representing the state space of a device as a finite state machine, and representing the inferred conditions that conform to the verification set as conditions for a device state transition.
[0050] In some embodiments, for the target device D in this application embodiment tarThe finite state machine can be updated based on the deduction results in the above steps. If the target device's state transition is deduced in the above steps... If the condition is ∈, then the condition ∈ is added to the environmental condition set ∑ of the finite state machine corresponding to the device, and its state transition function is updated. This effectively improves the robustness and applicability of the method, making it simple and easy to operate.
[0051] For example, such as Figure 3 As shown, the working principle of the embodiments of this application will be described below with a specific example.
[0052] Step S301: Input event logs and target device status changes.
[0053] Step S302: Initialize the verification set, status list and output field, where event is the first event in the event log.
[0054] Step S303: Determine if event is an empty event. If it is an empty event, proceed to step S311; otherwise, proceed to step S304.
[0055] Step S304: Determine whether the device of the event is the target device. If it is the target device, proceed to step S306; otherwise, proceed to step S305.
[0056] Step S305: Update the value of the corresponding device in the status list and proceed to step S310.
[0057] Step S306: Determine whether the state change of the event is a target state transition. If it is a target state transition, proceed to step S308; otherwise, proceed to step S307.
[0058] Step S307: The output field is 0, and step S309 is executed.
[0059] Step S308: Output field is 1.
[0060] Step S309: Add to the validation set. That is, the current state list can be used as the "input" field, and the "input" field and the "output" field can be concatenated as an "input-output" pair in the validation set.
[0061] Step S310: event is the next event in the event log, and return to step S303.
[0062] Step S311: Output the validation set.
[0063] For example, such as Figure 4 As shown, the working principle of the embodiments of this application will be described below with a specific example.
[0064] Step S401: Input the validation set and the candidate device set.
[0065] Step S402: Randomly generate a set of candidate condition trees.
[0066] Step S403: Use the validation set to test the fitness of the candidate condition tree.
[0067] Step S404: Determine if the fitness score is 0. If it is 0, proceed to step S409; otherwise, proceed to step S405.
[0068] Step S405: Determine whether the number of iterations is greater than the threshold. If it is greater than the threshold, proceed to step S410; otherwise, proceed to step S406.
[0069] Step S406: Sort the candidate conditions in descending order of their scores and select the top n candidate conditions as the "parents" of the next generation.
[0070] Step S407: Swap the subtrees of the two condition trees in the parent tree with a certain probability.
[0071] Step S408: Mutate the new condition tree with a certain probability and return to step S403.
[0072] Step S409: Output the condition for a fitness score of 0.
[0073] Step S410: Output that the target device does not exist for this state transition.
[0074] The IoT automation rule deduction and representation method proposed in this application can establish a validation set from the event logs of heterogeneous IoT systems. Different candidate conditions are generated and evolved in the form of a condition tree expression until they meet the validation set, resulting in a condition expression tree that generates the validation set. This allows the deduced automation rules to be represented as state transitions in a finite state machine, effectively applicable to security scenarios such as model verification and dynamic simulation. This makes the IoT automation rule deduction and representation method widely applicable, robust, and easy to operate. Therefore, it solves the problem that related technologies all assume that automation rules are open-source and directly obtainable, which is somewhat idealistic. Furthermore, the robustness and applicability of related static analysis techniques are low, failing to meet the needs of security researchers.
[0075] Next, with reference to the accompanying drawings, the IoT automation rule deduction and representation apparatus proposed according to the embodiments of this application is described.
[0076] Figure 5 This is a block diagram of an IoT automated rule deduction and representation device according to an embodiment of this application.
[0077] like Figure 5As shown, the IoT automated rule deduction and representation device 10 includes: a creation module 100, a generation module 200, and a representation module 300.
[0078] Specifically, module 100 is established to create a verification set from the event logs of heterogeneous IoT systems.
[0079] The generation module 200 is used to generate and evolve different candidate conditions in the form of a condition tree expression until they meet the validation set, thus obtaining a condition expression tree that meets the validation set.
[0080] The representation module 300 is used to represent the inferred automation rules as state transitions in a finite state machine based on the conditional representation tree that meets the validation set.
[0081] Optionally, in one embodiment of this application, the establishment module 100 includes a traversal unit and an acquisition unit.
[0082] The traversal unit is used to traverse the event log, maintain a state list, and record the state changes of candidate devices.
[0083] The acquisition unit is used to set the value of the output field according to the specific state change when traversing the state change events of the target device, and use the corresponding state list as the input field. The input field and the output field are concatenated to obtain the input-output pair in the verification set.
[0084] Optionally, in one embodiment of this application, generating and evolving different candidate conditions in the form of a condition tree expression includes, based on the condition tree expression of branch nodes composed of logical connectors and terminal nodes composed of different sub-conditions, representing a sub-condition as a logical expression that a certain device should satisfy a certain state, and further dividing the terminal condition node into a device node, a logical operator node and a state value node.
[0085] Optionally, in one embodiment of this application, the generation module 200 includes a generation unit.
[0086] The generation unit is used to randomly generate initial candidate conditions in the form of a condition tree expression and continuously iterate and evolve. In each generation, it calculates the fitness of the current candidate condition on the validation set and selects the candidate condition whose fitness reaches the preset condition as the parent of the next generation. It performs crossover and mutation operations on the parent's condition expression tree with a preset probability to generate a condition expression tree that meets the validation set as the state transition condition of the target device.
[0087] Optionally, in one embodiment of this application, the representation module 300 includes: a representation unit.
[0088] The representation unit is used to represent the state space of a device as a finite state machine and to represent the inferred conditions that conform to the verification set as the conditions for a device state transition.
[0089] It should be noted that the foregoing explanation of the embodiment of the IoT automated rule deduction and representation method also applies to the IoT automated rule deduction and representation device of this embodiment, and will not be repeated here.
[0090] The IoT automation rule deduction and representation device proposed in this application can establish a validation set from the event logs of heterogeneous IoT systems, generate and evolve different candidate conditions in the form of condition tree expressions until they meet the validation set, and obtain a condition expression tree that generates the validation set. This allows the deduced automation rules to be represented as state transitions in a finite state machine, effectively applicable to security scenarios such as model verification and dynamic simulation. This makes the IoT automation rule deduction and representation widely applicable, robust, and easy to operate. Therefore, it solves the problem that related technologies all assume that automation rules are open-source and directly obtainable, which is rather idealistic, and that the robustness and applicability of related static analysis techniques are low, failing to meet the needs of security researchers.
[0091] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:
[0092] The memory 601, the processor 602, and the computer program stored on the memory 601 and capable of running on the processor 602.
[0093] When the processor 602 executes the program, it implements the IoT automation rule deduction and representation method provided in the above embodiments.
[0094] Furthermore, electronic devices also include:
[0095] Communication interface 603 is used for communication between memory 601 and processor 602.
[0096] The memory 601 is used to store computer programs that can run on the processor 602.
[0097] The memory 601 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0098] If the memory 601, processor 602, and communication interface 603 are implemented independently, then the communication interface 603, memory 601, and processor 602 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0099] Optionally, in a specific implementation, if the memory 601, processor 602, and communication interface 603 are integrated on a single chip, then the memory 601, processor 602, and communication interface 603 can communicate with each other through an internal interface.
[0100] The processor 602 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0101] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for deducing and representing automated rules for the Internet of Things.
[0102] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0103] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0104] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0105] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0106] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0107] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0108] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0109] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. An Internet of Things automation rule inference and representation method, characterized by, The method comprises the following steps: establishing a verification set from a heterogeneous IoT system event log; generating and evolving different candidate conditions in the form of conditional tree expressions until the verification set is met, and generating a conditional expression tree meeting the verification set; and representing the inferred automation rule as a state transition in a finite state machine based on the conditional expression tree meeting the verification set; wherein the generating and evolving of different candidate conditions in the form of conditional tree expressions comprises: representing a sub-condition as a logical expression that a certain device should meet a certain state based on the conditional tree expression of branch nodes composed of logical conjunction words and terminal nodes composed of different sub-conditions, and further dividing the terminal condition node into a device node, a logical operator node and a state value node; the generating and evolving of different candidate conditions in the form of conditional tree expressions until the verification set is met, and generating a conditional expression tree meeting the verification set, comprises: randomly generating an initial candidate condition in the form of the conditional tree expression and continuously iterating and evolving, in each generation, calculating the fitness of the current candidate condition on the verification set, and selecting the candidate condition whose fitness meets the preset condition as the parent of the next generation, and performing crossover and mutation operations on the parent's conditional expression tree with a preset probability to generate a conditional expression tree meeting the verification set as the target device state transition condition.
2. The method of claim 1, wherein, The establishing of a verification set from a heterogeneous IoT system event log comprises: traversing the event log and maintaining a state list to record the state changes of candidate devices; when traversing the state change events of the target device, setting the value of the output domain according to the specific state change, and taking the corresponding state list as the input domain, splicing the input domain and the output domain to obtain the input-output pair in the verification set.
3. The method of claim 1, wherein, The representing of the inferred automation rule as a state transition in a finite state machine comprises: representing the state space of a device as a finite state machine, and representing the inferred condition meeting the verification set as a condition when a device state transitions.
4. An Internet of Things automation rules inference and representation apparatus, characterized by, It comprises: a establishing module for establishing a verification set from a heterogeneous IoT system event log; a generating module for generating and evolving different candidate conditions in the form of conditional tree expressions until the verification set is met, and generating a conditional expression tree meeting the verification set; and a representing module for representing the inferred automation rule as a state transition in a finite state machine based on the conditional expression tree meeting the verification set; wherein the generating and evolving of different candidate conditions in the form of conditional tree expressions comprises, based on the conditional tree expression of branch nodes composed of logical conjunction words and terminal nodes composed of different sub-conditions, representing a sub-condition as a logical expression that a certain device should meet a certain state, and further dividing the terminal condition node into a device node, a logical operator node and a state value node; the generating module comprises: The generating unit is configured to randomly generate an initial candidate condition in the form of the conditional tree expression and iteratively evolve the initial candidate condition, calculate, in each generation, an adaptation degree of a current candidate condition on the verification set, select a candidate condition with an adaptation degree reaching a preset condition as a parent of a next generation, and perform a cross and mutation operation on a conditional expression tree of the parent with a preset probability to generate a conditional expression tree conforming to the verification set as a target device state transition condition.
5. The apparatus of claim 4, wherein, The establishing module comprises: The traversing unit is configured to traverse the event log and maintain a state list recording state changes of the candidate device; The obtaining unit is configured to set a value of an output domain according to a specific state change when traversing a state change event of the target device, take a corresponding state list as an input domain, splice the input domain and the output domain to obtain an input-output pair in the verification set.
6. An electronic device, comprising: The memory, the processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the Internet of Things automation rule deduction and representation method of any one of claims 1-3. The program is executed by the processor to implement the Internet of Things automation rule deduction and representation method of any one of claims 1-3.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that
Citation Information
Patent Citations
Edge device event rule generation system, device and method for industrial Internet of Things
CN110414021A
Multi-type data access method and device, electronic equipment and readable storage medium
CN113505166A