Dynamic data filtering method oriented to expert system and based on rule feedback

By designing a dynamic data filtering method based on rule feedback in a real-time expert system, and dynamically constructing and adjusting the filter grid, the problem of data analysis bottlenecks in high concurrency is solved, and the system's processing efficiency is improved.

CN119396877APending Publication Date: 2025-02-07BEIJING AEROSPACE AUTOMATIC CONTROL RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411409584.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In real-time expert systems, data stream replication under high concurrency causes data input to multiply, which may aggravate the bottleneck of data parsing and affect processing efficiency.

Method used

Design a dynamic data filtering method based on rule feedback, dynamically construct data filters, build filter grids based on the currently loaded rule set feedback, and automatically adjust or delete filter grids to adapt to the loading and unloading of rule sets.

Benefits of technology

It effectively improves the adaptability of real-time expert systems to high-throughput input data, avoids data analysis bottlenecks, and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396877A_ABST
    Figure CN119396877A_ABST
Patent Text Reader

Abstract

The invention provides a rule feedback-based data dynamic filtering method oriented to a real-time expert system, which optimizes the improvement of the data processing efficiency of the real-time expert system. Dynamically constructing a data filter according to the feedback of the rule set currently loaded by the expert system; the dynamic filter filters out data parameters related to the current rule set, generates symptoms through analysis and interpretation, and transmits the symptoms to the inference engine of the rule set; and when the expert system unloads one rule set, the filtering grid of the filter automatically adjusts or executes deletion operation. According to the method, the adaptability of the real-time expert system to high-throughput input data can be effectively improved, and the data analysis bottleneck in the expert system is avoided, so that the processing efficiency of the expert system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of real-time expert systems supporting concurrent reasoning, and in particular relates to a data dynamic filtering method based on rule feedback and oriented to expert systems. Background Art

[0002] After a rule set is loaded into a rule-based real-time expert system, it performs reasoning by matching the rules with the symptoms generated by interpreting real-time data. The real-time expert system needs to parse the collected data and convert it into symptoms before passing it to the inference engine. When the throughput of collected data is large, the data parsing process will become a processing bottleneck within the expert system, affecting the processing efficiency of the expert system. Real-time expert systems generally have a data filtering mechanism, the purpose of which is to filter out unnecessary data messages and data parameters, so that the expert system only processes data related to the loaded rules.

[0003] The most direct method is to build an independent filter for each rule set and configure the data messages and data parameters that need to be parsed for each rule set. The disadvantage of this method is that when the expert system processes concurrent rule sets, the collected data stream needs to be copied into multiple copies, and then each copy of the data stream enters the filter of each rule set for filtering before parsing. However, expert systems usually support concurrent reasoning. In the case of high concurrency, the duplication of data streams will cause the data input of the expert system to increase exponentially. Such a filtering mechanism may aggravate the bottleneck of data parsing. Therefore, it is necessary to optimize the filtering mechanism to improve the processing efficiency of real-time expert systems. Summary of the invention

[0004] The purpose of the present invention is to solve the problems existing in the prior art and to design a data filtering method for a real-time expert system. According to the feedback of the rule set currently loaded by the expert system, a data filter is dynamically constructed; the dynamic filter filters out the data parameters related to the current rule set, and then generates signs through analysis and interpretation and passes them to the inference engine of the rule set; when the expert system unloads a rule set, the filter grid of the filter is automatically adjusted or a deletion operation is performed. This method can effectively improve the adaptability of the real-time expert system to high-throughput input data, avoid data analysis bottlenecks inside the expert system, and thus improve the processing efficiency of the expert system.

[0005] The present invention provides a data dynamic filtering method based on rule feedback for a real-time expert system, the steps are as follows:

[0006] (1) The expert system starts up and constructs data messages and data parameters in each message type according to the data communication protocol, and establishes a mapping relationship to associate each data message with the data parameters it contains, so that the data parameters contained in the data message can be found through the data message, or the data message to which it belongs can be found through the data parameters;

