A heterogeneous rule matching method and apparatus

By constructing a tree-structured rule model and rule filters, the problem of poor code reusability in heterogeneous rule matching is solved, matching efficiency is improved, error probability is reduced, and business processing performance is enhanced.

CN117235539BActive Publication Date: 2026-04-24WUHAN FIBERHOME TECHNICAL SERVICES CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN FIBERHOME TECHNICAL SERVICES CO LTD
Filing Date
2023-08-18
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing technologies, heterogeneous rule matching suffers from poor code reusability and low matching efficiency, especially when a large number of rules exist, which leads to performance degradation and affects business processing efficiency.

Method used

A tree-structured rule model is used to construct the rule model. Through rule filters and index data structures, heterogeneous rules can be matched, avoiding the need to traverse all rules for matching and improving matching efficiency.

Benefits of technology

It improves code reusability and matching efficiency for heterogeneous rule matching, reduces the probability of matching errors, and enhances the performance of business processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117235539B_ABST
    Figure CN117235539B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data matching, and provides a heterogeneous rule matching method and device. In the present application, rule hierarchy structure and other information are abstracted into a rule model, and the rule model is constructed using a tree structure according to specific predetermined rule data, so that the problem of poor code reusability for similar heterogeneous matching rules is solved. By constructing a rule filter, the matching efficiency is improved. During matching, only the rule model is used to match according to the logical relationship in the rule model, so that the use of all original data to be matched to traverse all rules for sequential matching is avoided, and the matching efficiency is higher. Further, the predetermined rule data is integrated and classified by constructing an index, so that the matching efficiency is further improved, and the probability of matching errors is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data matching technology, and in particular to a heterogeneous rule matching method and apparatus. Background Technology

[0002] With the rapid development of 5G (5th Generation Mobile Communication Technology), network scale and communication data volume continue to grow, leading to an increasing demand for processing massive amounts of data. In data processing, many scenarios require customized matching rules based on business needs to filter out data that matches these rules. For example, in security analysis scenarios, network traffic data needs to be matched according to established network alarm rules to identify and output alarm events. Currently, for similar rules, a separate set of program code is written for each rule to achieve rule matching. Especially for multiple rules with fixed judgment methods but structural differences, the rule model cannot be reused; each new rule requires the redevelopment of all rule matching algorithms. Furthermore, the current method of iterating through all matching rules sequentially results in a sharp decline in matching performance as the number of matching rules increases, leading to low matching efficiency.

[0003] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention

[0004] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides a heterogeneous rule matching method and apparatus, which aims to solve the problem of poor code reusability for similar heterogeneous matching rules, and avoid using data to traverse all matching rules sequentially, thereby improving matching efficiency.

[0005] The present invention adopts the following technical solution:

[0006] In a first aspect, the present invention provides a heterogeneous rule matching method, comprising:

[0007] Construct a rule filter based on at least one predefined rule data and a rule model;

[0008] Based on the rule model, the original data to be matched is converted into at least one intermediate data.

[0009] The intermediate data is matched with the rule filter to obtain an intermediate rule list for each piece of intermediate data;

[0010] Based on the rule model, the logical relationships between the intermediate data are determined, and logical operations are performed on the intermediate rule lists based on the logical relationships to determine the target rule list that matches the original data.

[0011] Furthermore, constructing a rule filter based on at least one predetermined rule data and the rule model includes:

[0012] Obtain the condition data and rule ID for each of the predetermined rule data, wherein the condition data includes a condition tag and a condition attribute value, and the rule ID is automatically assigned based on the predetermined rule data;

[0013] In the rule model, a condition identifier that matches the condition data is determined based on the condition label;

[0014] If the condition attribute value is not empty, then the index data is constructed using the condition identifier and the condition attribute value as keywords and the rule ID set as index value, and the index data is assigned to the first index set; if the condition attribute value is empty, then the index data is constructed using the condition identifier as keywords and the rule ID set as index value, and the index data is assigned to the second index set; wherein, each of the predetermined rule data corresponds to at least one index data;

[0015] The first index set and the second index set are integrated into the rule filter.

[0016] Furthermore, the process of constructing the rule ID set includes:

[0017] Determine whether there is identical condition data in different predetermined rule data;

[0018] If it exists, obtain the rule ID of the predefined rule data with the same condition data to obtain multiple rule IDs corresponding to the same condition data, and construct a rule ID set based on the multiple rule IDs.

[0019] Furthermore, the step of matching the intermediate data with the rule filter to obtain an intermediate rule list for each piece of intermediate data includes:

[0020] Based on the condition identifier and the condition attribute value, the corresponding matching rule list is retrieved from the first index set;

[0021] Based on the condition identifier, the corresponding default rule list is retrieved from the second index set;

[0022] The intermediate rule list of the intermediate data is obtained by combining the matching rule list and the default rule list.

[0023] Furthermore, the step of converting the original data to be matched into at least one intermediate data point according to the rule model includes:

[0024] From the original data, at least one matching data is obtained, wherein the matching data includes a matching tag and a matching attribute value;

[0025] Based on the matching tag, the condition identifier corresponding to the matching tag is obtained from the rule model;

[0026] The intermediate data is constructed based on the condition identifier and the matching attribute value.

[0027] Furthermore, the step of matching the intermediate data with the rule filter to obtain an intermediate rule list for each piece of intermediate data includes:

[0028] The rule filter is traversed and searched using the condition identifier and the matching attribute value as keywords to obtain an intermediate rule list for each piece of intermediate data.

[0029] Further, the step of determining the logical relationships between the corresponding intermediate data based on the rule model, and performing logical operations on the corresponding intermediate rule lists based on the logical relationships to determine the target rule list that matches the original data includes:

[0030] Traverse from the root node to the leaf node of the rule model;

[0031] If the current node being traversed is not a leaf node, then obtain the logical relationship of the current node, find the child nodes of the current node, determine the intermediate data corresponding to the child nodes, and determine the rule list of the current node based on at least one intermediate data.

[0032] If the current node being traversed is a leaf node, then obtain the node ID corresponding to the leaf node, determine the corresponding intermediate data based on the node ID, and use the intermediate rule list corresponding to the intermediate data as the rule list of the leaf node.

