Internet of Things rule engine agent adaptive decision execution method and related equipment
By using fine-tuned large language models in IoT devices for situational awareness and rule matching, the decision accuracy and adaptability of the IoT rule engine in unknown environments is solved, and more accurate and flexible decision execution is achieved.
Patent Information
- Application Number
- CN202411614469.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2024-12-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the existing IoT rule engine faces changes in unknown environments and scenarios, it is difficult for the applicable business rules to match, resulting in poor decision-making accuracy and environmental applicability.
By determining real-time information of IoT devices, using fine-tuned large language models for scenario awareness, identifying scenario demand patterns, and matching target rulesets in a pre-built rule base, performing decisions, and optimizing rulebases and decision algorithms based on feedback results .
It improves the decision-making responsiveness and decision-making accuracy of the IoT platform in various environments, and enhances the flexibility of the environmental adaptability and rule base.
Smart Images

Figure CN119149917A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a method for adaptive decision execution of an Internet of Things rule engine intelligent agent and related equipment. Background Art
[0002] With the development of IoT technology, IoT platforms have been widely used in various fields. IoT rule engine is one of the core functional systems of IoT platform, which can process and execute rules based on events and data in IoT platform. In simple terms, it can analyze, process and make decisions on the data generated by IoT devices according to pre-set rules, so that the system can automatically respond to preset conditions without human intervention.
[0003] At present, the IoT rule engine mainly implements the decision-making process based on pre-set rules, that is, various business rules are defined in advance in the IoT rule engine, and the trigger conditions of each type of business rule are configured according to the known device operation scenarios. During the operation of the system, it is determined whether the relevant working data of the IoT device meets the trigger conditions of each business rule. If the relevant data of the IoT device meets a certain trigger condition, the business rule corresponding to the trigger condition is used as the current matching business rule, and business decisions are made based on the business rule.
[0004] In actual application scenarios, the operating environment of IoT devices is usually very complex, and the environment and scenarios of the IoT may change unexpectedly. The triggering conditions of business rules are usually set by staff based on known operating scenarios with fixed thresholds. Based on the processing method of the existing IoT rule engine, when the working environment and scenarios change significantly, it is difficult to match the applicable business rules, and it is also impossible to execute matching business decisions, resulting in poor environmental applicability, scenario responsiveness and decision-making accuracy of the IoT platform. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method for adaptive decision execution of an Internet of Things rule engine intelligent agent to improve the working mechanism of the existing Internet of Things rule engine. When unknown environments and scenarios appear, it is difficult to achieve scenario matching of rules and it is impossible to execute corresponding business decisions, resulting in poor environmental applicability and decision accuracy of the Internet of Things platform.
[0006] The embodiment of the present invention also provides a device for adaptive decision execution of an Internet of Things rule engine intelligent agent to ensure the actual implementation and application of the above method.
[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0008] A method for adaptive decision execution of an Internet of Things rule engine agent, comprising:
[0009] Determine real-time information corresponding to the IoT device; the real-time information includes environmental data, device status data, and user behavior data;
[0010] Based on a preset situational awareness model, the real-time information is situationally fused and perceived to obtain situational awareness information; the situational awareness model is a model obtained by fine-tuning a large language model;
[0011] Determining a situational demand pattern based on the situational awareness information;
[0012] According to the scenario demand model, a target rule set is determined in a pre-built rule base; the rule base includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule base;
[0013] Based on the target rule set and the preset decision algorithm, determine the target decision, and execute the action corresponding to the target decision;
[0014] receiving an execution feedback result corresponding to the action, and judging whether the rule base or the decision algorithm needs to be optimized based on the execution feedback result;
[0015] If the rule base or the decision algorithm needs to be optimized, an optimization object is determined in the rule base and the decision algorithm, and the optimization object is optimized according to the execution feedback result.
[0016] In the above method, optionally, performing situational fusion perception on the real-time information based on a preset situational perception model to obtain situational perception information includes:
[0017] Performing data cleaning on the real-time information, and using the real-time information after data cleaning as information to be processed;
[0018] Performing data preprocessing on the information to be processed, and using the preprocessed information to be processed as information to be fused;
[0019] According to a preset data fusion strategy, data fusion is performed on the information to be fused, and the information obtained by the data fusion is used as the information to be analyzed;
[0020] Inputting the information to be analyzed into the situation awareness model, allowing the situation awareness model to perform context situation awareness, and obtaining the situation content output by the situation awareness model;
[0021] The situational content is used as the situational awareness information.
[0022] In the above method, optionally, determining the situational demand mode based on the situational awareness information includes:
[0023] Determine the scene information corresponding to each preset scene mode;
[0024] Determining, from each of the context information, target context information that matches the context awareness information;
[0025] The preset scenario mode corresponding to the target scenario information is used as the scenario requirement mode.
[0026] In the above method, optionally, determining a target rule set in a pre-built rule library based on the scenario demand model includes:
[0027] Determining the scenario mode associated with each business rule in the rule base according to the pre-established mapping relationship between the mode and the rule;
[0028] According to the scenario patterns associated with the business rules, in the rule base, determining the business rules associated with the scenario demand patterns;
[0029] The target rule set is composed of various business rules associated with the scenario demand pattern.
[0030] In the above method, optionally, determining a target rule set in a pre-built rule library based on the scenario demand model includes:
[0031] Applying a preset rule prediction model, in the rule base, predicting the business rules associated with the scenario demand pattern; the rule prediction model is a model obtained by performing knowledge cognition enhancement on a large language model based on a preset user private domain knowledge base and prompt engineering;
[0032] The target rule set is composed of the business rules predicted by the rule prediction model.
[0033] In the above method, optionally, determining the target decision based on the target rule set and a preset decision algorithm includes:
[0034] For each business rule in the target rule set, determining configuration data corresponding to the business rule, the configuration data including a rule association relationship and a rule priority corresponding to the business rule;
[0035] Based on the configuration data corresponding to each business rule in the target rule set, applying the decision algorithm to determine the application order corresponding to each business rule in the target rule set;
[0036] Determine each action event corresponding to the target rule set;
[0037] Based on the application order corresponding to each of the business rules and each of the action events, an action decision corresponding to the target rule set is generated, and the action decision is used as the target decision.
[0038] In the above method, optionally, the process of constructing the rule base includes:
[0039] Setting an initial rule set; the initial rule set includes a plurality of initial business rules;
[0040] Setting configuration information corresponding to each of the initial business rules; the configuration information corresponding to each of the initial business rules includes a rule category, a rule level, a rule association relationship, and a rule priority corresponding to the initial business rule;
[0041] In the debugging state, based on the preset simulated business scenario and the configuration information corresponding to each of the initial business rules, the initial rule set is tested to obtain the execution test result of the initial rule set;
[0042] According to a preset rule conflict detection algorithm, conflict detection is performed on the initial rule set to obtain a conflict detection result corresponding to the initial rule set;
[0043] Based on the execution test result and the conflict detection result, the initial rule set is optimized to obtain each business rule that has undergone rule optimization, and the rule base is composed of each business rule that has undergone rule optimization.
[0044] A device for adaptive decision execution of an Internet of Things rule engine intelligent agent, comprising:
[0045] A first determining unit, configured to determine real-time information corresponding to an IoT device; the real-time information includes environmental data, device status data, and user behavior data;
[0046] A context perception unit, configured to perform context fusion perception on the real-time information based on a preset context perception model to obtain context perception information; the context perception model is a model obtained by fine-tuning a large language model;
[0047] A second determining unit, configured to determine a scenario demand mode based on the scenario perception information;
[0048] A third determining unit is used to determine a target rule set in a pre-built rule base according to the scenario demand model; the rule base includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule base;
[0049] A fourth determination unit, configured to determine a target decision based on the target rule set and a preset decision algorithm, and execute an action corresponding to the target decision;
[0050] A feedback receiving unit, configured to receive an execution feedback result corresponding to the action, and determine whether the rule base or the decision algorithm needs to be optimized based on the execution feedback result;
[0051] The feedback optimization unit is used to determine an optimization object in the rule base and the decision algorithm if the rule base or the decision algorithm needs to be optimized, and optimize the optimization object according to the execution feedback result.
[0052] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the method for adaptive decision execution of an Internet of Things rule engine intelligent agent as described above.
[0053] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors as the above-mentioned method for adaptive decision execution of an Internet of Things rule engine intelligent agent.
[0054] Based on the above-mentioned embodiment of the present invention, a method for adaptive decision execution of an Internet of Things rule engine intelligent agent includes: determining real-time information corresponding to an Internet of Things device, including environmental data, device status data, and user behavior data; based on a preset scenario perception model, performing scenario fusion perception on the real-time information to obtain scenario perception information; the scenario perception model is a model obtained by fine-tuning a large language model; based on the scenario perception information, determining a scenario demand pattern; according to the scenario demand pattern, determining a target rule set in a pre-built rule library; the rule library includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule library; based on the target rule set and a preset decision algorithm, determining a target decision, and executing an action corresponding to the target decision; receiving corresponding execution feedback results, and judging whether the rule library or decision algorithm needs to be optimized based on the execution feedback results; if the rule library or decision algorithm needs to be optimized, then in the rule library and the decision algorithm, determining the optimization object, and optimizing the optimization object according to the execution feedback results. Applying the method provided by the embodiment of the present invention, the Internet of Things rule engine can be run as an intelligent agent, and a scenario perception model obtained by fine-tuning a large language model is deployed. In the decision-making process, multi-source real-time data related to the device operating environment and scenarios can be obtained, so that the scenario perception model can perform fusion perception of scenario information based on various real-time data, so as to identify the current scenario demand pattern through the scenario information obtained by fusion perception, match business rules using the scenario demand pattern, and then make decisions based on the matched business rules. Regardless of whether the relevant data of the IoT device in the current environment is known state data, the fusion perception capability of the scenario perception model can be used to identify the scenario demand pattern and complete the matching of business rules, which is conducive to making accurate decisions in various environments, improving the decision-making response capability for various scenarios, and improving the environmental adaptability of the IoT platform. Secondly, in the operation process of the IoT rule engine intelligent body, after executing the action corresponding to the decision, the execution feedback result can be received, and the decision-making mechanism of the business rules in the rule base or the decision algorithm can be optimized and adjusted according to the execution feedback result, so that the rule base and decision algorithm can be flexibly adapted to the actual scenario, which is conducive to further improving the environmental adaptability and decision-making accuracy of the IoT platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0056] Figure 1A method flow chart of a method for adaptive decision execution of an Internet of Things rule engine agent provided by an embodiment of the present invention;
[0057] Figure 2 A schematic diagram of a functional architecture of an IoT rule engine agent and its management platform provided by an embodiment of the present invention;
[0058] Figure 3 A schematic diagram of an IoT rule engine agent construction and management process provided by an embodiment of the present invention;
[0059] Figure 4 A schematic diagram of the operation process of an Internet of Things rule engine agent provided by an embodiment of the present invention;
[0060] Figure 5 A schematic diagram of the structure of a device for adaptive decision execution of an Internet of Things rule engine agent provided by an embodiment of the present invention;
[0061] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0063] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising 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, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0064] The embodiment of the present invention provides a method for adaptive decision execution of an IoT rule engine agent. The method can be applied to a rule engine of an IoT device management platform, and the execution subject can be an IoT device management platform. The method flow chart of the method is as follows: Figure 1 As shown, including:
[0065] S101: Determine real-time information corresponding to an IoT device; the real-time information includes environmental data, device status data, and user behavior data;
[0066] The method provided in the embodiment of the present invention is applied to the Internet of Things rule engine intelligent agent. The intelligent agent refers to a software entity or system that can perceive the environment and take autonomous actions to achieve specific goals. In the embodiment of the present invention, a large language model is fine-tuned, a scenario perception model is designed, and an Internet of Things rule engine intelligent agent is constructed based on the scenario perception model and the rule base. The Internet of Things rule engine intelligent agent can be deployed on the local server or edge device of the Internet of Things platform, so that the Internet of Things rule engine intelligent agent can perform real-time analysis on the data generated by the Internet of Things devices according to the environment, scenario information and preset business rules, and then make corresponding decisions.
[0067] In the method provided by the embodiment of the present invention, the rule engine agent (i.e., the IoT rule engine agent) can obtain multi-source data related to the current scenario and environment through sensor data collection, device data collection, and calling third-party interfaces, which can specifically include real-time environmental data, device status data, and user behavior data. Environmental data includes data such as temperature, humidity, and light, device status data includes data such as device operating status and fault information, and user behavior data includes data such as user operating habits and usage time. The specific data type to be obtained can be selected according to the actual application scenario. The rule engine agent can use the multi-source data obtained in real time as real-time information corresponding to the IoT device.
[0068] S102: Based on a preset situational awareness model, performing situational fusion awareness on the real-time information to obtain situational awareness information; the situational awareness model is a model obtained by fine-tuning a large language model;
[0069] In the method provided by the embodiment of the present invention, a scenario-aware model obtained by fine-tuning a large language model is deployed in the rule engine agent. The large language model (LLM) is also called a large language model. The model can be fine-tuned on the basis of the existing large language model so that the model can learn the ability to perform context fusion perception based on multi-source scenario data, and the fine-tuned large language model is used as a scenario-aware model. The rule engine agent can apply the scenario-aware model to perform scenario fusion perception on real-time information. For example, the scenario-aware model is used to analyze the corresponding environmental data, device status data and user behavior data. The scenario-aware model can identify and output the current time, location, user identity, user activity, weather forecast and other scenario data through the context fusion perception of the corresponding data. For example, by fusing data such as temperature, light, and personnel activities, it can be identified whether there is a scenario demand such as turning on or adjusting lighting. The scenario data output by the scenario-aware model through the scenario fusion perception of real-time information is used as scenario-aware information.
[0070] S103: Determine a scenario demand mode based on the scenario perception information;
[0071] In the method provided by the embodiment of the present invention, the rule engine agent can match the scenario mode associated with the current scenario perception information in various pre-set scenario modes according to the scenario data fused and perceived in the scenario perception information in a predetermined pattern matching manner, and use the scenario mode as the scenario demand mode. The specific preset scenario modes can be set according to the actual application scenario. For example, in the smart home scenario, the preset scenario modes can include the lighting scheme of the lighting system, the cooling mode of the air conditioning system, and the like.
[0072] In actual application scenarios, situational awareness information can also serve as the data basis for other applications, such as equipment failure prediction, etc.
[0073] S104: Determine a target rule set in a pre-built rule base according to the scenario demand model; the rule base includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule base;
[0074] In the method provided by the embodiment of the present invention, each business rule can be designed in advance according to actual application requirements, and the rule content of each business rule can be set. At the same time, configuration information such as the priority of each business rule can be set, and the rule base is composed of each pre-set business rule. The rule content of the business rule usually includes a condition part and an action part. The condition part is usually one or more conditional expressions, and the action part usually defines the operation to be performed when the condition is met. For example, the rule "If the temperature is higher than 30°C and the humidity is greater than 60%, start air conditioning refrigeration" has "temperature higher than 30°C and humidity greater than 60%" as the condition part and "start air conditioning refrigeration" as the action part.
[0075] The rule engine agent can obtain business rules that match the current scenario demand pattern in the rule library according to the preset rule matching method and based on the scenario demand pattern, and the target rule set is composed of the business rules matched by the current scenario demand pattern. The specific rule matching method can be designed according to actual needs. For example, rule matching can be performed by pre-establishing a mapping relationship, by analyzing the rule content, by a machine learning algorithm, or by other methods, which will not affect the function of the method provided in the embodiment of the present invention.
[0076] S105: Determine a target decision based on the target rule set and a preset decision algorithm, and execute an action corresponding to the target decision;
[0077] In the method provided by the embodiment of the present invention, the rule engine agent can apply the decision algorithm to perform rule analysis on each business rule in the target business rule set, determine the logical association of each business rule and the triggered action events and action execution order, generate corresponding decisions, and use the decisions generated by the application of the decision algorithm as the target decision. The decision algorithm can be set based on conditional judgment, or it can be set based on algorithms such as machine learning models. For example, it can be set according to the decision strategy of various scenario modes, such as pre-setting the logical association and event triggering strategy corresponding to various scenario modes, and the various business rules in the target business rule set can be combined and applied according to the pre-set logical association and event triggering strategy, and then generate a decision. The decision algorithm can also be set based on a machine learning model, that is, pre-training a decision model based on deep learning, processing each business rule in the target business rule set through the decision model, and outputting the corresponding decision.
[0078] The rule engine agent can trigger corresponding action events according to the target decision to perform corresponding actions, such as controlling equipment, sending notifications, starting other business processes, etc. The rule engine agent is equipped with an error handling mechanism. During the execution of the action, the action execution can be monitored in real time, and emergency handling can be performed in the event of execution errors. For example, for the operation of controlling the device, if the device cannot be successfully controlled, the error log can be recorded and the operation can be tried again or other remedial measures can be taken.
[0079] S106: receiving an execution feedback result corresponding to the action, and judging whether the rule base or the decision algorithm needs to be optimized based on the execution feedback result;
[0080] In the method provided by the embodiment of the present invention, after the rule engine agent performs an action according to the target decision, it can receive feedback information about the execution of the action, that is, the execution feedback result. The rule engine agent can evaluate the effectiveness of the decision execution based on the feedback data in the execution feedback result, that is, evaluate whether the execution effect of the decision meets expectations. Specifically, the evaluation can be performed by comparing the actual results with the expected goals, analyzing the changes in performance indicators, etc. For example, if the purpose of the target decision is to reduce energy consumption, the effect of the decision can be evaluated by comparing the energy consumption data before and after execution. According to the evaluation results of the effectiveness of the decision execution, it is determined whether the rule base or decision algorithm needs to be optimized. If the evaluation results indicate that the execution effect of the target decision meets expectations, then it is considered that there is no need to optimize the rule base or decision algorithm. If the evaluation results indicate that the execution effect of the target decision does not meet expectations, then it is considered that the rule base or decision algorithm needs to be optimized.
[0081] S107: If the rule base or the decision algorithm needs to be optimized, an optimization object is determined in the rule base and the decision algorithm, and the optimization object is optimized according to the execution feedback result.
[0082] In the method provided by the embodiment of the present invention, when it is determined that the rule base or decision algorithm needs to be optimized, the rule engine agent can analyze the execution feedback results, identify whether the reason why the execution effect does not meet expectations is the business rules or the decision algorithm, and determine the optimization object in the rule base and the decision algorithm. The optimization object can be a business rule in the rule base, or a decision algorithm, or can include both business rules and decision algorithms. The rule engine agent can optimize and adjust the corresponding data of the optimization object according to the preset optimization method. If the optimization object is a business rule, then the operation of optimizing the optimization object can specifically modify the condition content, action content or priority configuration data of the specified business rule. If the optimization object is a decision algorithm, then the operation of optimizing the optimization object can specifically adjust the algorithm parameters, modify the decision process or introduce new decision factors. The preset optimization method can be to send the execution feedback results to the designated staff, and the staff can modify the corresponding business rule content or decision algorithm content according to the execution feedback results by deploying plug-ins or configuration files. It is also possible to optimize the rule base or decision algorithm by deploying automated optimization algorithms. For example, you can pre-build a machine learning model for object optimization, analyze the execution feedback results through the machine learning model, formulate corresponding optimization plans, and perform corresponding optimization operations according to the optimization plan output by the machine learning model.
[0083] For example, if the optimization object is a business rule, through analysis, it is found that there are problems with the conditional part of the rule. For example, the rule of the intelligent lighting system is to turn on the light when the light intensity is lower than a certain threshold, but in actual application, it is found that the threshold setting is inaccurate, resulting in frequent mis-turning of the light or failure to turn on in time. Based on the analysis of feedback data, the rule engine agent can automatically adjust the threshold of light intensity to better adapt to the actual environment. For another example, if the optimization object is a decision algorithm, if a fault prediction model based on a machine learning algorithm is applied in the decision algorithm, the rule engine agent can evaluate the model performance by comparing the actual fault occurrence of the equipment with the model prediction results. If the model performance does not meet the requirements, the weight parameters and learning rate in the machine learning algorithm can be automatically adjusted to improve the prediction accuracy of the model.
[0084] In the method provided by the embodiment of the present invention, after completing the optimization operation on the optimization object, the rule engine intelligent agent can verify and test the optimized business rules or decision algorithms in a simulated business scenario to determine whether the adjustment of the rules or algorithms is effective.
[0085] In the method provided by the embodiment of the present invention, the rule engine agent can also send real-time information and execution feedback results to the cloud server, so that the cloud server can store the real-time information and execution feedback results, so that the staff can optimize the rule base through the cloud server. The staff can send the updated rule base to the rule engine agent through the cloud server. When the rule engine agent receives the rule update instruction sent by the cloud server, it can update its local rule base according to the currently sent rule base.
[0086] Based on the method provided by the embodiment of the present invention, during the operation of the rule engine intelligent body, the real-time information corresponding to the IoT device can be determined, including environmental data, device status data and user behavior data; based on the preset scenario perception model, the real-time information is scenario fusion perceived to obtain scenario perception information; the scenario perception model is a model obtained by fine-tuning a large language model; based on the scenario perception information, the scenario demand mode is determined; according to the scenario demand mode, in the pre-built rule library, the target rule set is determined; the rule library includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule library; based on the target rule set and the preset decision algorithm, the target decision is determined, and the action corresponding to the target decision is executed; the corresponding execution feedback result is received, and based on the execution feedback result, it is determined whether the rule library or the decision algorithm needs to be optimized; if the rule library or the decision algorithm needs to be optimized, the optimization object is determined in the rule library and the decision algorithm, and the optimization object is optimized according to the execution feedback result. Applying the method provided by the embodiment of the present invention, the IoT rule engine can be operated as an intelligent body, and a scenario perception model obtained by fine-tuning a large language model is deployed. In the decision-making process, multi-source real-time data related to the device operating environment and scenarios can be obtained, so that the scenario perception model can perform fusion perception of scenario information based on various real-time data, so as to identify the current scenario demand pattern through the scenario information obtained by fusion perception, match business rules using the scenario demand pattern, and then make decisions based on the matched business rules. Regardless of whether the relevant data of the IoT device in the current environment is known state data, the fusion perception capability of the scenario perception model can be used to identify the scenario demand pattern and complete the matching of business rules, which is conducive to making accurate decisions in various environments, improving the decision-making response capability for various scenarios, and improving the environmental adaptability of the IoT platform. Secondly, in the operation process of the IoT rule engine intelligent body, after executing the action corresponding to the decision, the execution feedback result can be received, and the decision-making mechanism of the business rules in the rule base or the decision algorithm can be optimized and adjusted according to the execution feedback result, so that the rule base and decision algorithm can be flexibly adapted to the actual scenario, which is conducive to further improving the environmental adaptability and decision-making accuracy of the IoT platform.
[0087] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of performing situation fusion perception on the real-time information based on the preset situation perception model and obtaining situation perception information mentioned in step S102 includes:
[0088] Performing data cleaning on the real-time information, and using the real-time information after data cleaning as information to be processed;
[0089] In the method provided in an embodiment of the present invention, data cleaning can be performed on multi-source data in real-time information through statistical analysis methods, filtering algorithms, etc., such as removing noise, outliers and erroneous data. For example, sensor data that obviously deviates from the normal range can be identified and eliminated through statistical analysis methods, and the data obtained after data cleaning of the data in the real-time information is used as information to be processed.
[0090] Performing data preprocessing on the information to be processed, and using the preprocessed information to be processed as information to be fused;
[0091] In the method provided in the embodiment of the present invention, data preprocessing operations can be performed on the information to be processed according to a preset data preprocessing method, which can specifically include data completion, format conversion, and feature extraction. For example, missing values are supplemented for multi-source data in the information to be processed, such as making reasonable estimates based on historical data or other relevant data, and filling data with estimated data. For the data that has been processed for missing value supplementation, format conversion is performed to convert the data into a unified format to ensure data consistency. After the format conversion process, the data preprocessing process is deemed to be completed, and the format-converted data is used as the information to be fused.
[0092] According to a preset data fusion strategy, data fusion is performed on the information to be fused, and the information obtained by the data fusion is used as the information to be analyzed;
[0093] In the method provided by the embodiment of the present invention, data fusion can be performed on the multi-source data in the fusion information according to the pre-set data fusion strategy. For example, for multi-source data representing the same physical quantity, the weighted average method can be used for data fusion, and the fused data can be used as a feature data. For multi-source data with dynamic change characteristics, the Kalman filter method can be used to predict the data, and fuzzy logic processing can be used to fuse the multi-source data, etc. After the data fusion strategy is applied to the data to be fused in the fusion information, key features that can characterize the scene can be extracted from the data, such as extracting features representing environmental comfort from temperature and humidity data, extracting features of equipment health status from equipment operation status data, etc. These features can be numerical (such as mean value, standard deviation, etc.) or discrete (such as equipment operation mode, fault type, etc.), and the extracted feature data is used as information obtained by data fusion, that is, information to be analyzed.
[0094] Inputting the information to be analyzed into the situation awareness model, allowing the situation awareness model to perform context situation awareness, and obtaining the situation content output by the situation awareness model;
[0095] The situational content is used as the situational awareness information.
[0096] In the method provided by the embodiment of the present invention, each feature data in the information to be analyzed can be used as input data of the situational awareness model, and the situational awareness model is guided to perform contextual situational awareness based on the information to be analyzed, and the perceived situational content is output, and the situational content is used as situational awareness information. For example, the situational awareness model performs contextual fusion perception of the temperature, humidity and light characteristics in the environmental data and the characteristics of the user being at home / not at home in the user behavior data, and can identify whether the current environment conforms to the user's living habits, whether the device operation status needs to be adjusted, and other situational contents.
[0097] Based on the method provided in the embodiment of the present invention, the scenario data from multiple sources can be fused by means of data fusion, which is beneficial to improving the accuracy of feature data and further improving the accuracy of scenario perception.
[0098] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of determining the situational demand mode based on the situational awareness information mentioned in step S103 includes:
[0099] Determine the scene information corresponding to each preset scene mode;
[0100] In the method provided by the embodiment of the present invention, each scenario mode, i.e., each preset scenario mode, can be set in advance according to actual needs, and the scenario information corresponding to each preset scenario mode is defined. The scenario information corresponding to the preset scenario mode is the scenario content matched by the preset scenario mode, such as the temperature adjustment mode, and its corresponding scenario information may include the user being at home, at night, and the current ambient temperature not being consistent with the user's habits. The rule engine agent can obtain the scenario information corresponding to each preset scenario mode from the pre-configured data.
[0101] Determining, from each of the context information, target context information that matches the context awareness information;
[0102] The preset scenario mode corresponding to the target scenario information is used as the scenario requirement mode.
[0103] In the method provided by the embodiment of the present invention, the situational awareness information can be matched with the situational information corresponding to each preset situational mode respectively, the situational information matching the situational awareness information is used as the target situational information, and the preset situational mode corresponding to the target situational information is used as the current situational demand mode.
[0104] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of determining the target rule set in the pre-built rule library according to the scenario demand model mentioned in step S104 includes:
[0105] Determining the scenario mode associated with each business rule in the rule base according to the pre-established mapping relationship between the mode and the rule;
[0106] In the method provided by the embodiment of the present invention, the mapping relationship between each preset scenario mode and each business rule in the rule base (i.e., the mapping relationship between the mode and the rule) can be pre-established according to actual needs. The mapping relationship can be determined by the functional requirements of the corresponding scenario mode and the conditional actions of the business rules. For example, for the inventory management mode, it may be associated with business rules such as business rules for inventory threshold control and business rules for inventory counting cycles, and the mapping relationship between the inventory management mode and these business rules can be established. The rule engine agent can determine the scenario mode associated with each business rule in the rule base according to the pre-established mapping relationship between the mode and the rule.
[0107] When establishing an association relationship between business rules and scenario patterns, the association can usually be established based on condition matching, function matching, and multiple rule combinations. The association method based on condition matching is to match the scenario requirement characteristics of each scenario pattern with the condition part of each business rule. If the scenario requirement characteristics of the scenario pattern match the condition part of the business rule, then an association relationship between the scenario pattern and the business rule is established. The association method based on function matching is to associate the functional classification of the business rule with the goal of the scenario pattern. If the requirement of the scenario pattern is to ensure the safety of the device, then an association relationship is established between the scenario pattern and the business rules of the security rule category. The association method based on multiple rule combinations is that for scenario patterns with more complex scenario requirements, a rule combination formed by multiple business rules is configured in advance based on the collaborative relationship between the various business rules, and an association relationship between the rule combination and the scenario pattern is established.
[0108] According to the scenario patterns associated with the business rules, in the rule base, determining the business rules associated with the scenario demand patterns;
[0109] The target rule set is composed of various business rules associated with the scenario demand pattern.
[0110] In the method provided by the embodiment of the present invention, a business rule matching a scenario demand pattern can be found in the rule library through pattern matching. Specifically, for each business rule, the scenario pattern associated with the business rule can be matched with the current scenario demand pattern. If the scenario pattern associated with the business rule matches the current scenario demand pattern, the business rule is used as the business rule associated with the current scenario demand pattern. The business rules associated with the scenario demand pattern form a target rule set.
[0111] Based on the method provided by the embodiment of the present invention, rule matching can be achieved by pre-establishing a mapping relationship between scenario patterns and business rules. Users can adjust the mapping relationship according to actual needs and flexibly change the business rules for matching various scenario patterns.
[0112] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of determining the target rule set in the pre-built rule library according to the scenario demand model mentioned in step S104 includes:
[0113] Applying a preset rule prediction model, in the rule base, predicting the business rules associated with the scenario demand pattern; the rule prediction model is a model obtained by performing knowledge cognition enhancement on a large language model based on a preset user private domain knowledge base and prompt engineering;
[0114] The target rule set is composed of the business rules predicted by the rule prediction model.
[0115] In the method provided by the embodiment of the present invention, the knowledge cognition of the large language model is enhanced in advance according to the preset user private domain knowledge base and prompt engineering technology, so that the model can identify the business rules associated with the corresponding scenario in the rule base based on the user private domain knowledge. For example, a corresponding knowledge graph can be constructed in advance based on the user's knowledge of the device usage habits, in which the nodes can represent entities such as devices, users, and time, and the edges represent the relationship between entities, which is used to record the user's usage habits, such as "user-after 10 o'clock in the evening-do not want-living room TV-turn on", and the semantic mapping relationship between the knowledge in the user's private domain knowledge base and the business rules in the rule base can be analyzed through natural language processing technology. Based on the semantic mapping relationship, the user's private domain knowledge base and the business rules in the rule base, the knowledge cognition of the large language model is optimized through the prompt of the prompt engineering, and the model's knowledge mastery of the user's private domain knowledge base and the rule base is enhanced, so that the model can combine the user's private domain knowledge to identify the business rules matched by the current scenario, and the model enhanced with knowledge cognition is used as a rule prediction model.
[0116] The rule engine agent can use the relevant data of the scenario demand pattern as the input data of the rule prediction model, and guide the rule prediction model to identify the business rules that match the user's private domain knowledge under the current scenario demand pattern in the rule library. Obtain each business rule associated with the current scenario demand pattern predicted by the rule prediction model, and these business rules form the target rule set.
[0117] Based on the method provided in the embodiment of the present invention, rule matching can be achieved by setting a user private domain knowledge base, a prompt engineering mechanism and a rule prediction model. The user private domain knowledge base, the prompt engineering and the rule prediction model can be used to flexibly match rules according to user habits, which is beneficial to matching business rules that are closer to the user's actual needs under the current scenario demand model, thereby improving the accuracy of decision-making.
[0118] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of determining the target decision based on the target rule set and the preset decision algorithm mentioned in step S105 includes:
[0119] For each business rule in the target rule set, determining configuration data corresponding to the business rule, the configuration data including a rule association relationship and a rule priority corresponding to the business rule;
[0120] In the method provided by the embodiment of the present invention, the rule engine agent can obtain configuration data such as the rule association relationship and rule priority of each business rule in the target rule set from the pre-configured data. The rule association relationship of the business rule represents the association between the business rule and other business rules, including the inheritance relationship and dependency relationship between the rules. The rule priority of the business rule represents the priority level of the business rule when the rule is used. The rule association relationship and rule priority of the business rule can be configured by the staff when configuring the business rule.
[0121] Based on the configuration data corresponding to each business rule in the target rule set, applying the decision algorithm to determine the application order corresponding to each business rule in the target rule set;
[0122] In the method provided by the embodiment of the present invention, the rule engine agent can apply a decision algorithm to analyze the application order of each business rule based on the rule association relationship and rule priority corresponding to each business rule in the target rule set.
[0123] Determine each action event corresponding to the target rule set;
[0124] In the method provided by the embodiment of the present invention, various types of events that can be triggered by the rules can be configured in advance according to actual needs. Events can be classified according to the functional requirements of the Internet of Things platform, such as device status events, time events, environmental condition change events, etc. For example, in the smart home scenario, the intelligent agent detects that the smoke concentration exceeds the standard through the smoke alarm, and after capturing the flame characteristics through the camera, it comprehensively analyzes and determines that it is a fire hidden event, which will trigger a series of actions such as turning off the power of all electrical appliances in the home and turning on the fire sprinkler system. For each event, the corresponding judgment condition is set. These conditions are usually set based on the triggering content of the business rule. For example, for the air conditioning temperature adjustment scenario, the intelligent agent will continuously receive data from various indoor sensors, and combine the information provided by external services (such as weather API) to process and analyze these data to determine whether to trigger temperature events and humidity events. When the indoor temperature exceeds the set upper limit and there are people in the room, the intelligent agent triggers the temperature event to execute the action of lowering the air conditioning temperature to the target temperature. At the same time, considering that the humidity is high, but has not reached the threshold that requires the dehumidification function to be started separately, only the temperature is adjusted without changing the air conditioning mode.
[0125] The rule engine agent can identify the execution actions associated with the events triggered by each business rule combination in the pre-configured events according to each business rule in the target rule set, and use the execution actions associated with the events triggered by each business rule combination as the action events corresponding to the target rule set. In the process of identifying matching events, a single business rule may trigger an action event, or a combination of multiple business rules may trigger an action event.
[0126] Based on the application order corresponding to each of the business rules and each of the action events, an action decision corresponding to the target rule set is generated, and the action decision is used as the target decision.
[0127] In the method provided by the embodiment of the present invention, the rule engine agent can determine the execution order corresponding to each execution action according to the application order of each business rule, combine each action in order, and thus generate a corresponding action decision, and use the action decision as the target decision. In the process of determining the execution order of each execution action, it can also be determined in combination with the priority level of each execution action. The priority of the action can be pre-configured based on factors such as the urgency and importance of the event. For example, in the industrial Internet of Things, if a device failure event and a device performance optimization event are detected at the same time, the device failure event usually has a higher priority.
[0128] Based on the method provided in the embodiment of the present invention, in the process of generating decisions, decisions can be made in combination with configuration data such as rule association relationships and rule priorities of business rules, which is conducive to applying various business rules in the case of rule conflicts or parallelism, forming effective logic, and is conducive to further improving the accuracy of decisions.
[0129] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of constructing the rule base mentioned in step S104 includes:
[0130] Setting an initial rule set; the initial rule set includes a plurality of initial business rules;
[0131] In the method provided by the embodiment of the present invention, the staff can set the condition part and action part of the business rules in advance according to the needs through the platform front end. Specifically, the rules can be defined by a logical structure, such as an "if-then" structure, where the "if" part describes the triggering condition of the rule, and the "then" part specifies the action to be performed when the triggering condition is met. The initially set business rules are used as the initial business rules to obtain the initial rule set.
[0132] Setting configuration information corresponding to each of the initial business rules; the configuration information corresponding to each of the initial business rules includes a rule category, a rule level, a rule association relationship, and a rule priority corresponding to the initial business rule;
[0133] In the method provided by the embodiment of the present invention, the relevant configuration data corresponding to each initial business rule can be set in advance according to the actual needs of rule matching, and the various configuration data of the initial business rule can be used as its corresponding configuration information. Specifically, the rules can be classified according to factors such as the function, application scenario or target of the rule, and a corresponding rule category can be set for each initial business rule. For example, the business rules can be divided into categories such as device control rules (such as controlling the operation of smart home appliances), data processing rules (such as filtering and aggregating data collected by sensors) or security rules (such as preventing illegal access to IoT devices). For example, in the smart home scenario, the rule "when it is detected that the door is unlocked and no one is in the house, send an alarm notification" belongs to the security rule, and the rule "when the indoor humidity is lower than 30%, turn on the humidifier to increase the humidity to 40%-45%" belongs to the device control rule.
[0134] In the method provided in the embodiment of the present invention, a hierarchical rule system can be constructed according to actual needs, and each initial business rule can be hierarchically classified and a corresponding rule level can be set. For example, the rules can be divided into global rules, local rules and other levels. The global rules apply to the entire Internet of Things platform, such as the system's security policies and other aspects. The local rules are rules for specific areas, device groups or user groups, such as device control rules for a specific room customized by a home user.
[0135] In the method provided by the embodiment of the present invention, for each initial business rule, the rule association relationship corresponding to the initial business rule can be set according to the dependency and inheritance relationship between the initial business rule and other initial business rules. The corresponding rule priority can be set for each initial business rule according to the importance, scope of influence, risk level, frequency and other factors of each initial business rule, so as to determine the priority level of rule execution when the rules conflict or run in parallel. For example, the priority levels of rules of different categories are in the following order: safety rules>equipment protection rules>energy-saving rules>comfort rules. In response to the operation of the staff to configure the information, the platform can use the configuration data such as the rule category, rule hierarchy, rule association relationship and rule priority corresponding to each initial business rule as the configuration information corresponding to the corresponding initial business rule.
[0136] In the debugging state, based on the preset simulated business scenario and the configuration information corresponding to each of the initial business rules, the initial rule set is tested to obtain the execution test result of the initial rule set;
[0137] In the method provided by the embodiment of the present invention, after completing the configuration of the initial business rules, the debugging state can be entered, and based on the preset simulated business scenarios, simulated equipment, simulated data input, etc., the initial rule set is applied in a specific scenario to simulate decision making, so as to test the execution of the rules in different scenarios, and the execution results of the rules are used as the execution test results of the initial rule set. For example, in a smart home simulation scenario, different temperature, humidity, lighting and other conditions can be simulated, and the activity status of personnel can be simulated to test whether the device control rules are executed as expected, such as whether the lights are turned on correctly in a scene simulating nighttime activities with people.
[0138] According to a preset rule conflict detection algorithm, conflict detection is performed on the initial rule set to obtain a conflict detection result corresponding to the initial rule set;
[0139] In the method provided in the embodiment of the present invention, a rule conflict detection algorithm can be pre-set, which can be specifically set by a large language model or a semantic analysis algorithm. The rule conflict detection algorithm is applied to analyze each initial business rule in the initial rule set, identify possible conflict points, and provide conflict resolution methods, such as priority setting, action merging, rule replacement, adding restrictions or refining rule conditions. The identification results of the conflict points and the corresponding conflict resolution methods are used as conflict detection results to facilitate the adjustment of the initial business rules. Rule conflicts may arise from direct conflicts between rules (such as one rule instructs to perform operation A, while another rule prohibits operation A), or inconsistent decisions caused by the simultaneous application of multiple rules.
[0140] Based on the execution test result and the conflict detection result, the initial rule set is optimized to obtain each business rule that has undergone rule optimization, and the rule base is composed of each business rule that has undergone rule optimization.
[0141] In the method provided by the embodiment of the present invention, the platform can feed back the execution test results and conflict detection results of the initial rule set to the relevant staff, so that the staff can perform corresponding rule optimization operations according to the problems reflected in the results, such as modifying the logical expression of the rules, adjusting the priority or weight of the rules, or redesigning the rules to adapt to specific scenarios. In response to the rule optimization operation of the staff, the corresponding rule optimization information can be obtained, and the relevant data of the corresponding rules in the initial rule set can be modified to obtain each business rule optimized by the rules, and the rule base is composed of each business rule optimized by the rules. A database (relational database or non-relational database) can be used to store business rules, and the rule base can be versioned to record the modification history of the rules, including modification time, modification personnel, modification content and other information.
[0142] Based on the method provided in the embodiment of the present invention, simulation testing and conflict detection can be performed on business rules during the process of configuring business rules, loopholes in the rule structure can be discovered, and conflicts between rules can be identified, which is conducive to timely optimization of business rules and avoidance of abnormal rule usage.
[0143] In order to better illustrate the method provided by the embodiment of the present invention, based on the methods provided by the above embodiments and in combination with actual application scenarios, the embodiment of the present invention provides another method for adaptive decision execution of IoT rule engine agent, which is applied to IoT platform. The management of IoT rule engine agent can be achieved through the cloud management platform, and IoT rule engine agent can be deployed on edge devices, such as Figure 2 As shown in the figure, the cloud management platform is deployed with rule structure design module and rule optimization module. The cloud management platform is mainly used for the design, optimization, deployment and monitoring of business rules to ensure that the rule engine agent at the edge can obtain the latest and optimal rule set. The operation logic of the rule engine agent can be designed through workflow, which can include data collection and preprocessing, rule selection, rule fusion perception, rule decision execution, execution feedback, perception of scenario changes and rule adjustment.
[0144] The functions of the cloud management platform mainly include the following aspects:
[0145] Centralized rule creation, updating, and maintenance, providing a unified rule base for use by edge IoT devices;
[0146] The data collected and reported by the edge end is stored in the cloud database, stored according to the characteristics of the data and application requirements, and the stored data is analyzed and mined to extract valuable information;
[0147] Continuously monitor the running status and rule execution effect of the edge rule engine agent, collect performance indicators, exception reports and user feedback, so as to timely discover and solve problems, and further optimize the rules and models applied by the rule engine agent. Specifically, the learning ability of the machine learning model can be used to analyze various monitoring and feedback data, and optimize and adjust the existing business rules, such as changing the action part of the rule, optimizing the decision-making process of the IoT rule engine agent, etc. Support incremental learning mechanism, which can continuously update the machine learning model and adaptively adjust various parameters, rules and decision-making strategies of the platform;
[0148] Assist the IoT rule engine agent in making complex decisions, such as formulating reasonable device control strategies based on the relationships between devices and overall goals in scenarios where multiple devices work together.
[0149] Next, combine Figure 3, the application process of the cloud management platform in the embodiment of the present invention is briefly described.
[0150] In an embodiment of the present invention, the staff can configure each business rule through the cloud management platform, and build a hierarchical rule system, classify each business rule hierarchically, and set the rule level corresponding to each business rule, such as global rules, local rules, etc. According to the actual application scenario, the business rules are classified based on the function of each business rule, and the rule category corresponding to each business rule is set, such as device control rules, data processing rules, security rules, etc. According to the importance, scope of influence, risk level, frequency and other factors of the rule, a corresponding weight is assigned to each business rule, and the rule priority corresponding to the business rule is set according to the weight corresponding to each business rule, so as to determine the rule execution priority level when the rules conflict or run in parallel. Various scenario modes can be defined according to actual needs, and the association relationship between each business rule and the scenario mode can be established.
[0151] In the embodiment of the present invention, the staff can deploy the scenario dynamic adjustment strategy of the intelligent body through the cloud management platform, and can specifically realize dynamic adjustment through the machine learning model. The scenario dynamic adjustment strategy can automatically adjust the scenario conditions of rule execution according to real-time data or external environmental changes to adapt to new business needs or scenario changes. Specifically, it can dynamically adjust the parameters of the rules or activate specific rules based on the perceived results of environmental variables and scenario changes, and further adjust and optimize the rules according to the effect of rule execution.
[0152] In the embodiment of the present invention, before the rule library is put into use, the cloud management platform can be used to simulate rule execution and perform conflict detection on business rules, and rule optimization can be performed based on the simulation execution results and conflict detection results of the rules.
[0153] In the method provided by the embodiment of the present invention, the business rules in the rule base can be pushed to the rule engine agent at the edge through the cloud management platform, so that it can apply the rule base to execute business decisions. At the same time, the cloud management platform can monitor the rule engine agent in real time, obtain the real-time environmental data collected by it, the execution of rules and other information, so as to further iterate and optimize the business rules in the rule base.
[0154] In addition, staff can audit the business rules in the rule base through the cloud management platform, including checking the timeliness, completeness, efficiency, etc. of the rules. Through rule execution audit, invalid rules can be cleared, existing rules can be optimized, and the healthy operation of the rule base can be ensured.
[0155] like Figure 2As shown in the figure, the rule engine agent is deployed at the edge (i.e., IoT devices). The core workflow of the rule engine agent is a closed-loop system from input processing, strategy selection, decision making to feedback learning. It is mainly used to make and execute localized decisions based on the rules distributed in the cloud and the data collected locally, and adjust the rules according to real-time feedback and environmental changes to adapt to dynamically changing conditions. The working process of the rule engine agent mainly includes:
[0156] Obtain various types of situational information at the edge, including physical environment status (such as temperature, pressure), user behavior preference data, time period dynamics, etc. Based on various types of situational information, use the situational awareness model to perform context fusion perception of situational information, and identify the current situational demand pattern based on the fusion-perceived situational data. Select matching business rules from the rule library based on the currently identified situational demand pattern, apply the decision algorithm to make fusion decisions on the currently matching business rules, generate corresponding decisions, and perform corresponding actions based on the decisions.
[0157] The rule engine agent can evaluate the effectiveness of the decision through the execution feedback of the business decision and adjust the local business rules. Figure 4 In the process shown, the rule engine agent can perceive the current scenario demand mode of the device through real-time environmental data (including third-party data), select matching business rules according to the working scenario, and form a final decision by integrating various business rules. For example, if the scenario demand corresponds to a rule set that includes application rules A and B, and the final decision is formed through analysis, the operations corresponding to rules A and B are executed respectively, and the feedback of rule execution is monitored, and the original rules are optimized according to the feedback of rule execution.
[0158] The method provided by the embodiment of the present invention can utilize the context and situation understanding ability of the LLM large language model, so that the decision-making process can comprehensively consider multiple factors, improve the accuracy and adaptability of the decision, and thus give the edge device intelligent decision-making ability, making it suitable for a variety of application scenarios. The intelligent agent based on the large language model can integrate and interpret multi-source data, identify and associate the context, and more accurately perceive the current situation to facilitate accurate decision-making. The rule engine intelligent agent can analyze the effect of rule execution based on its learning ability, real-time Internet of Things data and historical experience, identify problems in the rules, and then automatically optimize and adjust the rules to achieve dynamic update and optimization of the rule base, overcoming the limitation that traditional static rule engines are difficult to cope with new situations or changing environments. After executing the task, the intelligent agent can adjust the rules according to the result evaluation, forming a cycle of continuous learning and self-improvement, and improving the adaptability and robustness of the rule engine. In the method provided by the embodiment of the present invention, a hierarchical rule system is deployed for business rules, and the rules are divided into different levels and categories, and the dependencies and priorities between the rules are clarified, so that the rule engine intelligent agent can use these configuration data to resolve conflicts between rules and determine the execution order. By automatically generating test cases covering various scenarios and introducing intelligent conflict detection algorithms, the business rules in the rule base can be optimized.
[0159] and Figure 1 Corresponding to the method for adaptive decision execution of an Internet of Things rule engine intelligent agent shown in the figure, an embodiment of the present invention also provides an Internet of Things rule engine intelligent agent adaptive decision execution device for Figure 1 The specific implementation of the method shown in is shown in the structural diagram Figure 5 As shown, including:
[0160] The first determining unit 201 is used to determine the real-time information corresponding to the IoT device; the real-time information includes environmental data, device status data and user behavior data;
[0161] A context perception unit 202 is used to perform context fusion perception on the real-time information based on a preset context perception model to obtain context perception information; the context perception model is a model obtained by fine-tuning a large language model;
[0162] A second determining unit 203 is used to determine a situational demand mode based on the situational awareness information;
[0163] The third determining unit 204 is used to determine a target rule set in a pre-built rule base according to the scenario demand model; the rule base includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule base;
[0164] The fourth determination unit 205 is used to determine a target decision based on the target rule set and a preset decision algorithm, and execute an action corresponding to the target decision;
[0165] A feedback receiving unit 206, configured to receive an execution feedback result corresponding to the action, and determine whether the rule base or the decision algorithm needs to be optimized based on the execution feedback result;
[0166] The feedback optimization unit 207 is used to determine an optimization object in the rule base and the decision algorithm if the rule base or the decision algorithm needs to be optimized, and optimize the optimization object according to the execution feedback result.
[0167] By applying the device provided by the embodiment of the present invention, the Internet of Things rule engine can be operated as an intelligent agent, and a scenario perception model obtained by fine-tuning a large language model is deployed. In the decision-making process, multi-source real-time data related to the device operating environment and scenario can be obtained, so that the scenario perception model can perform fusion perception of scenario information based on various real-time data, so as to identify the current scenario demand mode through the scenario information obtained by fusion perception, match business rules using the scenario demand mode, and then make decisions based on the matched business rules. Regardless of whether the relevant data of the Internet of Things device in the current environment is known state data, the scenario demand mode can be identified based on the fusion perception ability of the scenario perception model, and the business rules can be matched, which is conducive to making accurate decisions in various environments, improving the decision-making response ability for various scenarios, and improving the environmental adaptability of the Internet of Things platform. Secondly, during the operation of the Internet of Things rule engine intelligent agent, after executing the action corresponding to the decision, the execution feedback result can be received, and it can be determined whether to optimize and adjust the business rules in the rule base or the decision mechanism of the decision algorithm according to the execution feedback result, so that the rule base and the decision algorithm can be flexibly adapted to the actual scenario, which is conducive to further improving the environmental adaptability and decision accuracy of the Internet of Things platform.
[0168] exist Figure 5 Based on the device shown, the device provided by the embodiment of the present invention can be further expanded into multiple units. The functions of each unit can be found in the descriptions of the various embodiments provided in the previous text for the method of adaptive decision execution of the Internet of Things rule engine intelligent agent, and no further examples will be given here.
[0169] An embodiment of the present invention also provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the method for adaptive decision execution of the Internet of Things rule engine intelligent agent as described above.
[0170] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6As shown, it specifically includes a memory 301 and one or more instructions 302, wherein the one or more instructions 302 are stored in the memory 301 and are configured to be executed by one or more processors 303 to perform the following operations:
[0171] Determine real-time information corresponding to the IoT device; the real-time information includes environmental data, device status data, and user behavior data;
[0172] Based on a preset situational awareness model, the real-time information is situationally fused and perceived to obtain situational awareness information; the situational awareness model is a model obtained by fine-tuning a large language model;
[0173] Determining a situational demand pattern based on the situational awareness information;
[0174] According to the scenario demand model, a target rule set is determined in a pre-built rule base; the rule base includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule base;
[0175] Based on the target rule set and the preset decision algorithm, determine the target decision, and execute the action corresponding to the target decision;
[0176] receiving an execution feedback result corresponding to the action, and judging whether the rule base or the decision algorithm needs to be optimized based on the execution feedback result;
[0177] If the rule base or the decision algorithm needs to be optimized, an optimization object is determined in the rule base and the decision algorithm, and the optimization object is optimized according to the execution feedback result.
[0178] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, 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 scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0179] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0180] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for adaptive decision execution of an Internet of Things rule engine agent, characterized in that: include: Determine the real-time information corresponding to IoT devices; The real-time information includes environmental data, device status data and user behavior data; Based on a preset situational awareness model, the real-time information is subjected to situational fusion awareness to obtain situational awareness information; The context-aware model is a model obtained by fine-tuning a large language model; Determining a situational demand pattern based on the situational awareness information; According to the scenario demand model, a target rule set is determined in a pre-built rule base; the rule base includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule base; Based on the target rule set and the preset decision algorithm, determine the target decision, and execute the action corresponding to the target decision; receiving an execution feedback result corresponding to the action, and judging whether the rule base or the decision algorithm needs to be optimized based on the execution feedback result; If the rule base or the decision algorithm needs to be optimized, an optimization object is determined in the rule base and the decision algorithm, and the optimization object is optimized according to the execution feedback result.
2. The method for adaptive decision execution of an Internet of Things rule engine agent according to claim 1 is characterized in that: The performing situation fusion perception on the real-time information based on the preset situation perception model to obtain situation perception information includes: Performing data cleaning on the real-time information, and using the real-time information after data cleaning as information to be processed; Performing data preprocessing on the information to be processed, and using the preprocessed information to be processed as information to be fused; According to a preset data fusion strategy, data fusion is performed on the information to be fused, and the information obtained by the data fusion is used as the information to be analyzed; Inputting the information to be analyzed into the situation awareness model, allowing the situation awareness model to perform context situation awareness, and obtaining the situation content output by the situation awareness model; The situational content is used as the situational awareness information.
3. The method for adaptive decision execution of an Internet of Things rule engine agent according to claim 1, characterized in that: The determining of the situational demand mode based on the situational awareness information includes: Determine the scene information corresponding to each preset scene mode; Determining, from each of the context information, target context information that matches the context awareness information; The preset scenario mode corresponding to the target scenario information is used as the scenario requirement mode.
4. The method for adaptive decision execution of an Internet of Things rule engine agent according to claim 1, characterized in that: Determining a target rule set in a pre-built rule base according to the scenario demand model includes: Determining the scenario mode associated with each business rule in the rule base according to the pre-established mapping relationship between the mode and the rule; According to the scenario patterns associated with the business rules, in the rule base, determining the business rules associated with the scenario demand patterns; The target rule set is composed of various business rules associated with the scenario demand pattern.
5. The method for adaptive decision execution of an Internet of Things rule engine agent according to claim 1, characterized in that: Determining a target rule set in a pre-built rule base according to the scenario demand model includes: Applying a preset rule prediction model, in the rule base, predicting the business rules associated with the scenario demand pattern; the rule prediction model is a model obtained by performing knowledge cognition enhancement on a large language model based on a preset user private domain knowledge base and prompt engineering; The target rule set is composed of the business rules predicted by the rule prediction model.
6. The method for adaptive decision execution of an Internet of Things rule engine agent according to claim 1, characterized in that: The determining of the target decision based on the target rule set and a preset decision algorithm includes: For each business rule in the target rule set, determining configuration data corresponding to the business rule, the configuration data including a rule association relationship and a rule priority corresponding to the business rule; Based on the configuration data corresponding to each business rule in the target rule set, applying the decision algorithm to determine the application order corresponding to each business rule in the target rule set; Determine each action event corresponding to the target rule set; Based on the application order corresponding to each of the business rules and each of the action events, an action decision corresponding to the target rule set is generated, and the action decision is used as the target decision.
7. The method for adaptive decision execution of an Internet of Things rule engine agent according to claim 1, characterized in that: The process of constructing the rule base includes: Setting an initial rule set; the initial rule set includes a plurality of initial business rules; Setting configuration information corresponding to each of the initial business rules; the configuration information corresponding to each of the initial business rules includes a rule category, a rule level, a rule association relationship, and a rule priority corresponding to the initial business rule; In the debugging state, based on the preset simulated business scenario and the configuration information corresponding to each of the initial business rules, the initial rule set is tested to obtain the execution test result of the initial rule set; According to a preset rule conflict detection algorithm, conflict detection is performed on the initial rule set to obtain a conflict detection result corresponding to the initial rule set; Based on the execution test result and the conflict detection result, the initial rule set is optimized to obtain each business rule that has undergone rule optimization, and the rule base is composed of each business rule that has undergone rule optimization.
8. A device for adaptive decision execution of an Internet of Things rule engine agent, characterized in that: include: A first determining unit, used to determine real-time information corresponding to the IoT device; The real-time information includes environmental data, device status data and user behavior data; A situation perception unit, configured to perform situation fusion perception on the real-time information based on a preset situation perception model to obtain situation perception information; The context-aware model is a model obtained by fine-tuning a large language model; A second determining unit, configured to determine a scenario demand mode based on the scenario perception information; A third determining unit is used to determine a target rule set in a pre-built rule base according to the scenario demand model; the rule base includes a plurality of pre-set business rules, and the target rule set includes at least one business rule in the rule base; A fourth determination unit, configured to determine a target decision based on the target rule set and a preset decision algorithm, and execute an action corresponding to the target decision; A feedback receiving unit, configured to receive an execution feedback result corresponding to the action, and determine whether the rule base or the decision algorithm needs to be optimized based on the execution feedback result; The feedback optimization unit is used to determine an optimization object in the rule base and the decision algorithm if the rule base or the decision algorithm needs to be optimized, and optimize the optimization object according to the execution feedback result.
9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the method for adaptive decision execution of an Internet of Things rule engine intelligent agent as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to execute the method for adaptive decision execution of an Internet of Things rule engine agent as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Scene personalized service method based on Internet of Things home furnishing
CN113253624A
Business decision determination method and device, electronic equipment and storage medium
CN115048156A
Vehicle-mounted multimode feedback intelligent interaction system based on scene perception information
CN118605734A
System and method for developing business rules for decision engines
US20140279810A1
Multi-agent beyond-visual-range networked collaborative perception and dynamic decision-making method and related device
WO2024098438A1
Cited By
Data processing method, device and equipment
CN119476969A
Intelligent environment purification and humidification integrated linkage regulation and control method and system
CN119617602A
Monitoring strategy system and method based on rule base
CN120523691A
Engineering machinery internet-of-things intelligent management system
CN120802780A
An internet of things intelligent management system for construction machinery
CN120802780B