[0007] Assign a positive integer as the data message identifier msgID to each data message. msgID is unique and can be used to identify a data message. Build a data source dataSource for each data parameter in the data message. dataSource is used to parse the data parameters. It contains all the information required for parsing, such as: data type dataType, data length dataLength, data source identifier dataID, byte offset byteOffset, bit mask bitMask, and some extensible elements: data conversion coefficient coeff, data conversion constant constant, and data conversion method funcIndex. dataID under dataSource is unique and can be used to identify a dataSource. A dataSource can only belong to one data message. Therefore, the data message to which it belongs can be found according to dataSource.

[0008] Following the above method, the data message definition is described according to the data communication protocol, and all mapping relationships from msgID to data parameter list are constructed;

[0009] (2) When the expert system loads the rule set ruleSet, it starts an inference engine responsible for matching symptoms with the rules in the rule set ruleSet; by parsing the symptoms in the currently loaded rules, it obtains the data message associated with each symptom and the data parameters in the data message;

[0010] The rule set is composed of rules. Each rule involves several symptoms. Through the symptoms in the rules, the data message set associated with the symptom and the data parameter list under each data message are reversed to prepare for building the filter grid in the filter.

[0011] (3) According to the association established in step (2), a filter grid filterEntry is constructed. filterEntry contains the data message identifier msgID and the data parameter filter list dataSourceFilterList that needs to be parsed in the data message. Each filter grid is associated with a unique data message. The data parameter filter list dataSourceFilterList is composed of several data source filters dataSourceFilter. dataSourceFilter contains a reference count refCounter, a data source dataSource, and a rule set identifier set ruleSetIDSet. When a rule set identifier is added to ruleSetIDList, refCounter is incremented by 1.

[0012] (4) When the expert system loads a rule set, it constructs a filter grid based on the mapping relationships established in steps (1), (2), and (3) and the defined filter grid structure. It traverses all the symptoms in the rule set and constructs a filter grid for each symptom;

[0013] Furthermore, if the msgID associated with the symptom has a corresponding filterEntry, then the dataSource associated with the symptom is searched in the data parameter filter list of this filterEntry. If it can be found, the refCounter under dataSourceFilter is incremented by 1, and then the ruleSetID of this rule set is added to ruleSetIDSet; if it cannot be found, then a dataSourceFilter is added to its dataSourceFilterList, with its refCounter set to 1 and dataSource set to the data source associated with the symptom, and then the ruleSetID of this rule set is added to ruleSetIDSet;

[0014] If there is no corresponding filterEntry for the msgID associated with the symptom, create a new filterEntry for this msgID. After the creation, add a dataSourceFilter to its dataSourceFilterList, set its refCounter to 1, and set dataSource to the data source associated with the symptom. Then add the ruleSetID of this rule set to ruleSetIDSet.

[0015] (5) After the rule set is loaded, a filter grid is established in the dynamic filter. The dynamic filter filters out data messages that are not related to the current rule set. For those related data messages, the dataSource in the dataSourceFilterList under each filterEntry is traversed, the data parameters corresponding to these data sources are parsed, and the symptoms generated after the interpretation of these data parameters are sent to the inference engine corresponding to the rule set identifier in ruleSetIDSet;

[0016] (6) When the expert system uninstalls a rule set, it finds the associated data message through the signs in the rule, and then further finds the associated filterEntry and the dataSourceFilter in the dataSourceFilterList under the filter grid, and then decrements the refCounter in the dataSourceFilter by 1. If the refCounter is 0 after decrementing by 1, the dataSourceFilter is deleted from the dataSourceFilterList. If the dataSourceFilterList is found to be empty, the current filterEntry is deleted from the filter map. After uninstalling a rule set, the expert system recycles the inference engine assigned to the rule set.

[0017] The beneficial effects of the present invention are as follows: the data filtering method proposed in the present invention can meet the requirements of the real-time expert system for high concurrency and processing efficiency, and provide an effective data processing optimization mechanism for the real-time expert system. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings constituting a part of the present application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention:

[0019] Figure 1 is a schematic diagram of association between a data message and a data parameter according to an embodiment of the present invention;

[0020] Figure 2 is a schematic diagram of association between a symptom and a data source and a data message according to an embodiment of the present invention;

[0021] Figure 3 is a schematic diagram of a two-layer filtering mechanism of a filter according to an embodiment of the present invention;