[0033] Obtain the rule list of the root node, and obtain the target rule list based on the rule list of the root node.

[0034] Furthermore, if the currently traversed node is not a leaf node, then the logical relationship of the current node is obtained, and the child nodes of the current node are found. The intermediate data corresponding to the child nodes is determined, and based on at least one intermediate data, the rule list for determining the current node includes:

[0035] Obtain the logical relationship of the current node and find the child nodes of the current node;

[0036] Get the node ID corresponding to the child node, and determine the corresponding intermediate data based on the node ID;

[0037] Obtain the intermediate rule list corresponding to the intermediate data, and use the intermediate rule list as the rule list of the child node;

[0038] According to the logical relationship, logical operations are performed on the rule list of the child node to obtain the rule list of the current node.

[0039] Furthermore, the step of performing logical operations on the rule list of the child nodes according to the logical relationship to obtain the rule list of the current node includes:

[0040] When the logical relationship is an AND relationship, the rule list of the child node is combined to obtain the rule list of the current node;

[0041] When the logical relationship is an OR relationship, the intersection of the rule lists of the child nodes is taken to obtain the rule list of the current node.

[0042] Secondly, the present invention also provides a heterogeneous rule matching apparatus for implementing the heterogeneous rule matching method described in the first aspect, the heterogeneous rule matching apparatus comprising:

[0043] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor for performing the heterogeneous rule matching method described in the first aspect.

[0044] Thirdly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors to perform the heterogeneous rule matching method described in the first aspect.

[0045] Unlike existing technologies, the present invention has at least the following beneficial effects:

[0046] This invention solves the problem of poor code reusability for pre-defined rule data with similar heterogeneous matching rules by abstracting information such as rule hierarchy into a rule model. Based on specific pre-defined rule data, a tree structure is used to construct the rule model. By constructing a rule filter, matching efficiency is improved. During matching, matching is performed only according to the rule model and the logical relationships within it, avoiding the need to traverse all rules sequentially using all the original data to be matched, resulting in higher matching efficiency.

[0047] Furthermore, this invention integrates and categorizes the predetermined rule data by constructing an index, thereby further improving matching efficiency and reducing the probability of matching errors. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0049] Figure 1 This is a flowchart illustrating a heterogeneous rule matching method according to an embodiment of the present invention;

[0050] Figure 2 This is an example of a rule hierarchy structure for network management alarm blocking rules provided in an embodiment of the present invention;

[0051] Figure 3 This is a schematic diagram of the specific process of step 10 in an embodiment of the present invention;

[0052] Figure 4 This is a schematic diagram of the specific process of step 20 in an embodiment of the present invention;

[0053] Figure 5 This is a schematic diagram of the specific process of step 40 in an embodiment of the present invention;

[0054] Figure 6 This is a schematic diagram of the specific process of step 402 in an embodiment of the present invention;

[0055] Figure 7 This is a data conversion diagram of a heterogeneous rule matching method according to an embodiment of the present invention;

[0056] Figure 8 This is a schematic diagram of the architecture of a heterogeneous rule matching device provided in an embodiment of the present invention. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0058] In the description of this invention, the terms "inner", "outer", "longitudinal", "lateral", "upper", "lower", "top", "bottom", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and do not require that this invention must be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0059] In this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0060] Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0061] Example 1:

[0062] Existing rule-based matching methods first define specific conditions for each rule based on the complexity of the data to be matched. For each condition, a range of limitations is defined, and the data field to be compared is specified. After the rules are formulated, they are developed and deployed. Next, at least one rule is created, data is added to the rules' conditions, and the rules are saved in the system backend. Finally, when data is retrieved from the system backend, for each data point, the rules are iterated and matched. When matching a rule, the data is compared sequentially with each condition in the rule. If any condition is not met, the rule is not matched. Here, the system backend refers to the website backend, used to manage a series of operations on the website frontend.

[0063] Existing rule models do not support the reuse of heterogeneous rules and have poor scalability. Each time a new rule is added, all rule matching algorithms need to be redeveloped. This is especially problematic when matching a large number of heterogeneous rules with fixed judgment methods. Repeatedly developing and rewriting the code containing the matching algorithm for each rule would consume enormous human and material resources. Furthermore, existing technologies compare data sequentially with each condition in the rule, resulting in low matching efficiency. In real-world business scenarios, many matching rules contain the same sub-expressions. If data is repeatedly compared with each condition in the rule, resulting in repeated matching of the same sub-expressions, this ineffective computation leads to wasted performance and a significant drop in rule matching performance. The impact of this significant drop in rule matching performance on actual business operations is not negligible. For example, in security analysis scenarios, a decline in rule matching performance may cause delays in real-time alerts.

[0064] To address the aforementioned problems, Embodiment 1 of the present invention provides a heterogeneous rule matching method, such as... Figure 1 As shown, this heterogeneous rule matching method includes:

[0065] Step 10: Construct a rule filter based on at least one predefined rule data and rule model.

[0066] The rule hierarchy is abstracted into a rule model, which represents the hierarchical structure of matchable conditions within a rule. A tree-like structure is used to construct the rule model, realizing the abstract rule hierarchy. The top level of the tree is a virtual node, under which all conditions are constructed, i.e., they are all child nodes of this virtual node. The system backend provides users with input condition options based on the rule model and generates predefined rule data based on the user input. Depending on the rule model and the predefined rule data, the conditions in the rule data are integrated into different rule filters. Matching is performed using these rule filters to improve data matching efficiency.

[0067] Step 20: Based on the rule model, convert the original data to be matched into at least one intermediate data point. The user-inputted original data to be matched is organized and transformed to facilitate unified matching using the rule model. Steps 20 and 10 can be performed in parallel and are not mutually restrictive.

[0068] Step 30: Match the intermediate data with the rule filter to obtain an intermediate rule list for each piece of intermediate data.

[0069] The intermediate data includes a condition identifier and a matching attribute value. Each index data in the rule filter includes a condition identifier, and each index data in the first index set of the rule filter also includes a condition attribute value. Based on the matching situation between the condition identifier and / or the matching attribute value and the condition attribute value, the corresponding index data for each piece of intermediate data can be determined. Each index data corresponds to a rule list, thus obtaining an intermediate rule list for each piece of intermediate data. The condition identifier is set by those skilled in the art according to the needs of specific application scenarios and is not specifically limited here. In an optional embodiment, a condition ID is used as the condition identifier.

