Home automation control method and device based on complex event processing
By decomposing and analyzing home problems to be solved through complex event processing technology, we build a complex event processing system, which solves the deficiencies of smart home systems in handling complex situations and achieves higher intelligence and personalized control.
Patent Information
- Application Number
- CN202210343887.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-31
AI Technical Summary
Existing smart home systems are insufficient to achieve humanized intelligent control when dealing with complex situations, resulting in the inability to effectively cope with complex scenes in daily life and often requiring human operation assistance.
Use complex event processing technology to decompose household problems to be solved into atomic events, build a complex event processing system, analyze and control through complex event processing engines and rule sets, and use Apache Kafka, Mongo DB, RAPIDE language and other technologies to achieve data transmission, Storage and automatic machine design for real-time monitoring and personalization.
It improves the home's ability to analyze complex situations, reduces human operations, enables personalized customization of user functions, and improves the intelligence level of smart homes.
Smart Images

Figure CN114880134B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automatic control technology, and more specifically, to a home automatic control method and device based on complex event processing. Background Art
[0002] At present, home-related products mainly rely on the logic form of "if something, then execute something" to achieve automatic control. Although it is sufficient to realize the automatic control of some simple scenes, such as turning on the air conditioner in advance when returning home from work, automatically turning on the lights when opening the door, and automatically turning off the lights and drawing the curtains before going to bed, when the situation becomes complicated, such as controlling the switch of the air conditioner or air purifier based on the range of human activities and whether the range is closed, and controlling the switch of the TV based on the judgment that a person enters the area where the sofa is located and stays for a period of time, this simple judgment that only relies on the logic of "if something, then execute something" cannot achieve humanized intelligent control. Moreover, this system that works with "if something, then execute something" often needs to be assisted by mobile phones even in some simple scenes. This is still far from the more humanized smart home life that people expect.
[0003] The key issue that leads to the huge gap between ideal and reality is that the logical analysis methods currently used in the smart home field are not sufficient to cope with the complex situations that often occur in daily life.
[0004] Although complex event processing technology has rarely been used in the field of smart homes, it has strong adaptability to the analysis and processing of complex scenarios. Therefore, applying complex event processing technology to the field of smart homes will open up new development space for the field. Summary of the invention
[0005] In view of the current status of homes, the present invention improves the ability of homes to analyze complex situations and enhances the level of home intelligence by applying complex event processing technology to the field of homes.
[0006] Specifically, the present invention is achieved through the following technical solutions:
[0007] In a first aspect, the present invention provides a home automation control method based on complex event processing, comprising:
[0008] Obtaining unresolved issues of a home, and determining atomic events based on the unresolved issues;
[0009] Constructing a complex event processing rule set and a complex event processing engine for a home, and constructing a complex event processing system based on the complex event processing rule set and the complex event processing engine;
[0010] Using the complex event processing system to process the atomic event and output control information;
[0011] Based on the control information, the home is automatically controlled.
[0012] Furthermore, the complex event processing engine:
[0013] Package the external device data into a YAML string and encrypt it with Base64 and XOR encoding. Use the Apache Kafka middleware to implement data transmission in a publish-subscribe mode with the event name encrypted string as the subject. Use the Mongo DB database to store and record unstructured data.
[0014] Connect to Kafka middleware to subscribe and publish specific topics to analyze and generate events;
[0015] Use UML to build a client-side listening Kafka to achieve real-time monitoring, rule set viewing and personalized customization.
[0016] Furthermore, the complex event processing engine:
[0017] The substructure is designed based on the time automaton designed in RAPIDE language, and constructed by hierarchical analysis according to data characteristics;
[0018] Use hybrid automata to convert data and events;
[0019] Use state recognition automata to extract sensor information;
[0020] Use pattern recognition event processing agent to realize the judgment and selection of home mode from home materialization status and time information;
[0021] Use in-mode and transition control event handling agents to issue control modes to the controller;
[0022] Use the progressive control hybrid automaton to issue control instructions according to the control mode.
[0023] Furthermore, the method for constructing a complex event processing rule set includes:
[0024] Investigate and summarize commonly used furniture, list the optional states of the furniture and the impacts on the home environment caused by different states;
[0025] Using positioning software to track the daily life trajectories of different people, combining professional documents and common sense to decompose the control conditions of controllable devices, the decomposition of the control conditions of controllable devices includes: defining the control of various controllable devices as complex events of different levels and splitting the complex events, disassembling the high-level complex events into a combination of the first-level complex events, until all events are split into atomic events directly obtained by sensors;
[0026] With reference to the splitting process, the atomic events are aggregated upward according to certain rules to obtain all the complex events initially defined, and the aggregation result is the final complex event processing rule set.
[0027] Furthermore, the home automation control method based on complex event processing also includes: a personalized customization method for home user terminals,
[0028] The personalized customization method for the home user terminal includes:
[0029] The sensor location is automatically determined by customizing the location subject and boundary division, as well as the function selection of the room.
[0030] Furthermore, the location entities include: empty areas, doors, windows, walls, available locations, non-available locations and the outside world; and the boundary divisions include: room boundaries, external boundaries and usage area boundaries.
[0031] Furthermore, the home mode includes: no-one mode, partial sleep mode, full sleep mode, normal mode and youth mode; wherein,
[0032] The division between unmanned mode and occupied mode depends on the number of people in the room;
[0033] The occupied mode is divided into sleeping mode and awake mode based on sleep determination;
[0034] Sleep mode is divided into partial sleep mode and full sleep mode according to the number of people;
[0035] The awake mode mapping category is divided into normal mode and youth mode.
[0036] Furthermore, the home automation control method based on complex event processing also includes:
[0037] Use the jump between states to identify the relationship between event content and existence. When entering a new state, the actions required in the state will be executed once, and local variables will be modified. Among them, the jump between states is divided into three categories, which are triggered by specific events, timers and boundary conditions respectively;
[0038] The jump triggered by the specific event can check the causal dependency between events, whether the data parameters and contextual relationship meet expectations, and its jump rules include three parts: pre-jump state, post-jump state and Boolean expression. The Boolean expression can contain two types of parameters: the type of event received and its parameters, and the local variables in EPA, while the event parameters include event source, event ID, timestamp and other information; when a new event is received, the EPA will determine whether the pre-jump state in all the jump rules triggered by the specific event is consistent with the current state. If it is consistent and the Boolean expression in the rule is true, it will jump to the post-jump state, otherwise no operation will be performed; for all jump rules with the same pre-jump state, their Boolean expressions are mutually exclusive and should not be true at the same time;
[0039] The jump triggered by the timer can check whether the time relationship between events meets expectations. Its jump rules include the pre-jump state, post-jump state and elapsed time. Among them, the elapsed time is the length of time after entering the pre-jump state. When the EPA is in a certain state, it will judge whether the pre-jump state in all the timer-triggered jump rules is consistent with the current state. If it is consistent, the timer will be established according to the elapsed time. When the timer ends, the EPA will jump to the specified post-jump state. If the EPA jumps to the state before it ends, all current timers will be closed and will not be executed. For any state, if there are multiple timer-triggered jump rules, the jump rule with a longer elapsed time will never be executed. The pre-jump state of all timer-triggered jump rules in any EPA is different.
[0040] The jump triggered by boundary conditions is mainly used in the EPA at the bottom of the system, which can identify specific atomic events from the system input quantity. The jump triggered by boundary conditions will continuously check whether the input value meets the expected conditions. Its jump rules include three parts: the state before the jump, the state after the jump, and the boundary conditions. Among them, the boundary conditions are Boolean expressions containing two types of variables: local variables in EPA and input values. When the input value is updated, it will check whether the boundary conditions are met. If so, the corresponding jump will be performed.
[0041] For the event consumption mode of a single event processing agent EPA, for each type of event in the system, the system will establish a message queue with the event name as the subject;
[0042] When EPA needs to send a specific type of event, it needs to find the message queue of the corresponding topic according to the event type and publish the event to this message queue;
[0043] When EPA needs to obtain a specific type of event, it needs to subscribe to the message queue of the corresponding topic according to the event type, and read in order from the specified position until it is finished, and then wait for the next event to enter the queue; when the system is started for the first time, the message queue will be cleared, and all subscriptions will start reading from the head of the message queue.
[0044] In a second aspect, the present invention provides a home automation control device based on complex event processing, comprising:
[0045] An atomic event determination unit, which obtains unresolved issues of a home and determines an atomic event based on the unresolved issues;
[0046] A complex event processing system construction unit, which constructs a complex event processing rule set and a complex event processing engine for a home, and constructs a complex event processing system based on the complex event processing rule set and the complex event processing engine;
[0047] A control information output unit, which processes the atomic event using the complex event processing system and outputs control information;
[0048] The automatic control unit automatically controls the home based on the control information.
[0049] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the home automation control method based on complex event processing as described in the first aspect are implemented.
[0050] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the home automation control method based on complex event processing as described in the first aspect.
[0051] The present invention applies complex event processing technology to the home field, decomposes the problems to be solved in the home into atomic events, constructs a complex event processing system, uses the complex event processing system to process the atomic events and output control information, and controls the home based on the control information, thereby improving the home's ability to analyze complex situations, reducing manual operations, achieving personalized customization of user functions, and improving the intelligence level of the home. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 is a flow chart of a home automation control method based on complex event processing according to an embodiment of the present invention;
[0054] Figures 2 to 4 is a schematic diagram of an example of a rule set for a home according to one embodiment of the present invention;
[0055] Figure 5 is a schematic diagram of the structure of a complex event processing system for home use according to an embodiment of the present invention;
[0056] Figure 6 is an example of an automaton with time jumps according to one embodiment of the present invention;
[0057] Figure 7 It is an example of a hybrid automaton model and a general finite state automaton that can jump according to time boundary conditions according to an embodiment of the present invention;
[0058] Figure 8 is a schematic diagram of a home automation control device based on complex event processing according to another embodiment of the present invention;
[0059] Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] Figure 1 FIG. 1 is a flow chart of a home automation control method based on complex event processing according to an embodiment of the present invention. Figure 1 , the method may include the following steps:
[0062] Step 101: Obtaining unresolved issues of a home, and determining atomic events based on the unresolved issues;
[0063] Step 102: construct a complex event processing rule set and a complex event processing engine for the home, and construct a complex event processing system based on the complex event processing rule set and the complex event processing engine;
[0064] Step 103: using the complex event processing system to process the atomic event and output control information;
[0065] Step 104: Automatically control the home based on the control information.
[0066] Specifically, in this embodiment, it should be noted that in step 101, the problem to be solved in the home (i.e., complex problem) can be obtained, and then the complex problem can be decomposed into simple and solvable problems (i.e., atomic events). For example, when the problem to be solved is "whether to turn on or off the light", whether to turn on or off the light can be decomposed into atomic events such as "delay", "which room", and "whether lighting is needed"; "which room" can be determined by a human body sensor to sense whether there is someone; "whether lighting is needed" can be determined by a light sensor to sense the light intensity.
[0067] In step 102, a complex event processing rule set for the home can be constructed. The method for constructing the rule set includes: investigating and summarizing commonly used home appliances (for example, turning on and off lights, turning on and off air conditioners, turning on and off televisions, turning on and off air purifiers, etc.), listing the optional states of the home appliances and the impacts on the home environment caused by different states; using positioning software to track the daily life trajectories of different people, combining professional documents and common sense to decompose the control conditions of controllable devices, that is, defining the control of various controllable devices as complex events of different levels and splitting the complex events, and breaking down high-level complex events into combinations of first-level complex events until all events are split into atomic events directly obtained by sensors; referring to the splitting process, the atomic events are aggregated upward according to certain rules to obtain all the complex events initially defined, and the aggregation result is the final complex event processing rule set. Figures 2 to 4 is an example of a complex event processing rule set for a home according to the present invention. The lighting condition judgment rule is as follows: Figure 2 As shown. The result of this rule is the event 1 / 5 lighting condition, and the value may be normal or too dark. The rule judgment process includes two states: normal room lighting (state 1) and too dark room lighting (state 2). When the lighting ≥ 160Lx, state 2 jumps to state 1 and executes the process in state 1 to generate a lighting condition / normal event. Similarly, when the lighting ≤ 50Lx, state 1 jumps to state 2 and executes the process in state 2 to generate a lighting condition / too dark event. For another example, taking "air quality judgment" as an example, the air quality judgment rule is as follows: Figure 3As shown. The result of this rule is event 1 / 6 air quality, which may be assigned a value of poor or good. The rule judgment process includes two states: high PM2.5 value in the living room (state 1) and low PM2.5 value in the living room (state 2). When the PM2.5 value ≥ 75μg / L appears, state 2 jumps to state 1 and executes the process in state 1 to generate the event of air quality / good. The same applies to state 1 jumping to state 2. The adjustment rule of "room humidity" is as follows Figure 4 As shown, the process is similar to the above and will not be repeated here.
[0068] Figure 5 As shown in the figure, it is the overall structure of the designed home automation control system based on complex event processing. It obtains data from the controller sensor through Kafka, realizes the conversion between continuous data and discrete events through hybrid automata, accesses the complex event processing (CEP) rule set, and infers the state of other entities in the real environment through the state recognition of the sensor, and then matches the home mode to run different mode and transition switching rule sets. For the home mode, we believe that there are five modes that need to be controlled separately, namely, unmanned mode, partial sleep mode, full sleep mode, normal mode and youth mode. The mode segmentation is shown in the figure, and the details are implemented by time automata.
[0069] For the construction of rule sets, we can first build a rule set in a single-person environment, mainly based on sensors as components, and use the signal information that the sensor can directly generate as atomic events, that is, the most basic events, and generate complex events through the continuous aggregation of atomic events to achieve response to environmental changes and control of terminal devices.
[0070] Based on the rule set for a single-person environment, we further introduced the logic of regional space judgment and used thermal sensors to replace Xiaomi's human body sensors to implement the rule set for a multi-person environment.
[0071] Whether there are people in a specific area is an important intermediate event to determine whether many devices are started. Through thermal sensors, the movement direction of human bodies near important boundaries can be obtained, and the increase and decrease of the number of people in adjacent areas can be judged at the same time, so as to achieve the purpose of monitoring the number of people and provide information on whether there are people in the area. However, for many functional devices, specific number of people information is not necessary. The simple information of whether there are people can meet the control needs. At the same time, complex number of people information will add unnecessary burden to the aggregation of complex events, resulting in complex and redundant rule sets and a large number of unnecessary states in the automaton. By observing and comparing the needs of different functional devices for regional information, the regions are classified into multiple levels according to the inclusion relationship, the number of people in the regions is recorded separately, and the information on whether there are people is generated separately, so as to reduce the mutual interference between regions and reduce the negative impact of the number of people information.
[0072] Based on the above theoretical foundation, we add and improve the rule set in the single-person environment to obtain the rule set in the multi-person environment. Finally, based on the above two rule sets, we implement the rule judgment system. The rule judgment system refers to the rule set processing engine, which is part of the complex event processing system and the logic processing core of the rules.
[0073] Then, in step 102, a complex event processing engine may be further constructed, and a complex event processing system may be constructed based on the complex event processing rule set and the complex event processing engine.
[0074] In particular, the construction process of the complex event processing engine is as follows:
[0075] Two types of automaton models are mainly used for event pattern matching and building CEP system structures for smart homes, namely, hybrid automaton models with output and finite state automaton models with output and time jumps. Among them, the former is mainly used to match and output atomic events contained in various continuous quantities in the hybrid system of home, while the latter is mainly used to match complex events with higher information density contained in other discrete quantities and events. Next, the automaton state transition diagram will be used to prove the equivalence between the automaton structure with time jumps used in this article and the existing automaton model.
[0076] Figure 6 This is an example of an automaton with time jumps, which can receive three types of external events, X, Y, and Z, in sequence to jump to other states. Among them, the jump from state 1 to state 2 is a time jump, that is, when the time spent in state 1 exceeds the waiting time (waitTime), state 1 will automatically jump to state 2.
[0077] This example is equivalent to a parallel structure combining a general finite state automaton model with a small hybrid automaton model. Figure 7 (1) is a hybrid automaton model that can jump according to time boundary conditions. The events it receives and sends only come from the ordinary finite state automaton shown in the left figure it serves. Its function is to trigger and examine the time boundary when there is a time jump in the current state of the main state machine until the waiting time is reached or the main state jump signal is received. When it is in the non-trigger state (Wait), it can receive Wait type events to jump to the trigger state (Trigger), and update the time boundary condition to the current time plus the waiting time (waitTime); when it is in the trigger state (Trigger), it can receive StateChange type events to jump back to the non-trigger state (Wait). If not received, consider whether the current timestamp meets the set boundary conditions, that is, exceeds the predetermined waiting time (Now>T). If exceeded, it jumps to the generation state (Gnerate) to generate TimeJump type events, and finally returns to the non-trigger state.
[0078] like Figure 7 (2) is a common finite state automaton. In each state, except for the three types of events X, Y, and Z, other events are only sent and received to the hybrid automaton on the right. When the state of the automaton changes, a StateChange event is generated. When the next jump involves a time jump (such as state 1), a Wait type event is generated with a wait time parameter, which puts the attached hybrid automaton in a triggered state. When event X is received within the wait time, it jumps directly to state 3 and puts the attached hybrid automaton in a non-triggered state. Otherwise, it receives a TimeJump type event and jumps to state 2.
[0079] This structure allows time jumps to occur normally. Time jumps can be performed without transforming the main automaton into a hybrid automaton model. The main automaton does not need to inspect the time boundary in real time, which reduces the difficulty of implementation and improves the operating efficiency of the main automaton. It allows the above-mentioned automaton model with time jumps to run normally. In actual experiments, the time jump condition plays a great role in simplifying the expression of automata and simplifying logic.
[0080] Then, the expression of the rule set was unified. The RAPIDE language was abstracted into a diagram, combined with some special expressions of UML, making the rule set easier to understand and more representative, combining the advantages of both. We have created EPN production molds, EPA production molds and Vsio-RAPIDE definition libraries.
[0081] When a specific event pattern appears, it indicates that the system state has changed. Use event pattern matching to promote state switching and execute corresponding state reactions. Many state machine switching models have similar or identical local features. We extract them and form fixed patterns to facilitate pattern reuse and simplify the thinking process.
[0082] When building the model, time and space issues are also taken into consideration. On the one hand, many models involve the influence of historical events. On the other hand, some systems do not exist as points, but have an inherent spatial structure. For the time issue, we discuss the discussion of the time sequence of point events by splitting the continuous events into start events and end events through event segmentation. For the space issue, since most of the data collected by the sensor is point data, point events are generated. We need to use a dispersed set of point events to determine the scope of the entire system event, and use the relationship of intersection and separation of range events in space to clarify the existence significance of these areas and generate a representation method for the state machine. The point events are upgraded in dimension, and the point events are digitized through numerical correspondence and numerical range division. The point events are connected into a plane or space through the most effective interpolation method to approximate the unknown area. Using regional perception, we can get a contour plane map that knows the state of each area, and can use various functions to fit the boundaries of range events to answer questions such as whether the range events intersect and where the intersection area is. After the above construction, the state machine will no longer operate in a single state, but will operate separately and independently. The generation of each atomic event will trigger the change of the EPA of the entire layered structure, change the boundary function corresponding to each state machine, and ensure that the state machine can only control the control equipment in the corresponding area, realizing the aggregation of event space relations. At the same time, due to the uncertainty of the control area, all control instructions are no longer directly controlling the underlying equipment, but are passed to a specific EPA to uniformly realize the control of a class of equipment.
[0083] The complex event processing engine can package the external device data into a YAML string and encrypt it with Base64 and XOR encoding. It uses the Apache Kafka middleware to implement data transmission in a publish-subscribe mode with the event name encrypted string as the subject, and uses the Mongo DB database to implement storage and record of unstructured data. It can connect to the Kafka middleware to subscribe and publish specific topics to implement event analysis and generation. It can use UML to build a user-side listening Kafka to implement real-time monitoring, rule set viewing and personalized customization.
[0084] In addition, the complex event processing engine can design substructures based on the time automaton designed in the RAPIDE language, and construct hierarchical analysis based on data characteristics; it can use hybrid automata to convert between data and events; it can use state recognition automata to extract sensor information; it can use pattern recognition event processing agents to realize the judgment and selection from the home materialization state and time information to the home mode; it can use in-mode and transition control event processing agents to issue control modes to the controller; and it can use progressive control hybrid automata to issue control instructions according to the control mode. The home mode includes unmanned mode, partial sleep mode, full sleep mode, normal mode and youth mode, and the division between unmanned mode and occupant mode depends on the number of people in the house; the occupant mode is divided into sleep mode and awake mode based on sleep judgment; the sleep mode is divided into partial sleep mode and full sleep mode according to the number of people; the awake mode is divided into normal mode and youth mode according to the mapping category.
[0085] Based on complex event processing engine and rule set, it can form Figure 5 The complex event processing system shown.
[0086] In step 103, the complex event processing system can be used to process the atomic event and output control information. Specifically, taking "whether to turn on or off the light" as an example, the lighting condition judgment rule is as follows: Figure 2 As shown. The result of this rule is the event 1 / 5 lighting condition, and the value may be normal or too dark. The rule judgment process includes two states: normal room lighting (state 1) and too dark room lighting (state 2). When the lighting ≥ 160Lx, state 2 jumps to state 1 and executes the process in state 1 to generate a lighting condition / normal event. Similarly, when the lighting ≤ 50Lx, state 1 jumps to state 2 and executes the process in state 2 to generate a lighting condition / too dark event. For another example, taking "air quality judgment" as an example, the air quality judgment rule is as follows: Figure 3 As shown. The result of this rule is event 1 / 6 air quality, which may be assigned a value of poor or good. The rule judgment process includes two states: high PM2.5 value in the living room (state 1) and low PM2.5 value in the living room (state 2). When the PM2.5 value ≥ 75μg / L appears, state 2 jumps to state 1 and executes the process in state 1 to generate the event of air quality / good. The same applies to state 1 jumping to state 2. For the adjustment of "room humidity", the process is similar to the above and will not be repeated here.
[0087] In step 104, the home may be automatically controlled based on the control information. For example, the brightness of the lamp may be automatically increased according to the light being too dark event.
[0088] In addition, according to the present invention, the home user terminal can be customized, and the customization method includes: automatically determining the sensor location by customizing the location subject and boundary division, and the function selection of the room, so as to provide a sensor installation plan. The location subject includes: empty area, door, window, wall, stayable location, non-stayable location and outside world; the boundary division includes: room boundary, external boundary and use area boundary.
[0089] In addition, according to the home automation control method based on complex event processing of the present invention, the jump between states can be used to identify the event content and the relationship between existence, and when entering a new state, the action required to be executed in the state will be executed once, and the local variables will be modified; wherein, the jump between states is divided into three categories, which are triggered by specific events, timers and boundary conditions respectively; the jump triggered by the specific event can check whether the causal dependency between events, data parameters and contextual relationships meet expectations, and its jump rules include three parts: pre-jump state, post-jump state and Boolean expression, and the parameters that the Boolean expression can contain are the type of the received event and its parameters, and the local variables in a single event processing agent (EPA, i.e., the automaton described in this article), and the event parameters include event source, event ID, timestamp and other information; when a new event is received, the EPA will judge one by one whether the pre-jump state in the jump rules triggered by all specific events is consistent with the current state, if it is consistent and the Boolean expression in the rule is true, It will jump to the post-jump state, otherwise no operation will be performed; for all jump rules with the same pre-jump state, their Boolean expressions are mutually exclusive and should not be established at the same time; the jump triggered by the timer can check whether the time relationship between events meets expectations, and its jump rules include pre-jump state, post-jump state and elapsed time, among which the elapsed time is the length of time after entering the pre-jump state; when the EPA is in a certain state, it will judge one by one whether the pre-jump state in all the timer-triggered jump rules is consistent with the current state. If it is consistent, a timer will be established according to the elapsed time; when the timer ends, the EPA will jump to the specified post-jump state. If the EPA jumps to a state before it ends, all current timers will be closed and no longer executed; for any state, if there are multiple timer-triggered jump rules, the jump rule with a longer elapsed time will never be executed; the pre-jump state of all timer-triggered jump rules in any EPA is different.
[0090] The jump triggered by boundary conditions is mainly used in the EPA at the bottom of the system, which can identify specific atomic events from the system input quantity; the jump triggered by boundary conditions will continuously check whether the input value meets the expected conditions, and its jump rules include three parts: pre-jump state, post-jump state and boundary conditions; among them, the boundary condition is a Boolean expression containing two types of variables: local variables in EPA and input values; when the input value is updated, it will check whether the boundary condition is established, and if so, a corresponding jump will be made; for the event consumption method of a single event processing agent EPA, for each type of event in the system, the system will establish a message queue with the event name as the subject; when EPA needs to send a specific type of event, it needs to find the message queue of the corresponding subject according to the event type, and publish the event to this message queue; when EPA needs to obtain a specific type of event, it needs to subscribe to the message queue of the corresponding subject according to the event type, and read in order from the specified position until it is finished, and then wait for the next event to enter the queue; when the system is started for the first time, the message queue will be cleared, and all subscriptions will start reading from the head of the message queue.
[0091] Experimental verification plan: The experiment includes three main devices, namely 3D simulation equipment, microcomputer terminal and mobile terminal. The 3D simulation equipment is used to simulate the real home environment, generate a large amount of sensor and controller data, verify the robustness of the complex event processing (CEP) rule set, test the concurrency of the event processing agent (EPA) in the complex event processing system, and dynamically generate 3D home models through configuration files to simulate a variety of home environments. The microcomputer terminal is used to build the complex event processing engine (EPN) operating environment (including Zookeeper, Kafka and python operating environment, etc.), connect to the home Internet of Things, and is used to load, run and maintain the complex event processing rule set. Its interface is universal and can be copied through the system image to achieve mass production of the home complex event processing system. The mobile terminal uses the Win10 tablet environment, loads the designed smart home system user terminal, and exchanges data with the other two ends through the Internet, allowing users to monitor the home environment in real time and customize the complex event processing engine.
[0092] The advantage of using this structure for experiments is that it has a complete control end and user end, the simulation device can simulate different home scenes, a large number of trial run experiments can be carried out, and random experiments can also be used to verify the robustness of the rule set, thereby improving development and debugging efficiency.
[0093] According to the above experimental ideas, we finally used Visual Python to develop the 3D home simulation environment system, used Kafka and Zookeeper to connect the simulation environment to build the CEP engine in the python environment, and used SVG and other H5, JS visualization tools to develop mobile programs on Win10 tablets. At present, we have completed the development of the overall complex event processing engine and most of the smart home simulation scenarios, and realized the construction of most non-modal home complex event processing rule sets and used them to conduct verification experiments on the built systems.
[0094] The development of CEP engine environment and extensions includes:
[0095] Kafka and message queues make it possible to transmit information with large amounts of multi-threaded data. First, they can achieve buffering and peak shaving. That is, when there is a burst of traffic in the upstream data, the downstream may not be able to handle it, or there are not enough machines in the downstream to ensure redundancy. Kafka can act as a buffer in the middle, temporarily storing the message in Kafka, and the downstream service can slowly process it at its own pace. Secondly, decoupling and scalability are achieved: at the beginning of the project, the specific requirements cannot be determined. The message queue can be used as an interface layer to decouple important business processes. You only need to abide by the agreement and program the data to obtain the expansion capability. Secondly, avoid redundancy, that is, you can adopt a one-to-many approach. A producer publishes a message, which can be consumed by multiple services that subscribe to the topic and used by multiple unrelated businesses. Secondly, robustness. The message queue can accumulate requests, so even if the consumer-side business dies for a short time, it will not affect the normal operation of the main business. Secondly, asynchronous communication. In many cases, users do not want or need to process messages immediately. The message queue provides an asynchronous processing mechanism that allows users to put a message into the queue, but not process it immediately. Put as many messages as you want into the queue, and then process them when needed.
[0096] In the scenario of smart home, we need to process various kinds of messages. Considering that using Kafka to implement the subscription sending and receiving mechanism has the following advantages: it has the functions of message publishing and subscription, similar to message queues or enterprise messaging systems; it can store message streams and has fault tolerance; it can process messages in real time; first introduce Kafka's message classification method, messages are divided into topics: messages in Kafka are classified by topic, producers are responsible for sending messages to specific topics, and consumers are responsible for subscribing to topics for consumption; there are also partitions: topics can be divided into multiple partitions, and a partition belongs to only a single topic; different partitions under the same topic contain different messages (that is, messages sent to a topic are specifically sent to a certain partition); when a message is appended to a partition log file, it will be assigned a specific offset, which is the unique identifier of the message in the partition. Kafka uses it to ensure the order of messages in the partition, and the offset does not cross partitions, that is, Kafka guarantees the order of partitions rather than topics.
[0097] Secondly, for Qt, every QObject object and all widgets in PyQt that inherit from QWidget (these are all sub-objects of QObject) support the signal and slot mechanism. When a signal is emitted, the connected slot function will be automatically executed. In PyQt 5, signals and slots are connected through the object.signal.connect() method. There are many built-in signals in the PyQt window control class, and developers can also add custom signals. Signals and slots have the following characteristics.
[0098] We let Kafka topics correspond to the execution types in CEP, partitions correspond to the event types in CEP, and finally use Kafka to process the data.
[0099] We distribute according to yaml information, classify, receive and distribute according to name. All event structures are strings written in YAML format. When an event occurs, a yanl file is automatically generated. The yaml is encrypted, accepted by Kafka, and enters the CEP system. We use python to directly read the yaml sent and received by Kafka, convert it into a list and dict, and give a PyQt5 QSignal signal to remind when receiving yaml.
[0100] In the actual operation process, we added more functions to Kafka, including control signals for the middleware, such as clearing the queue, starting, saving message queue information and stopping, etc. So far, we have designed a class that implements the interface of publishing event yaml strings, receiving event yaml strings (needs to send QSignal signals to slot functions), clearing queues, starting according to given message queue information, saving message queue information, and Kafka connection and parallel processing issues.
[0101] During the design process, we also noticed some details. We made the insertion of the same field not roll back, but return directly so that the process would not be interrupted; even_id was used as the primary key and unique index to avoid ambiguity; considering that consumers only need to receive events, when receiving them, the main program should be informed that it has received them. Our interface is programmed in pyqt5, so QSignal signals are used for triggering. The producer and consumer are packaged into classes, and the __init__() method is used to initialize it based on various Kafka connection parameters. The producer class needs to have a production function that only accepts one parameter - the class of the event. The consumer class needs to have a consumer function and a Qsignal signal. When an event is received, it can be pushed into the queue and taken out through the consumer function. Events need to be recorded only when they are generated. Receiving records is meaningless. The CEP processing of the database is based on historical records. The received event is the event yaml string of that specific event type. Since our automaton is in trigger receiving mode and is consuming, historical events are not required.
[0102] Based on this, the main process of Kafka was designed, namely: sending data -> Kafka listening data -> storing a record in MySQL, there is EPA publishing, EPA subscription, and then some subscribed EPA did not receive the information. Clearing the queue means clearing the Kafka message queue, right? The substructure of EPN built by CEP technology has these functions and packages them into threads to save time for the main program.
[0103] We first configure the event interface, making all event structures strings written in YAML format, and create an Event file to construct events, defining multiple information such as event name, event ID, EPA name for event creation, status, method, process name, timestamp source, and end event stamp. Then use EventManager.yaml to manage the YAML file. First, use certain rules to encrypt the file information; second, define information such as generating and receiving events.
[0104] Considering the convenience of starting Kafka and MongoDB, we defined the cmdRunner class in DependencyManager.py to help Windows run cmd commands. There are also functions similar to _mongoDBConnect to connect to the MongoDB database, and _importKafka to start Zookeeper and Kafka dependencies in sequence.
[0105] Next is the part of setting up EPN. First, we set up the StartUP read directory and the EPA thread dictionary. Then we start the EPA. Then we use Executor.py to push the command to a specific EPA. All the EPA operation information will be stored in the Message.py file.
[0106] The development of 3D home scenes includes:
[0107] The 3D home environment simulation is mainly divided into three parts, namely room structure modeling, sensor controller modeling and home activity modeling, to simulate the home environment and transmit the data generated by the simulation to the complex event processing engine through Kafka. At the same time, Kafka can receive data from the complex event processing engine to achieve control.
[0108] The room structure modeling module reads the floor plan of a home similar to the one shown below, and by identifying the colors on the picture, establishes eight types of location entities (empty space, door, window, wall, place to stay, place to sleep, place not to stay, outside, room boundary, external boundary, use area boundary) to achieve modeling. The reason why it is divided into the above eight categories is that the intelligent control of the home through complex event technology is constrained by rule sets, and the rule set mainly uses multiple human body sensors to judge the range and the action trigger of other sensors to complete pattern recognition. Therefore, the specific furniture can be abstracted and replaced by various ranges, that is, the empty space, place to stay, place to sleep, place not to stay, outside, room boundary, external boundary, use area boundary mentioned here, and the wall is separated because of its immutability, and the door and window are separated because of their variable isolation.
[0109] The sensor controller modeling module uses the YAML language to write config files to configure the sensor and controller names, locations, names of generated events, and other properties.
[0110] For home activity modeling, we analyzed people's daily activities and summarized three types of activities, namely, stillness, controlling home smart devices and movement. The most difficult to simulate is the movement mode. Levy flight is the most consistent with the animal movement pattern, but in home activities, the specified distance of random direction movement conforming to the power law distribution is limited by the room structure and sometimes cannot provide enough movable range. Therefore, in this case, the Pareto distribution with α of 2.5 is used to simulate the movement distance. The A* algorithm is an algorithm for calculating the shortest path between two points in a two-dimensional plane, which can simulate most purposeful movement situations. Therefore, based on the above two algorithms, Brownian motion is used to make up for the movement situations that are not taken into account, and people's daily activities are simulated to the maximum extent. Finally, while is used to extend the time dimension. Finally, home activity modeling is achieved.
[0111] The home activity modeling module uses YAML language configuration to achieve multiple modes of action and simulation of triggered activities. The modes of action mainly include controlling movement by importing real movement data, controlling movement by mouse and keyboard, and controlling movement by instructions. Among them, controlling movement by instructions is shown in the figure below, stay means staying still, RamdomMove means random walk in the form of Brownian motion, DirectMove means moving from a specified position to a specified position and using the A* algorithm to obtain a path, Operating means controller switch control, and ParetoMove means random walk in the form of Levy flight.
[0112] Finally, use 3dsMAX to build the obj model, and use visual Python to build a 3D visualization model to complete the visualization of the scene.
[0113] The execution unit that can realize event aggregation is also called EPA, which is the object responsible for event pattern matching in the system. It receives specific atomic events and complex events, checks whether the causal dependencies, time relationships, data parameters and context relationships between events meet the predetermined rules, changes the local variables that reflect their status, and performs corresponding actions based on the judgment results. Actions can be passing events, creating events and interacting with the target system.
[0114] This engine uses automaton technology to build EPA, uses state jumps to identify event content and existing relationships, and when entering a new state, it will execute the actions required in the state and modify local variables. Among them, state jumps are divided into three categories, which are triggered by specific events, timers, and boundary conditions.
[0115] The jump triggered by a specific event can check the causal dependency between events, whether the data parameters and contextual relationship meet expectations. Its jump rules include three parts: pre-jump state, post-jump state and Boolean expression. The Boolean expression can contain two types of parameters: the type of event received and its parameters, and the local variables in the EPA. The event parameters include the source of the event, the event ID, timestamp and other information. When a new event is received, the EPA will determine whether the pre-jump state in all the jump rules triggered by the specific event is consistent with the current state. If it is consistent and the Boolean expression in the rule is true, it will jump to the post-jump state. Otherwise, no operation will be performed. For all jump rules with the same pre-jump state, their Boolean expressions are mutually exclusive and should not be true at the same time.
[0116] The jump triggered by the timer can check whether the time relationship between events is as expected. Its jump rules include the pre-jump state, post-jump state and elapsed time. The elapsed time is the length of time after entering the pre-jump state. When the EPA is in a certain state, it will judge whether the pre-jump state in all the timer-triggered jump rules is consistent with the current state. If it is consistent, the timer will be established according to the elapsed time. When the timer ends, the EPA will jump to the specified post-jump state. If the EPA jumps to the state before it ends, all current timers will be closed and no longer executed. For any state, if there are multiple timer-triggered jump rules, the jump rule with a longer elapsed time will never be executed. Therefore, in the specific implementation, the pre-jump state of all timer-triggered jump rules in any EPA is different.
[0117] The jump triggered by boundary conditions is mainly used in the EPA at the bottom of the system, and can identify specific atomic events from the system input. The jump triggered by boundary conditions will continuously check whether the input value meets the expected conditions. Its jump rules include three parts: the state before the jump, the state after the jump, and the boundary conditions. Among them, the boundary condition is a Boolean expression containing two types of variables: local variables in the EPA and input values. When the input value is updated, it will check whether the boundary condition is met. If it is met, the corresponding jump will be performed.
[0118] When EPA jumps to the next state, it will execute the set of actions required to be executed in the state. Among them, the actions include modifying local variables using the event information just received, generating new events, and executing specific instructions.
[0119] Figure 88 is a schematic diagram of a home automation control device based on complex event processing according to another embodiment of the present invention. As shown in FIG8 , the home automation control device based on complex event processing includes an atomic event determination unit 801, a complex event processing system construction unit 802, a control information output unit 803, and an automatic control unit 804. Since the home automation control device based on complex event processing provided by the embodiment of the present invention can be used to execute the home automation control method based on complex event processing described in the above embodiment, its working principle and beneficial effects are similar, so they will not be described in detail here. For specific contents, please refer to the introduction of the above embodiment.
[0120] In this embodiment, it should be noted that the various units in the device of the embodiment of the present invention can be integrated into one or deployed separately. The above units can be combined into one unit or further divided into multiple sub-units.
[0121] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, see Fig. 9 , the electronic device specifically includes the following contents: a processor 901, a memory 902, a communication interface 903 and a communication bus 904;
[0122] The processor 901, the memory 902, and the communication interface 903 communicate with each other via the communication bus 904;
[0123] The processor 901 is used to call the computer program in the memory 902. When the processor executes the computer program, all steps of the above-mentioned home automatic control method based on complex event processing are implemented. For example, when the processor executes the computer program, the following process is implemented: obtaining the unresolved problems of the home, and determining atomic events based on the unresolved problems; building a complex event processing rule set and a complex event processing engine for the home, and building a complex event processing system based on the complex event processing rule set and the complex event processing engine; using the complex event processing system to process the atomic events and output control information; based on the control information, automatically controlling the home.
[0124] It can be understood that the detailed functions and extended functions that can be executed by the computer program can refer to the description of the above embodiments.
[0125] Based on the same inventive concept, another embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, all steps of the above-mentioned home automatic control method based on complex event processing are implemented. For example, when the processor executes the computer program, the following process is implemented: obtaining unresolved problems of the home, and determining atomic events based on the unresolved problems; constructing a complex event processing rule set and a complex event processing engine for the home, and constructing a complex event processing system based on the complex event processing rule set and the complex event processing engine; using the complex event processing system to process the atomic events and output control information; and automatically controlling the home based on the control information.
[0126] It can be understood that the detailed functions and extended functions that can be executed by the computer program can refer to the description of the above embodiments.
[0127] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0128] The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. Those of ordinary skill in the art may understand and implement them without creative work.
[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the home automation control method based on complex event processing described in each embodiment or some parts of the embodiment.
[0130] In addition, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0131] In addition, in the present invention, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A home automation control method based on complex event processing, characterized in that: include: Obtaining unresolved issues of a home, and determining atomic events based on the unresolved issues; Constructing a complex event processing rule set and a complex event processing engine for a home, and constructing the complex event processing system based on the complex event processing rule set and the complex event processing engine; Using the complex event processing system to process the atomic event and output control information; Based on the control information, automatically control the home; Wherein, the complex event processing engine: Package the external device data into a YAML string and encrypt it with Base64 and XOR encoding. Use the Apache Kafka middleware to implement data transmission in a publish-subscribe mode with the event name encrypted string as the subject. Use the Mongo DB database to store and record unstructured data. Connect to Kafka middleware to subscribe and publish specific topics to analyze and generate events; Use UML to build a client-side listening Kafka to achieve real-time monitoring, rule set viewing and personalized customization; and Wherein, the complex event processing engine: Based on the time automaton structure designed in RAPIDE language, the rule set is constructed by hierarchical analysis according to data and logic characteristics; Use hybrid automata to convert between data and events; Use state recognition automata to extract sensor information; Use the pattern recognition event processing agent to judge and select the home mode based on the home status and time information; Use in-mode and transition control event handling agents to issue control modes to the controller; Use the progressive control hybrid automaton to issue control instructions according to the control mode.
2. The home automation control method based on complex event processing according to claim 1, characterized in that: The method for constructing a complex event processing rule set for a home comprises: Investigate and summarize commonly used furniture, list the optional states of the furniture and the impacts on the home environment caused by different states; Using positioning software to track the daily life trajectories of different people, combining professional documents and common sense to decompose the control conditions of controllable devices, the decomposition of the control conditions of controllable devices includes: defining the control of various controllable devices as complex events of different levels and splitting the complex events, disassembling the high-level complex events into a combination of the first-level complex events, until all events are split into atomic events directly obtained by sensors; With reference to the splitting process, the atomic events are aggregated upward according to certain rules to obtain all the complex events initially defined, and the aggregation result is the final complex event processing rule set.
3. The home automation control method based on complex event processing according to claim 1, characterized in that: include: A personalized customization method for a home user terminal, the personalized customization method for a home user terminal comprising: Automatically determine the sensor location by customizing the location subject and boundary division, as well as the function selection of the room.
4. The home automation control method based on complex event processing according to claim 3 is characterized in that: The location entities include: empty areas, doors, windows, walls, available locations, non-available locations and the outside world; the boundary divisions include: room boundaries, external boundaries and usage area boundaries.
5. The home automation control method based on complex event processing according to claim 1, characterized in that: The home modes include: no-person mode, partial sleep mode, full sleep mode, normal mode and youth mode; The division between unmanned mode and occupied mode depends on the number of people in the room; The occupied mode is divided into sleeping mode and awake mode based on sleep determination; Sleeping patterns are divided into partial sleeping patterns and full sleeping patterns according to the number of people; The awake mode mapping category is divided into normal mode and youth mode.
6. The home automation control method based on complex event processing according to claim 1, characterized in that: include: Use the jump between states to identify the relationship between event content and existence. When entering a new state, the actions required in the state will be executed once, and local variables will be modified. Among them, the jump between states is divided into three categories, which are triggered by specific events, timers and boundary conditions respectively; The jump triggered by the specific event can check the causal dependency between events, whether the data parameters and contextual relationship meet expectations, and its jump rules include three parts: pre-jump state, post-jump state and Boolean expression. The Boolean expression can contain two types of parameters: the type of event received and its parameters, and the local variables in EPA, while the event parameters include the event source, the event ID, and the timestamp information. When a new event is received, the EPA will determine whether the pre-jump state in all the jump rules triggered by the specific event is consistent with the current state. If it is consistent and the Boolean expression in the rule is true, it will jump to the post-jump state, otherwise no operation will be performed. For all jump rules with the same pre-jump state, their Boolean expressions are mutually exclusive and should not be true at the same time. The jump triggered by the timer can check whether the time relationship between events meets expectations. Its jump rules include the pre-jump state, post-jump state and elapsed time. Among them, the elapsed time is the length of time after entering the pre-jump state. When the EPA is in a certain state, it will judge whether the pre-jump state in all the timer-triggered jump rules is consistent with the current state. If it is consistent, the timer will be established according to the elapsed time. When the timer ends, the EPA will jump to the specified post-jump state. If the EPA jumps to the state before it ends, all current timers will be closed and will not be executed. For any state, if there are multiple timer-triggered jump rules, the jump rule with a longer elapsed time will never be executed. The pre-jump state of all timer-triggered jump rules in any EPA is different. The jump triggered by boundary conditions is mainly used in the EPA at the bottom of the system to identify specific atomic events from the system input. The jump triggered by boundary conditions will continuously check whether the input value meets the expected conditions. Its jump rules include three parts: the state before the jump, the state after the jump, and the boundary conditions. Among them, the boundary conditions are Boolean expressions containing two types of variables: local variables in EPA and input values. When the input value is updated, it will check whether the boundary conditions are met. If so, the corresponding jump will be performed. For the event consumption mode of a single event processing agent EPA, for each type of event in the system, the system will establish a message queue with the event name as the subject; When EPA needs to send a specific type of event, it needs to find the message queue of the corresponding topic according to the event type and publish the event to this message queue; When EPA needs to obtain a specific type of event, it needs to subscribe to the message queue of the corresponding topic according to the event type, and read in order from the specified position until it is finished, and then wait for the next event to enter the queue; when the system is started for the first time, the message queue will be cleared, and all subscriptions will start reading from the head of the message queue.
7. A home automation control device based on complex event processing, characterized in that: include: An atomic event determination unit, which obtains unresolved issues of a home and determines an atomic event based on the unresolved issues; A complex event processing system construction unit, which constructs a complex event processing rule set and a complex event processing engine for a home, and constructs a complex event processing system based on the complex event processing rule set and the complex event processing engine; A control information output unit, which processes the atomic event using the complex event processing system and outputs control information; An automatic control unit automatically controls the home based on the control information. The complex event processing engine: Package the external device data into a YAML string and encrypt it with Base64 and XOR encoding. Use the Apache Kafka middleware to implement data transmission in a publish-subscribe mode with the event name encrypted string as the subject. Use the Mongo DB database to store and record unstructured data. Connect to Kafka middleware to subscribe and publish specific topics to analyze and generate events; Use UML to build a user-side listening Kafka to achieve real-time monitoring, rule set viewing and personalized customization; and The complex event processing engine: Based on the time automaton structure designed in RAPIDE language, the rule set is constructed by hierarchical analysis according to data and logic characteristics; Use hybrid automata to convert between data and events; Use state recognition automata to extract sensor information; Use the pattern recognition event processing agent to judge and select the home mode based on the home status and time information; Use in-mode and transition control event handling agents to issue control modes to the controller; Use the progressive control hybrid automaton to issue control instructions according to the control mode.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the home automation control method based on complex event processing as described in any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the home automation control method based on complex event processing as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Power environment monitoring method and system based on complex event processing engine
CN110347663A
Greenhouse automatic control method and system based on complex event processing
CN111736492A
Complex event processing system and method based on edge computing for Internet of Things
CN112653749A
Method and system for complex event processing
US20080109824A1