[0022] Figure 4 is a schematic diagram of feedback of a loading rule set to a filter according to an embodiment of the present invention;

[0023] Figure 5 It is a schematic diagram of feedback of the uninstall rule set to the filter according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.

[0025] This embodiment provides a data dynamic filtering method based on rule feedback for a real-time expert system, and the steps are as follows:

[0026] (1) The expert system starts up and constructs data messages and data parameters in each message type according to the data communication protocol. It also establishes a mapping relationship to associate each data message with the data parameters it contains, so that the data parameters contained in the data message can be found through the data message, or the data message to which the data parameter belongs can be found through the data parameter;

[0027] Assign a positive integer as the data message identifier msgID to each data message. msgID is unique and can be used to identify a data message. Build a data source dataSource for each data parameter in the data message. dataSource is used to parse the data parameters. It contains all the information required for parsing, such as: data type dataType, data length dataLength, data source identifier dataID, byte offset byteOffset, bit mask bitMask, and some extensible elements: data conversion coefficient coeff, data conversion constant constant, and data conversion method funcIndex. dataID under dataSource is unique and can be used to identify a dataSource. A dataSource can only belong to one data message. Therefore, the data message to which it belongs can be found according to dataSource.

[0028] Following the above method, if Figure 1 As shown, according to the data communication protocol, the data message definition is explained, and all mapping relationships from msgID to data parameter list are constructed;

[0029] (2) When the expert system loads the rule set ruleSet, it starts an inference engine responsible for matching symptoms with the rules in the rule set ruleSet; by parsing the symptoms in the currently loaded rules, it obtains the data message associated with each symptom and the data parameters in the data message;

[0030] A rule set consists of rules such as Figure 2 As shown, each rule involves several symptoms. Through the symptoms in the rule, the data message set associated with the symptom and the data parameter list under each data message are reversed to prepare for building the filter grid in the filter;

[0031] (3) According to the association established in step (2), a filter grid filterEntry is constructed. filterEntry contains the data message identifier msgID and the data parameter filter list dataSourceFilterList that needs to be parsed in the data message. Each filter grid is associated with a unique data message. The data parameter filter list dataSourceFilterList is composed of several data source filters dataSourceFilter. dataSourceFilter contains a reference count refCounter, a data source dataSource, and a rule set identifier set ruleSetIDSet. When a rule set identifier is added to ruleSetIDList, refCounter is incremented by 1.

[0032] (4) When the expert system loads a rule set, it constructs a filter grid based on the mapping relationships established in steps (1), (2), and (3) and the defined filter grid structure. It traverses all the symptoms in the rule set and constructs a filter grid for each symptom;

[0033] Furthermore, if the msgID associated with the symptom has a corresponding filterEntry, then the dataSource associated with the symptom is searched in the data parameter filter list of this filterEntry. If it can be found, the refCounter under dataSourceFilter is incremented by 1, and then the ruleSetID of this rule set is added to ruleSetIDSet; if it cannot be found, then a dataSourceFilter is added to its dataSourceFilterList, with its refCounter set to 1 and dataSource set to the data source associated with the symptom, and then the ruleSetID of this rule set is added to ruleSetIDSet;

[0034] If there is no corresponding filterEntry for the msgID associated with the symptom, create a new filterEntry for this msgID. After the creation, add a dataSourceFilter to its dataSourceFilterList, set its refCounter to 1, and set dataSource to the data source associated with the symptom. Then add the ruleSetID of this rule set to ruleSetIDSet.

[0035] After the rule set is loaded, a filter grid is established in the dynamic filter. The dynamic filter filters out data messages that are not related to the current rule set. For those related data messages, the dataSource in the dataSourceFilterList under each filterEntry is traversed, the data parameters corresponding to these data sources are parsed, and the symptoms generated after the interpretation of these data parameters are sent to the inference engine corresponding to the rule set identifier in ruleSetIDSet;

[0036] like Figure 3 As shown in the figure, the first level of filtering is the filtering of data messages; the second level of filtering is the fine filtering of data parameters in data messages. The purpose of the two-level filtering is to make the expert system process only those inputs related to the rules, and then push the symptoms generated by the interpretation to the inference engine that needs these symptoms.