[0070] That is, the rule filter is traversed and searched using the condition identifier and the matching attribute value as keywords to obtain an intermediate rule list for each piece of intermediate data. The keywords include, but are not limited to, data types and matching algorithms, etc., which are not specifically limited here. The intermediate rule list contains the rule ID of the rule that matches each piece of intermediate data.

[0071] Step 40: Determine the logical relationship between the corresponding intermediate data according to the rule model, perform logical operations on the corresponding intermediate rule list according to the logical relationship, and determine the target rule list that matches the original data.

[0072] The logical relationships include logical OR and logical AND relationships. According to the rule model, the hierarchy of intermediate data below the original data can be determined. Then, logical operations are performed on the corresponding intermediate rule lists according to the logical relationships and the hierarchy of intermediate data to obtain a rule list matching the original data. Finally, the target rule list is obtained based on the rule list. The rule list contains the rule IDs of the matching rules, and the target rule list contains information about the specific matching rules.

[0073] This invention solves the problem of poor code reusability for pre-defined rule data with similar heterogeneous matching rules by abstracting information such as rule hierarchy into a rule model. Based on specific pre-defined rule data, a tree structure is used to construct the rule model. By constructing a rule filter, matching efficiency is improved. During matching, matching is performed only according to the rule model and the logical relationships within it, avoiding the need to traverse all rules sequentially using all the original data to be matched, resulting in higher matching efficiency.

[0074] To better illustrate the heterogeneous rule matching method of this invention, the following further explains the process of constructing a rule model using the heterogeneous rule matching method of this embodiment. Specifically, the user analyzes the rule information formulated according to business needs, fills in the relevant parameters of the rule model in the system backend, and defines each node of the rule model in the rule model file to construct the rule model. Using a tree-structured parent-child node relationship to define the rule model realizes the division of the rule hierarchy in the rule information, greatly improving the convenience of adding or removing layers from the heterogeneous rule model. By dividing conditions into various rule levels, using a tree-structured parent-child node to associate multiple conditions, and supporting the setting of logical relationships between conditions, the processing flow of complex rules is modeled when matching heterogeneous rules, simplifying the logical relationships between conditions with fixed judgment methods, reducing the probability of matching errors, and improving matching efficiency. Furthermore, the newly added rules can reuse the filtering mechanism of the current rules. That is, the code is universal when the hierarchical structure is added or removed. Only a node needs to be added to the file that defines the rule model, and the parent node and its logical relationship (i.e. the hierarchical relationship of the condition), the data type that the node needs to match and the matching algorithm need to be defined, thus avoiding the need to rewrite all the code involving the hierarchy.

[0075] like Figure 2As shown, the heterogeneous rule matching method of this invention provides an example of a rule hierarchy structure for network management alarm masking rules. In level 0, the root node is a virtual node. The node data in non-leaf nodes includes the name of the condition and the logical relationship between nodes. The node data in leaf nodes includes the name of the condition, facilitating the subsequent retrieval of node data matching the condition data and intermediate data in the rule model. The root node's child nodes are the three nodes in level 1, containing node data corresponding to alarm conditions and their corresponding logical AND relationships, alarm sources and their corresponding logical OR relationships, and alarm times and their corresponding logical AND relationships. In level 1, nodes containing alarm conditions correspond to three child nodes, containing alarm code, alarm level, and alarm type, respectively. Nodes containing alarm sources correspond to two child nodes, containing a network element list and an object list, respectively. Nodes containing alarm times correspond to three child nodes, containing a time range, a date range, and a weekday range, respectively. By analyzing the rule information of network management alarm blocking, the logical rule hierarchy is abstracted into a specific network management alarm blocking rule model based on the rule information. This improves the matching efficiency of alarm blocking rules, thereby enhancing alarm processing efficiency. Furthermore, for heterogeneous rules with the same judgment method as network management alarm blocking rules, such as intermittent alarm blocking rules and critical alarm prompting rules, the network management alarm blocking rule model can be reused.

[0076] The rule model file contains definitions for each condition, condition labels, data types, matching algorithms, parent-child relationships between conditions, and logical relationships between parent and child conditions. Those skilled in the art can use the name or identifier of the condition entered by the user as the condition label, depending on the specific use case. When a user enters a condition definition in the system backend, the system automatically assigns a condition identifier to facilitate its retrieval. Data types include, but are not limited to, the following: bool, int, short, long, string, char, int64, date, and custom data structures. If a custom data structure is used, its definition must include: member variable name, type, and default value.

[0077] Matching algorithms include: equal to, greater than, less than, greater than or equal to, less than or equal to, containment, range, and custom. Among these, the range condition requires setting a maximum and minimum value; the matching condition is: greater than or equal to (>=) the minimum value, and less than or equal to (<=) the maximum value. If only one value is set (e.g., equal to), only the set value needs to be judged. Those skilled in the art can also choose other custom matching algorithms based on these matching algorithms without creative effort. When a first condition and a second condition exist, and the first condition and the second condition have a containment relationship, the intersection of the range of the first condition and the range of the second condition is taken. For example, in a network management alarm blocking rule, the alarm date and alarm time are two different ranges. The alarm date range is from a specific year, month, and day to a specific year, month, and day, and the alarm time range is from a specific hour, minute, and second to a specific hour, minute, and second. Since the alarm time contains the alarm date, the intersection of these two ranges is taken.

[0078] Logical relations include AND and OR relations. An AND relation means that if all conditions of a child node match, the condition of its parent node also matches; an OR relation means that if at least one child node's condition matches, the condition of its parent node also matches. Note that leaf nodes in a rule model do not have child nodes, meaning they have no child conditions.

[0079] After the rule model is constructed, multiple corresponding rule filters can be built based on the rule model and different predefined rule data to facilitate the expansion of the rule model and the reuse of a single codebase. To better illustrate the heterogeneous rule matching method of this invention, step 10 of the heterogeneous rule matching method in this embodiment will be further refined below. Specifically, as follows... Figure 3 As shown, step 20 includes:

[0080] Step 101: Obtain the condition data and rule ID for each of the predetermined rule data, wherein the condition data includes condition tags and condition attribute values, and the rule ID is automatically assigned based on the predetermined rule data.

[0081] The system backend provides users with input options based on a rule model and generates predefined rule data based on the user's input. When a user enters a predefined rule in the system backend, the system automatically assigns a rule ID to that rule for easy retrieval. Users can choose to leave the input options blank or enter at least one corresponding condition attribute value. The condition attribute value is a single value or a range corresponding to the input option. Based on the user's input, the system backend retrieves at least one predefined rule, including but not limited to the rule ID, condition label, and condition attribute value.

[0082] The condition label can be either the name of the condition or the identifier of the condition.

[0083] Step 102: In the rule model, determine the condition identifier that matches the condition data based on the condition label.

[0084] If the condition label is the name of the condition, then the search is performed using the name of the condition as the key to obtain the corresponding node data. This node data includes the condition identifier, and thus the condition identifier is obtained.

[0085] If the condition label is a condition identifier, then the search is performed using the condition identifier number as the key to obtain the corresponding condition identifier.

[0086] Among them, the condition label refers to the condition data in the predefined rule data, while the condition identifier refers to the node data in the rule model.

[0087] Following the aforementioned method, node data that matches the conditional data can be found in the rule model.

[0088] Step 103: If the condition attribute value is not empty, then the index data is constructed using the condition identifier and the condition attribute value as keywords and the rule ID set as index value, and the index data is assigned to the first index set; if the condition attribute value is empty, then the index data is constructed using the condition identifier as keywords and the rule ID set as index value, and the index data is assigned to the second index set; wherein, each predetermined rule data corresponds to at least one index data.

[0089] Since users need to either not input or input at least one corresponding condition attribute value based on the input options provided by the system backend, it is determined whether the condition attribute value obtained in step 201 is empty. A list of condition identifiers that need to be matched or a list of condition identifiers that do not need to be matched (default) is selectively obtained. An index is built based on the corresponding list of condition identifiers, and the predefined rule data is classified and cached.

[0090] If the user-input condition attribute value is not empty, it indicates that the condition needs to be matched. Based on the data type, condition identifier, condition attribute value, and matching algorithm obtained in step 101, index data is constructed and assigned to the first index set. This facilitates subsequent matching of conditions that need to be matched based on the first index set. If the user-input condition attribute value is empty, it indicates that the condition does not need to be matched. Based on the condition identifier and rule ID obtained in step 101, index data is constructed and assigned to the second index set. This facilitates subsequent direct determination of conditions that do not need to be matched based on the second index set, improving the efficiency of heterogeneous rule matching and avoiding the need to iterate through each rule sequentially during matching. This is especially beneficial for scenarios where most data should not be filtered during a single overall matching process, such as matching network management alarm blocking rules. By avoiding matching all rules, matching efficiency is greatly improved, and the impact of the matching process on actual business operations is reduced.

[0091] This process involves determining whether identical conditional data exists among different predefined rule data. If so, the rule ID of the predefined rule data with identical conditional data is obtained to generate multiple rule IDs corresponding to the identical conditional data. A rule ID set is then constructed based on these multiple rule IDs. This allows a single index key to correspond to the rule IDs of all identical conditional data within the predefined rule data, improving matching efficiency.

[0092] Those skilled in the art can choose other indexing algorithms without inventive effort. In an optional embodiment, at least one conditional attribute value corresponding to each conditional identifier is traversed. During each traversal, a conditional attribute value is obtained. The conditional identifier, conditional attribute value, data type, and matching algorithm corresponding to the conditional attribute value are used as the key of the first index, and the rule ID corresponding to the conditional attribute value is used as the index value of the first index, thus constructing a first index. Where there is an intersection between the sets of conditional attribute values ​​corresponding to the same conditional identifier in different rules, the union of all sets of conditional attribute values ​​is traversed. During each traversal, a conditional attribute value is obtained, and a first index is constructed. When two first indices have the same key but different index values, these two first indices are merged into one first index, so that this first index corresponds to two index values.

[0093] When matching with the rule filter, the corresponding matching rule list is retrieved from the first index set based on the condition identifier and the condition attribute value. The corresponding default rule list is retrieved from the second index set based on the condition identifier. The matching rule list and the default rule list are combined to obtain the intermediate rule list of the intermediate data. The matching rule list contains the list of condition identifiers that need to be matched, and the default rule list contains the list of condition identifiers that do not need to be matched (by default). Keywords are then obtained from the intermediate data and matched against the condition identifier, condition attribute value, data type, and matching algorithm in the rule filter.

[0094] Step 104: Integrate the first index set and the second index set into the rule filter.

[0095] Existing technologies do not perform further processing on the caching of predetermined rule data; they simply cache the predetermined rule data directly. As the amount and complexity of data increase, the disorder of the cached information grows exponentially. The heterogeneous rule matching method of this invention improves matching efficiency by constructing an index to integrate and categorize the predetermined rule data. Furthermore, the larger the amount and / or the higher the complexity of the predetermined rule data, the greater the reduction in the probability of matching errors, resulting in a greater improvement in matching efficiency.

[0096] The system backend transforms the raw data input by the user into intermediate data based on the rule model to facilitate subsequent matching. To better illustrate the heterogeneous rule matching method of this invention, step 20 of the heterogeneous rule matching method in this embodiment will be further refined below. Specifically, as follows... Figure 4 As shown, step 20 includes:

[0097] Step 201: Obtain at least one matching data entry from the original data, wherein the matching data includes a matching tag and a matching attribute value. The system backend provides the user with conditional options for inputting corresponding data based on the rule model. The original data is a collection of data input by the user based on each conditional option; the system backend integrates the original data into at least one matching data entry according to the corresponding rule model. During integration, the system backend automatically assigns a matching data ID to the matching data entry. The definition of a matching tag is the same as that of a conditional tag, the only difference being that the matching tag is the conditional tag selected by the user to be matched, and subsequent matching is performed using the matching tag and the conditional tag; the definition of a matching attribute value is the same as that of a conditional attribute value, the only difference being that the matching attribute value is the conditional attribute value selected by the user to be matched, and subsequent matching is performed using the matching attribute value and the conditional attribute value.