[0037] (6) When the expert system uninstalls a rule set, it finds the associated data message through the signs in the rule, and then further finds the associated filterEntry and the dataSourceFilter in the dataSourceFilterList under the filter grid, and then decrements the refCounter in the dataSourceFilter by 1. If the refCounter is 0 after decrementing by 1, the dataSourceFilter is deleted from the dataSourceFilterList. If the dataSourceFilterList is found to be empty, the current filterEntry is deleted from the filter map. After uninstalling a rule set, the expert system recycles the inference engine assigned to the rule set.

[0038] The present invention provides a preferred embodiment.

[0039] When the expert system starts, the dynamic filter is empty. Assume that the expert system loads rule set A (ruleSetID = IDX) and rule set B (ruleSetID = IDY), and assigns inference engine A to rule set A and inference engine B to rule set B. Rule set A contains n symptoms: f_1_1,...,f_1_n, which are associated with data parameters A1, B1 under data message msgID1, and data parameters A2,...,N2 under msgID2. Rule set B contains m symptoms: f_2_1,...,f_2_m, which are associated with data parameters B1,...,N1 under data message msgID1.

[0040] like Figure 4As shown, according to the association between the symptom and the data message and data parameter, the filter grids of msgID1 and msgID2 of the dynamic filter and the dataSourceFilterList under each filter grid are constructed. The dataSourceFilterList under the filter grid of msgID1 contains the dataSourceFilter of data parameter A1...data parameter N1, wherein the refCounter under the dataSourceFilter of data parameter B1 is 2, ruleSetIDSet={IDX,IDY}; the refCounter under the dataSourceFilter of data parameter C1...N1 is 1, ruleSetIDSet={IDY}; the refCounter under the dataSourceFilter of data parameter A1 is 1, ruleSetIDSet={IDX}.

[0041] The dataSourceFilterList under the filter grid of msgID2 contains dataSourceFilter of data parameter A2 . . . data parameter N2, the refCounter under all dataSourceFilters is 1, and ruleSetIDSet={IDX}.

[0042] At this time, if the expert system collects k kinds of data messages in real time, msgID1...msgIDk, after the dynamic filter is built, the dynamic filter filters out the data parameters A1...N1 in the data message msgID1 and the data parameters A2...N2 in msgID2. Other data messages and data parameters are filtered out. The expert system parses the data according to the configuration in the dataSource of each data parameter, and the parsed data is interpreted to generate symptoms, which are pushed to the inference engine in ruleSetIDSet.

[0043] Assuming that the end timing of rule set B is met first, the expert system needs to uninstall rule set B. Based on the signs in rule set B, the expert system deletes the dataSourceFilter and msgID associated with rule set B from the dynamic filter. In the dataSourceFilterList under the filter grid of msgID1, the dataSourceFilter of data parameter A1 remains unchanged; the refCounter in the dataSourceFilter of data parameter B1 decreases by 1 and becomes 1, and the ruleSetIDSet becomes {IDX}; the refCounter of the dataSourceFilter of the remaining data parameters C1...N1 decreases by 1 and becomes 0, and the ruleSetIDSet set becomes {Φ}, so the dataSourceFilter of these data parameters is deleted from the dataSourceFilterList. The feedback of uninstalling rule set B to the dynamic filter is as follows: Figure 5 After dynamic adjustment, the filter also fully meets the reasoning requirements of the current expert system.