[0098] Step 202: Obtain the condition identifier corresponding to the matching tag from the rule model. The system backend obtains, but is not limited to, the condition identifier, matching attribute value, data type, and matching algorithm based on user input.

[0099] Step 203: Construct the intermediate data based on the condition identifier and the matching attribute value.

[0100] After obtaining the rule filter and intermediate data, the intermediate data and rule filter can be matched to obtain a list of matching target rules. To better illustrate the heterogeneous rule matching method of the present invention, step 30 of the heterogeneous rule matching method of the embodiment of the present invention will be further described below. Specifically, the heterogeneous rule matching method of the embodiment of the present invention uses a rule model to divide the hierarchical structure of the matchable conditions in the rules. A specific condition in a rule is a node in the rule model. Only the conditions of the leaf nodes are the conditions that ultimately need to be matched with the data. Therefore, it is necessary to traverse and search for the list of matching rules in the rule filter.

[0101] The matching logic for a leaf node is as follows: First, based on the data type, condition identifier, condition attribute value, and matching algorithm, search for a matching rule in the first index set. If a matching rule exists, return the corresponding rule list; otherwise, return empty. Then, based on the condition identifier, search for a matching rule in the second index set. If a matching rule exists, return the corresponding rule list; otherwise, return empty. Finally, combine the rule lists found in the first and second index sets to obtain the rule list for that leaf node. By setting a second index set and combining the rule lists matched by the first and second index sets, conditions that do not require matching can be directly determined (by default, the rule list matched by the second index set is matched, without needing to match based on data type, condition identifier, condition attribute value, and matching algorithm).

[0102] To better illustrate the heterogeneous rule matching method of the present invention, step 40 of the heterogeneous rule matching method of the embodiment of the present invention will be further refined below. Specifically, as follows: Figure 5 As shown, step 40 includes:

[0103] Step 401: Traverse from the root node of the rule model to the leaf nodes.

[0104] The following is based on Figure 2Taking the illustrated rule hierarchy as an example, step 40 will be explained. Those skilled in the art can choose other traversal algorithms based on specific application scenarios without inventive effort. In an optional embodiment, breadth-first traversal is used. First, the node data of the three nodes in level 1 is traversed, and then, based on the matching results of level 1, the nodes in level 2 are traversed to find node data that matches the intermediate data.

[0105] Step 402: If the current node being traversed is not a leaf node, obtain the logical relationship of the current node, find the child nodes of the current node, determine the intermediate data corresponding to the child nodes, and determine the rule list of the current node based on at least one intermediate data.

[0106] For example, taking the node in level 1 whose node data contains alarm conditions as the current node, since it is not a leaf node, the corresponding logical relation is obtained as a logical AND relation. Then, the corresponding child nodes in level 2 are found, namely, those containing alarm code, alarm level, and alarm type. Based on the name of the condition in the node data, the condition identifier contained in that node data is found, and the intermediate data corresponding to the three child nodes is determined to determine the rule list of the current node. Each node's node data also contains a condition identifier; if the condition label in the node data is not the name of the condition but a condition identifier, the corresponding intermediate data is directly determined based on the condition identifier.

[0107] Step 403: If the current node being traversed is a leaf node, obtain the node ID corresponding to the leaf node, determine the corresponding intermediate data based on the node ID, and use the intermediate rule list corresponding to the intermediate data as the rule list for the leaf node. For example, taking the node in level 2 whose node data contains an alarm code as the current node, since it is a leaf node, obtain the corresponding node ID, match it with the condition identifier of the intermediate data based on the node ID, and search the rule list matching the current node in the rule filter.

[0108] Step 404: Obtain the rule list of the root node, and obtain the target rule list based on the rule list of the root node.

[0109] For example, based on the rule lists of the leaf nodes in level 2 and the logical relationships between each leaf node in level 2 and its corresponding node in level 1, logical operations are performed on the corresponding rule lists to obtain the rule lists of the nodes in level 1; based on the rule lists of the leaf nodes in level 1 and the logical relationships between each node in level 1 and its corresponding root node, logical operations are performed on the corresponding rule lists to obtain the rule list of the root node; based on the rule IDs in the rule list of the root node, the target rule list that matches the original data is determined.

[0110] The heterogeneous rule matching method of this invention, by modeling the matching algorithm, makes the matching algorithm within the sub-conditions clear and explicit, increases the readability of the code, and facilitates understanding, reuse, and subsequent modification and expansion.

[0111] To better illustrate the heterogeneous rule matching method of the present invention, step 402 of the heterogeneous rule matching method in the embodiment of the present invention will be further refined below, such as... Figure 6 As shown, step 402 includes:

[0112] Step 4021: Obtain the logical relationship of the current node and find the child nodes of the current node.

[0113] Step 4022: Obtain the node ID corresponding to the child node, and determine the corresponding intermediate data based on the node ID. Specifically, the node ID is matched with the condition identifier of the intermediate data to determine the corresponding intermediate data.

[0114] Step 4023: Obtain the intermediate rule list corresponding to the intermediate data, and use the intermediate rule list as the rule list of the child node. The intermediate rule list corresponding to the intermediate data is the rule list of the corresponding leaf node.

[0115] Step 4024: Perform logical operations on the rule list of the child node according to the logical relationship to obtain the rule list of the current node.

[0116] When the logical relationship is AND, the rule lists of the child nodes are combined to obtain the rule list of the current node. When the logical relationship is OR, the rule lists of the child nodes are intersected to obtain the rule list of the current node.

[0117] The matching logic for a node is as follows: Obtain the list of child nodes (all child nodes of the node) and the logical relationship between the node and its child nodes. If the node has no child nodes and is a leaf node, proceed to step 40. If the node has child nodes and the logical relationship is: if all conditions of the child nodes match, the condition of the parent node matches (AND), then recursively search the rule list of each child node and take the intersection of the rule lists of the child nodes to obtain the rule list of the node itself. If the node has child nodes and the logical relationship is: if the condition of one child node matches, the condition of the parent node matches (OR), then recursively search the rule list of each child node and take the union of the rule lists of the child nodes to obtain the rule list of the node itself.