[0044] 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 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 data dynamic filtering method based on rule feedback for real-time expert systems, characterized in that: The steps include: (1) The expert system starts up, constructs data messages and data parameters in each message type according to the data communication protocol, and establishes a mapping relationship to associate each data message with the data parameters it contains, so that the data parameters contained in the data message can be searched, or the data message to which it belongs can be searched through the data parameters; (2) The expert system loads the rule set ruleSet, starts the inference engine responsible for matching symptoms with the rules in the rule set ruleSet, and obtains the data message associated with each symptom and the data parameters in the data message by parsing the symptoms in the currently loaded rules; (3) According to the association relationship established in step (2), a filter grid filterEntry is constructed, wherein filterEntry contains a data message identifier msgID and a data parameter filter list dataSourceFilterList to be parsed in the data message, and each filter grid is associated with a unique data message; The data parameter filter list dataSourceFilterList is composed of several data source filters dataSourceFilter. dataSourceFilter contains a reference count refCounter, a data source dataSource, and a rule set identifier set ruleSetIDSet. When a rule set identifier is added to ruleSetIDList, refCounter is incremented by 1. (4) When the expert system loads the rule set, it constructs the filter grid according to the mapping relationships established in steps (1), (2), and (3) and the defined filter grid structure; Traverse all the symptoms in the rule set and build a filter grid for each symptom; (5) After the rule set is loaded and the filter grid is established in the dynamic filter, the dynamic filter will filter the data messages that are not related to the current rule set; for the related data messages, the dataSource in the dataSourceFilterList under each filterEntry is traversed, the data parameters corresponding to these data sources are parsed, and the symptoms generated after the interpretation of these data parameters are sent to the inference engine corresponding to the rule set identifier in ruleSetIDSet; (6) When the expert system uninstalls a rule set, it finds the associated data message through the signs in the rule, and then further finds the associated filterEntry and the dataSourceFilter in the dataSourceFilterList under the filter grid, and then decrements the refCounter in the dataSourceFilter by 1. If the refCounter is 0 after decrementing by 1, the dataSourceFilter is deleted from the dataSourceFilterList. If the dataSourceFilterList is found to be empty, the current filterEntry is deleted from the filter map. After uninstalling a rule set, the expert system recycles the inference engine assigned to the rule set.

2. The method for dynamic data filtering based on rule feedback for real-time expert system according to claim 1, characterized in that: In step (5), the first level of filtering provided is data message filtering, and the second level of filtering provided is data parameter filtering; the filtering grid in the data filter is dynamically adjusted according to the loaded rule set so that the expert system only processes the data parameters that need to be parsed.

3. The method for dynamic data filtering based on rule feedback for real-time expert system according to claim 1, characterized in that: Users can define and configure data sources according to data communication protocols, and build associations between data sources and data messages.

4. The method for dynamic data filtering based on rule feedback for real-time expert system according to claim 1, characterized in that: A data message is associated with multiple data sources, where the data source Definition include: Data type dataType, data length dataLength, data source identifier dataID, byte offset byteOffset, and bit mask bitMask; And expandable elements: data conversion coefficient coeff, data conversion constant constant; And the data conversion method funcIndex.

5. The method for dynamic data filtering based on rule feedback for real-time expert system according to claim 1, characterized in that: The filter adapts to the expert system to load multiple rule sets simultaneously for concurrent reasoning, and during the concurrent reasoning process, the filter can accurately push the signs required by each reasoning engine.

6. The method for dynamic data filtering based on rule feedback for real-time expert system according to claim 1, characterized in that: In step (2), the scope of each ruleSet is from the start time to the end time. When the start time of a ruleSet is met, the expert system loads all the rules in the ruleSet and allocates a dedicated inference engine for the ruleSet. When the end time of a ruleSet is met, the expert system unloads the rules in the ruleSet and recycles the allocated inference engine.

7. The method for dynamic data filtering based on rule feedback for real-time expert system according to claim 1, characterized in that: ruleSetID and msgID are represented by unique positive integers.

8. The method for dynamic data filtering based on rule feedback for real-time expert system according to claim 1, characterized in that: Step (4) is specifically as follows: If the msgID associated with the symptom has a corresponding filterEntry, then search for the dataSource associated with the symptom in the data parameter filter list of this filterEntry. If it can be found, then increase the refCounter under dataSourceFilter by 1, and then add the ruleSetID of this rule set in ruleSetIDSet; if it cannot be found, then add a dataSourceFilter to its dataSourceFilterList, set its refCounter to 1, and dataSource to the data source associated with the symptom, and then add the ruleSetID of this rule set to ruleSetIDSet; If there is no corresponding filterEntry for the msgID associated with the symptom, create a new filterEntry for this msgID. After the creation, add a dataSourceFilter to its dataSourceFilterList, set its refCounter to 1, and set dataSource to the data source associated with the symptom. Then add the ruleSetID of this rule set to ruleSetIDSet.