[0118] After matching is complete, the root node's rule list is obtained. If the list is empty, it means no rules were matched. If the list is not empty, the corresponding target rule list is obtained based on the rule list.

[0119] A rule model is used to define the specific hierarchical structure of conditions in rules, and an index is built on the data to obtain rule filters. During data matching, the data is transformed into intermediate data, and a list of target rules for matching is obtained through the rule filters.

[0120] The heterogeneous rule matching method of this invention can generate different rule models based on different rule conditions without rewriting code, enabling rapid modification of old rules and construction of new rules, and increasing the reusability of rule changes. It integrates rule conditions into a single rule filter, improving data matching efficiency. Furthermore, it integrates rule conditions, constructs an index, and categorizes and stores them, making it more suitable for complex data. Existing technologies have a tight integration between rule matching and specific rule models, requiring separate code for each rule and necessitating the traversal of all rules for matching. This solution, however, requires no modification to the core matching algorithm; during matching, it avoids traversing all rules for all data, only matching based on the rule model, resulting in higher data matching efficiency.

[0121] Example 2:

[0122] Based on the above embodiment 1, this embodiment of the invention provides a specific example of a heterogeneous rule matching method to better understand the entire matching process.

[0123] Step S1: Construct a rule model based on the rule hierarchy structure input by the user.

[0124] Users analyze business requirements to determine the rules to be judged and define the hierarchical structure of the rule conditions. These are: alarm_condition, alarm_time, alarm_code, alarm_level, time, and week. The logical relationships between alarm_condition and alarm_time are AND; alarm_condition and alarm_code are OR; alarm_condition and alarm_level are OR; alarm_time and time are AND; and alarm_time and week are AND. alarm_code, alarm_level, time, and week are the specific conditions to be matched. alarm_code is an int and the matching algorithm is equal; alarm_level is an int and the matching algorithm is equal; time is a range and the matching algorithm is range; week is an int and the matching algorithm is equal. The matching algorithm is equal, which means that the matching attribute value must be equal to the condition attribute value; the matching algorithm is range, which means that the matching attribute value must be greater than or equal to the starting value of the condition attribute value (>=) and less than or equal to the ending value of the condition attribute value (<=).

[0125] Construct the rule model file shown below, where the rule model is defined using an XSD (XML Schema Definition) file, the specific content of which is as follows:

[0126]

[0127]

[0128] The rule model defines 7 nodes, with `top_condition` as the root node and `alarm_code`, `alarm_level`, `time`, and `week` as leaf nodes. `top_condition` contains child nodes `alarm_condition` and `alarm_time`, with a logical AND relationship between parent and child nodes; `alarm_condition` contains child nodes `alarm_code` and `alarm_level`, with a logical OR relationship between parent and child nodes; and `alarm_time` contains child nodes `time` and `week`, with a logical AND relationship between parent and child nodes.

[0129] Step S2: Construct a rule filter based on the rule data and rule model.

[0130] The system backend retrieves the following three rule data points from the user input:

[0131] Rule 1, the condition data are: condition label alarm_code, corresponding to 7 condition attribute values ​​of 1, 2, 3, 4, 5, 6, 7 respectively; condition label alarm_level, corresponding to 3 condition attribute values ​​of 1, 2, 3 respectively; condition label time, corresponding to an empty condition attribute value; condition label week, corresponding to 3 condition attribute values ​​of 0, 1, 2 respectively.

[0132] Rule 2, the condition data are: condition label alarm_code, corresponding to 4 condition attribute values ​​of 1, 2, 3, 20 respectively; condition label alarm_level, corresponding to 2 condition attribute values ​​of 1, 4 respectively; condition label time, corresponding to 1 condition attribute value of 0 to 3600; condition label week, corresponding to 2 condition attribute values ​​of 0, 1 respectively.

[0133] Rule 3, the condition data are: condition label alarm_code, corresponding condition attribute value is empty; condition label alarm_level, corresponding condition attribute value is empty; condition label time, corresponding to 1 condition attribute value from 0 to 7200; condition label week, corresponding condition attribute value is empty.

[0134] Based on the condition tags in Rules 1, 2, and 3 where the condition attribute value is not empty, construct Index 1:

[0135] Index 1key1: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 1, Index value: 1, 2;

[0136] Index 1 key2: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 2, Index value: 1, 2;

[0137] Index 1key3: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 3, Index value: 1, 2;

[0138] Index 1key4: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 4, Index value: 1;

[0139] Index 1key5: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 5, Index value: 1;

[0140] Index 1key6: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 6, Index value: 1;

[0141] Index 1key7: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 7, Index value: 1;

[0142] Index 1key8: Data type int, Condition ID 4, Matching algorithm equal, Condition attribute value 20, Index value: 2;

[0143] Index 1key9: Data type int, Condition ID 5, Matching algorithm equal, Condition attribute value 1, Index value: 1, 2;

[0144] Index 1key10: Data type int, Condition ID 5, Matching algorithm equal, Condition attribute value 2, Index value: 1;

[0145] Index 1key11: Data type int, Condition ID 5, Matching algorithm equal, Condition attribute value 3, Index value: 1;

[0146] Index 1key12: Data type int, Condition ID 5, Matching algorithm equal, Condition attribute value 4, Index value: 2;

[0147] Index 1key13: Data type range, Condition ID 6, Matching algorithm range, Condition attribute value 0~3600, Index value: 2, 3;

[0148] Index 1key14: Data type range, Condition ID 6, Matching algorithm range, Condition attribute value 3601~7200, Index value: 3;

[0149] Index 1key15: Data type int, Condition ID 7, Matching algorithm equal, Condition attribute value 0, Index value: 1, 2;

[0150] Index 1key16: Data type int, Condition ID 7, Matching algorithm equal, Condition attribute value 1, Index value: 1, 2

[0151] Index 1key17: Data type int, Condition ID 7, Matching algorithm equal, Condition attribute value 2, Index value: 1.

[0152] Based on the condition tags in Rules 1, 2, and 3 whose condition attribute values ​​are empty, construct Index 2:

[0153] Index 2key1: Condition ID 4, Index value: 3;

[0154] Index 2key2: Condition ID 5, Index value: 3;

[0155] Index 2key3: Condition ID 6, Index value: 1;

[0156] Index 2key4: Condition ID 7, Index value: 3.

[0157] In the rule model file, the "node ID" is described using "id", while the "rule ID" is described using "index value".

[0158] Step S3: The system backend processes and transforms the raw data to be matched input by the user to obtain intermediate data.

[0159] The user inputs the following raw data to be matched:

[0160] Data 1 is described as follows: The matching tag `alarm_code` has a corresponding attribute value of 1; the matching tag `alarm_level` has a corresponding attribute value of 1; the matching tag `time:` has a corresponding attribute value of 0; and the matching tag `week` has a corresponding attribute value of 0.

[0161] The intermediate data obtained is as follows:

[0162] Intermediate Data 1: Data type int, condition ID 4, matching attribute value 1, matching algorithm equal;

[0163] Intermediate data 2: Data type int, condition ID 5, matching attribute value 1, matching algorithm equal;

[0164] Intermediate data 3: Data type int, Condition ID 6, Matching attribute value 0, Matching algorithm range;

[0165] Intermediate data 4: data type int, condition ID 7, matching attribute value 0, matching algorithm equal.

[0166] Step S4: Match the intermediate data with the rule filter to obtain a list of target rules that meet the rules.

[0167] The list of rules for obtaining leaf nodes is as follows:

[0168] Intermediate data 1 corresponds to condition ID 4. Searching index 1 key1 yields rule list 1 and 2. Searching index 2 key1 yields rule list 3. Taking the set of rule lists, we get the final intermediate rule list 1, 2, and 3.

[0169] Intermediate data 2 corresponds to condition ID 5. Searching index 1 key9 yields rule list 1 and 2. Searching index 2 key2 yields rule list 3. Taking the sum of the rule lists, we get the final intermediate rule list 1, 2, and 3.

[0170] Intermediate data 3 corresponds to condition ID 6. Searching index 1 key13 yields rule list 2 and 3. Searching index 2 key3 yields rule list 1. Taking the set of rule lists, we get the final intermediate rule list 1, 2, and 3.

[0171] Intermediate data 4 corresponds to condition ID 7. Searching index 1 key15 yields rule list 1 and 2. Searching index 2 key4 yields rule list 3. Taking the set of rule lists, we get the final intermediate rule list 1, 2, and 3.

[0172] Since alarm_condition contains child nodes alarm_code and alarm_level, and the logical relationship between the parent and child nodes is OR, the resulting rule list is 1, 2, 3;

[0173] alarm_time contains child nodes time and week, and the logical relationship between parent and child nodes is AND, resulting in a rule list of 1, 2, 3;

[0174] The top_condition contains child nodes alarm_condition and alarm_time. The logical relationship between the parent and child nodes is AND, resulting in a list of rules 1, 2, and 3.

[0175] That is, the final list of rules that match data 1 is 1, 2, and 3, and the corresponding target rule list is obtained based on the rule list.

[0176] At this point, the user enters another piece of raw data to be matched.

[0177] Step S3: The user inputs the following raw data to be matched:

[0178] Data 2 is described as follows: it matches the tag alarm_code with a matching attribute value of 10; it matches the tag alarm_level with a matching attribute value of 4; it matches the tag time with a matching attribute value of 10000; and it matches the tag week with a matching attribute value of 4.

[0179] The intermediate data obtained is as follows:

[0180] Intermediate data 1: Data type int, condition ID 4, matching attribute value 10, matching algorithm equal;

[0181] Intermediate data 2: Data type int, condition ID 5, matching attribute value 4, matching algorithm equal;

[0182] Intermediate data 3: Data type int, Condition ID 6, Matching attribute value 10000, Matching algorithm range;

[0183] Intermediate data 4: data type int, condition ID 7, matching attribute value 4, matching algorithm equal.

[0184] Step S4: The following is the list of rules for the leaf nodes:

[0185] Intermediate data 1 corresponds to condition ID 4. No data was found at index 1. Search for index 2 key1 to get rule list 3. Take the set of rule lists to get the final intermediate rule list 3.

[0186] Intermediate data 2 corresponds to condition ID 5. Searching index 1 key12 yields rule list 2. Searching index 2 key2 yields rule list 3. Taking the sum of the rule lists, we get the final intermediate rule lists 2 and 3.

[0187] Intermediate data 3 corresponds to condition ID 6. No data was found at index 1. Search for index 2 key3 to get rule list 1. Take the set of rule lists to get the final intermediate rule list 1.

[0188] Intermediate data 4 corresponds to condition ID 7. No data was found at index 1. Searching at index 2 key4 yields rule list 3. Taking the set of rule lists, we get the final intermediate rule list 3.

[0189] The alarm_condition contains child nodes alarm_code and alarm_level. The logical relationship between the parent and child nodes is OR, resulting in rule lists 2 and 3.

[0190] alarm_time contains child nodes time and week, and the logical relationship between parent and child nodes is AND, resulting in an empty rule list;

[0191] The top_condition contains child nodes alarm_condition and alarm_time. The logical relationship between the parent and child nodes is AND, resulting in an empty rule list.

[0192] That is, the final target rule list for data 2 is empty, and there are no rules to match.

[0193] Example 3:

[0194] like Figure 8The diagram shown is an architectural schematic of a heterogeneous rule matching device according to an embodiment of the present invention. The heterogeneous rule matching device according to an embodiment of the present invention includes one or more processors 31 and a memory 32. Figure 8 Take a processor 31 as an example.

[0195] Processor 31 and memory 32 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.

[0196] The memory 32, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the heterogeneous rule matching method in Embodiment 1. The processor 31 executes the heterogeneous rule matching method by running the non-volatile software program and instructions stored in the memory 32.

[0197] Memory 32 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 32 may optionally include memory remotely located relative to processor 31, which can be connected to processor 31 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0198] The program instructions / modules are stored in the memory 32. When executed by one or more processors 31, they perform the heterogeneous rule matching method described in Embodiment 1 above, for example, the method described above. Figure 1 and Figures 3-7 The steps shown.

[0199] It is worth noting that the information interaction and execution process between the modules and units in the above-mentioned device and system are based on the same concept as the processing method embodiment of the present invention. For details, please refer to the description in the method embodiment of the present invention, and will not be repeated here.

[0200] Those skilled in the art will understand that all or part of the steps in the various methods of the embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

[0201] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A heterogeneous rule matching method, characterized in that, include: Construct a rule filter based on at least one predefined rule data and a rule model; Based on the rule model, the original data to be matched is converted into at least one intermediate data. The intermediate data is matched with the rule filter to obtain an intermediate rule list for each piece of intermediate data; Based on the rule model, determine the logical relationship between the corresponding intermediate data, perform logical operations on the corresponding intermediate rule list based on the logical relationship, and determine the target rule list that matches the original data. The rule model is a network management alarm masking rule model. The rule hierarchy is abstracted into a rule model, which is a hierarchical structure of matchable conditions within a rule. A tree structure is used to construct the rule model. In level 0 of the tree structure, the root node is a virtual node. The node data in non-leaf nodes includes the name of the condition and the logical relationship between nodes. The node data in leaf nodes includes the name of the condition. The child nodes of the root node are the three nodes in level 1, containing node data for alarm conditions and their corresponding logical AND relationship, alarm sources and their corresponding logical OR relationship, and alarm times and their corresponding logical AND relationship. In level 2, the node data for alarm conditions corresponds to three child nodes, containing node data for alarm code, alarm level, and alarm type. The node data for alarm sources in level 2 corresponds to two child nodes, containing node data for a network element list and an object list, respectively. The node data for alarm times in level 2 corresponds to three child nodes, containing node data for a time range, a date range, and a weekday range, respectively. The system backend provides users with input-friendly conditional options based on the rule model, and the predetermined rule data is generated based on the user's input data; The intermediate data includes condition identifiers and matching attribute values; The step of constructing a rule filter based on at least one predetermined rule data and the rule model includes: obtaining condition data and a rule ID for each predetermined rule data, wherein the condition data includes a condition tag and a condition attribute value, and the rule ID is automatically assigned based on the predetermined rule data; in the rule model, determining a condition identifier that matches the condition data based on the condition tag; if the condition attribute value is not empty, constructing index data using the condition identifier and the condition attribute value as keywords and the rule ID set as index value, and assigning the index data to a first index set; if the condition attribute value is empty, constructing index data using the condition identifier as keywords and the rule ID set as index value, and assigning the index data to a second index set; wherein each predetermined rule data corresponds to at least one index data; and integrating the first index set and the second index set into the rule filter.

2. The heterogeneous rule matching method according to claim 1, characterized in that, The process of constructing the rule ID set includes: Determine whether there is identical condition data in different predetermined rule data; If it exists, obtain the rule ID of the predefined rule data with the same condition data to obtain multiple rule IDs corresponding to the same condition data, and construct a rule ID set based on the multiple rule IDs.

3. The heterogeneous rule matching method according to claim 1, characterized in that, The step of matching the intermediate data with the rule filter to obtain an intermediate rule list for each piece of intermediate data includes: Based on the condition identifier and the matching attribute value, the corresponding matching rule list is retrieved from the first index set; Based on the condition identifier, the corresponding default rule list is retrieved from the second index set; The intermediate rule list of the intermediate data is obtained by combining the matching rule list and the default rule list.

4. The heterogeneous rule matching method according to claim 1, characterized in that, The step of converting the original data to be matched into at least one intermediate data point according to the rule model includes: From the original data, at least one matching data is obtained, wherein the matching data includes a matching tag and a matching attribute value; Based on the matching tag, the condition identifier corresponding to the matching tag is obtained from the rule model; The intermediate data is constructed based on the condition identifier and the matching attribute value.

5. The heterogeneous rule matching method according to claim 3, characterized in that, The step of matching the intermediate data with the rule filter to obtain an intermediate rule list for each piece of intermediate data includes: The rule filter is traversed and searched using the condition identifier and the matching attribute value as keywords to obtain an intermediate rule list for each piece of intermediate data.

6. The heterogeneous rule matching method according to claim 1, characterized in that, The step of determining the logical relationship between the corresponding intermediate data according to the rule model, and performing logical operations on the corresponding intermediate rule list according to the logical relationship to determine the target rule list that matches the original data includes: Traverse from the root node to the leaf node of the rule model; If the current node being traversed is not a leaf node, then obtain the logical relationship of the current node, find the child nodes of the current node, determine the intermediate data corresponding to the child nodes, and determine the rule list of the current node based on at least one intermediate data. If the current node being traversed is a leaf node, then obtain the node ID corresponding to the leaf node, determine the corresponding intermediate data based on the node ID, and use the intermediate rule list corresponding to the intermediate data as the rule list of the leaf node. Obtain the rule list of the root node, and obtain the target rule list based on the rule list of the root node.

7. The heterogeneous rule matching method according to claim 6, characterized in that, If the currently traversed node is not a leaf node, then the logical relationship of the current node is obtained, the child nodes of the current node are found, the intermediate data corresponding to the child nodes is determined, and the rule list of the current node is determined based on at least one intermediate data, including: Obtain the logical relationship of the current node and find the child nodes of the current node; Get the node ID corresponding to the child node, and determine the corresponding intermediate data based on the node ID; Obtain the intermediate rule list corresponding to the intermediate data, and use the intermediate rule list as the rule list of the child node; According to the logical relationship, logical operations are performed on the rule list of the child node to obtain the rule list of the current node.

8. The heterogeneous rule matching method according to claim 7, characterized in that, The step of performing logical operations on the rule list of the child nodes according to the logical relationship to obtain the rule list of the current node includes: When the logical relationship is an AND relationship, the intersection of the rule lists of the child nodes is taken to obtain the rule list of the current node; When the logical relationship is an OR relationship, the rule list of the child node is combined to obtain the rule list of the current node.

9. A heterogeneous rule matching device, characterized in that, It includes at least one processor and a memory, which are connected via a data bus. The memory stores instructions that can be executed by the at least one processor. After being executed by the processor, the instructions are used to perform the heterogeneous rule matching method according to any one of claims 1-8.

Citation Information

Patent Citations

  • A processing task execution method and device

    CN109445797A

  • Question distribution method and device, electronic equipment and storage medium

    CN113095788A