Rule-based execution plan generation method and apparatus, device and medium
By evaluating and sorting the predicates in the rule set, constructing an execution tree, and optimizing the rule execution order, the problem of unsatisfactory execution plan generation efficiency in existing technologies is solved, and a more efficient entity resolution process is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHENZHEN INST OF COMPUTING SCI
- Filing Date
- 2024-11-27
- Publication Date
- 2026-05-15
AI Technical Summary
Existing execution plan generators are inefficient in rule-based entity resolution, resulting in excessive computational overhead and impacting overall performance.
By evaluating the predicates in the rule set, generating a predicate ranking result, constructing an execution tree, evaluating the connecting edges, optimizing the rule execution order, and generating an efficient execution plan.
The execution order of predicates and rules has been optimized, reducing unnecessary computation and resource consumption and improving the efficiency of entity resolution.
Smart Images

Figure CN2024134778_15052026_PF_FP_ABST
Abstract
Description
Rule-based execution plan generation method, apparatus, equipment, and medium
[0001] This application is based on and claims priority to Chinese Invention Application No. 202411569287.X, filed on November 5, 2024, entitled “Rule-based Execution Plan Generation Method, Apparatus, Device and Medium”. Technical Field
[0002] This application relates to the field of big data mining technology, and in particular to a rule-based execution plan generation method, apparatus, device, and medium. Background Technology
[0003] Entity resolution refers to identifying all data points in a given dataset that point to the same real-world entity. Entity resolution methods can be broadly categorized into two types: rule-based methods and deep learning model-based methods. Rule-based entity resolution, in particular, offers advantages in efficiency and interpretability. It uses a series of rules to filter out mismatches in the dataset, thereby identifying potential matching entities. In practical applications, the efficiency of rule-based entity resolution largely depends on an effective execution plan. The execution plan determines the order in which rules are evaluated and the data processing flow, directly impacting the efficiency of entity resolution. An effective execution plan can significantly improve the speed of rule matching, reduce unnecessary computational overhead, and thus optimize overall performance. However, in practice, most existing execution plan generators produce execution plans that are not ideal in terms of performance. Therefore, optimizing the generation of execution plans to improve the efficiency of rule-based entity resolution has become a pressing issue. Summary of the Invention
[0004] In view of this, embodiments of this application provide a rule-based execution plan generation method, apparatus, device, and medium to address the problem of how to optimize the generation of execution plans to improve the efficiency of rule-based entity resolution.
[0005] In a first aspect, embodiments of this application provide a rule-based execution plan generation method, the execution plan generation method comprising:
[0006] Obtain the rules to be executed to form a rule set, and determine all the predicates in the rule set, wherein the rules to be executed include at least one predicate;
[0007] Based on the dataset to be executed, all predicates are evaluated to obtain predicate evaluation results. Based on the predicate evaluation results, all predicates are sorted to obtain predicate sorting results.
[0008] Based on the predicate sorting result, an execution tree is constructed for all rules to be executed in the rule set to obtain at least one execution tree. The execution tree includes a root node and at least one leaf node. The connecting edge between any two nodes represents a predicate. The rules to be executed correspond to N connecting edges connected sequentially in the execution tree, where N is an integer greater than zero.
[0009] Based on the dataset to be executed, each connection edge of all execution trees is evaluated to obtain edge evaluation results. Based on the edge evaluation results, the execution order of the nodes of each execution tree is sorted to obtain the rule execution plan corresponding to each execution tree.
[0010] Secondly, embodiments of this application provide a rule-based execution plan generation apparatus, the execution plan generation apparatus comprising:
[0011] An initial data module is used to acquire rules to be executed to form a rule set and to determine all predicates in the rule set, wherein the rules to be executed include at least one predicate;
[0012] The predicate sorting module is used to evaluate all predicates based on the dataset to be executed, obtain predicate evaluation results, and sort all predicates based on the predicate evaluation results to obtain predicate sorting results;
[0013] An execution tree construction module is used to construct an execution tree for all rules to be executed in the rule set according to the predicate sorting result, so as to obtain at least one execution tree. The execution tree includes a root node and at least one leaf node. The connecting edge between any two nodes represents a predicate. The rules to be executed correspond to N connecting edges connected in sequence in the execution tree, where N is an integer greater than zero.
[0014] The execution plan generation module is used to evaluate each connection edge of all execution trees based on the dataset to be executed, obtain edge evaluation results, sort the execution order of the nodes of each execution tree based on the edge evaluation results, and obtain the rule execution plan corresponding to each execution tree.
[0015] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the execution plan generation method as described in the first aspect.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the execution plan generation method as described in the first aspect.
[0017] The beneficial effects of this application embodiment compared with the prior art are as follows: This application evaluates all predicates in the rule set based on the dataset to be executed, obtains predicate evaluation results, sorts all predicates based on the predicate evaluation results, obtains predicate sorting results, constructs execution trees for all rules to be executed in the rule set based on the predicate sorting results, obtains at least one execution tree, evaluates each connection edge of the execution tree based on the dataset to be executed, obtains edge evaluation results, and sorts the execution order of the nodes of each execution tree based on the edge evaluation results, thereby obtaining the rule execution plan corresponding to each execution tree.
[0018] The process involves evaluating predicates in the rule set to determine the cost-effectiveness of each predicate on the dataset to be executed. This cost-effectiveness includes the time required to examine the predicate on the dataset (evaluation cost) and the probability of the predicate being matched (evaluation effect). Based on the evaluation results, all predicates are sorted to determine the order in which predicates in each rule to be executed are evaluated, balancing evaluation cost and evaluation effect. Based on the predicate sorting results, an execution tree is constructed from all rules to be executed. Finally, the execution tree is then processed according to the dataset to be executed. Each connection edge is evaluated, and the edge evaluation result determines the probability that each rule to be executed, composed of the connection edge, will be matched and satisfied on the dataset to be executed. Based on this probability, the order in which all rules to be executed in the rule set are evaluated is determined. Therefore, based on the edge evaluation result and the execution plan generated by the execution tree, the execution order of predicates and rules to be executed is optimized. The cost-effectiveness of the evaluation determines which predicates to evaluate first, and the evaluation effect determines which rules to evaluate first. Entity resolution is then performed based on this execution plan, which can process the dataset to be executed more efficiently, reduce unnecessary computation and resource consumption, and improve the efficiency of entity resolution. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 is a schematic diagram of an application environment for a rule-based execution plan generation method provided in Embodiment 1 of this application;
[0021] Figure 2 is a flowchart illustrating a rule-based execution plan generation method provided in Embodiment 2 of this application;
[0022] Figure 3 is a schematic diagram of an execution tree provided in Embodiment 2 of this application;
[0023] Figure 4 is a flowchart illustrating a rule-based execution plan generation method provided in Embodiment 3 of this application;
[0024] Figure 5 is a flowchart illustrating a rule-based execution plan generation method provided in Embodiment 4 of this application;
[0025] Figure 6 is a flowchart illustrating a rule-based execution plan generation method provided in Embodiment 5 of this application;
[0026] Figure 7 is a flowchart illustrating a rule-based execution plan generation method provided in Embodiment Six of this application;
[0027] Figure 8 is a schematic diagram of the structure of a rule-based execution plan generation device provided in Embodiment 7 of this application;
[0028] Figure 9 is a schematic diagram of the structure of a computer device provided in Embodiment 8 of this application. Detailed Implementation
[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] To illustrate the technical solution of this application, specific embodiments are described below.
[0031] This application provides a rule-based execution plan generation method, applicable to the application environment shown in Figure 1. The server and client communicate, with the server providing an execution plan generation service and the client triggering an execution plan generation task from the server. The client includes, but is not limited to, devices such as PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be implemented using a dedicated server or a server cluster consisting of multiple servers.
[0032] Referring to Figure 2, which is a flowchart illustrating a rule-based execution plan generation method according to Embodiment 2 of this application, the execution plan generation method is applied to the server in Figure 1. The server connects to the client to obtain the rule set sent by the client. As shown in Figure 2, the execution plan generation method may include the following steps:
[0033] Step S201: Obtain the rules to be executed to form a rule set, and determine all predicates in the rule set.
[0034] Step S202: Evaluate all predicates based on the dataset to be executed, obtain predicate evaluation results, and sort all predicates based on the predicate evaluation results to obtain predicate sorting results.
[0035] In this embodiment, the dataset to be executed can refer to the dataset to be entity-decomposed. The dataset to be executed includes tuples of multiple record data information. Each tuple consists of one or more attributes and corresponding attribute values. Attributes can refer to variables or fields that describe the characteristics of the tuple, and attribute values can refer to the specific numerical values of the corresponding attributes.
[0036] A rule can be a conditional expression composed of logical operators. A predicate defines the specific conditions and results of the rule. A rule to be executed can be a rule to be used to resolve entities in the dataset to be executed. The rule to be executed includes at least one predicate. A rule set can be a set of rules to be executed. These rules combine multiple comparison methods (equality comparison and similarity comparison) to identify tuples in the dataset to be executed that point to the same real entity.
[0037] The predicate evaluation result can refer to the result of comprehensively evaluating the time required to evaluate and check the predicate on the dataset to be executed (evaluation cost) and the probability that the predicate is matched and satisfied on the dataset to be executed (evaluation effect). The predicate being matched and satisfied can mean that the predicate is satisfied when certain conditions are met. For example, when the predicate is an equality comparison, the corresponding values in the corresponding tuples are completely equal, then the predicate is matched and satisfied. When the predicate is a similarity comparison, the similarity of the corresponding values in the corresponding tuples meets a preset threshold, then the predicate is matched and satisfied. The time required to evaluate and check the predicate can refer to the time required to check that the predicate is matched and satisfied by all tuples on the dataset to be executed. The predicate ranking result can refer to the result of ranking all predicates according to the predicate evaluation result.
[0038] For example, rule-based entity resolution can be defined as follows: Given a pattern R = (eid, A1, ..., A... n ), where A iAs an attribute, eid is the entity identifier (ID). Each tuple in R represents an entity. The dataset to be executed is a set of tuples with an R schema.
[0039] In pattern R, the rule can be defined as Here, X is the set of predicates for two tuples t and s, l denotes t.eid = s.eid, and X is the rule. The prerequisite, l, is the result, when tuples t and tuples s satisfy the rule The prerequisite is that tuple t and tuple s represent the same entity.
[0040] rule The predicate in the expression can be defined as p::=tA=c|tA=sB|tA≈sB, where A and B are attributes, c is a constant, tA=sB and tA=c are used to compare whether the A attribute value of tuple t is equal to the B attribute value of tuple s, and tA≈sB is used to compare the similarity between the A attribute value of tuple t and the B attribute value of tuple s. The similarity can be measured by various similarity measures, such as edit distance or Jaccard similarity.
[0041] For example, given a simplified e-commerce dataset with the tuple schema: Products(eid, pname(product name), price(price), sname(store name), description(description), color(color), sadaddress(store address)), the rules to be executed for entity parsing of any two tuples t and s in this dataset are as follows: It can be defined as follows: If t.color = s.color and t.price = s.price and t.sname = s.sname and t.pname ≈ EDs.pname, then t.eid = s.eid, where ≈ ED represents the edit distance. That is, if the color of tuple t is the same as the color of tuple s, the price of tuple t is the same as the price of tuple s, the store name of tuple t is the same as the store name of tuple s, and the product name of tuple t is the same as the product name of tuple s, then tuple t and tuple s are the same real entity.
[0042] Specifically, for any predicate in the rule set, the total evaluation time of the predicate on the dataset to be executed is calculated, and the probability that the predicate is matched and satisfied on the dataset to be executed is calculated. Based on the total evaluation time and the probability of being matched and satisfied, the predicate evaluation result of the predicate is determined. All predicates in the rule set are traversed to obtain the predicate evaluation result of each predicate. Based on the predicate evaluation results, all predicates are sorted to obtain the predicate sorting result.
[0043] Step S203: Based on the predicate sorting result, construct an execution tree for all rules to be executed in the rule set to obtain at least one execution tree.
[0044] In this embodiment, the execution plan specifies the order in which each rule to be executed is evaluated in the rule set, and the order in which all predicates in each rule to be executed are evaluated. The execution tree can be a tree-like representation of the execution plan, wherein the execution tree includes a root node and at least one leaf node, and the connecting edge between any two nodes represents a predicate. The rule to be executed corresponds to N connecting edges connected in sequence in the execution tree, where N is an integer greater than zero.
[0045] Specifically, for any rule to be executed in the rule set. If the predicate ordering result in X is: Where p1, p2, ..., p|X| are predicates. Then, according to this rule... The predicate sorting result, the process of constructing the execution tree can be as follows: Initialize the root node N0 in the execution tree; traverse the execution tree starting from the root node, processing the predicates in X in turn. Starting from p1, assuming the current traversal is to node N, and the predicate being processed is pi, check the child nodes of N. If there exists a child node Nc, and the edge (N, Nc) represents pi, move to that child node Nc and process the next predicate pi+1 in X. Otherwise, create a new child node Nc for N, such that the edge (N, Nc) represents pi, then move to this new child node and process the next predicate pi+1 in X. This traversal process continues until all predicates in X have been processed, and the current node is set as a leaf node. The associated rule is... Based on the predicate sorting results of all the rules to be executed in the rule set according to the above process, at least one execution tree is constructed.
[0046] For example, Figure 3 is a schematic diagram of an execution tree provided in Embodiment 2 of this application.
[0047] A node in the execution tree is denoted as N, and the root node is denoted as N0. The path ρ starting from the root node can be represented as ρ = (N0, N1, ..., NL), where (Ni-1, Ni) is a connecting edge in the execution tree, i ∈ [1, L], and the length of ρ is L, i.e., the number of edges on ρ. Each connecting edge represents a predicate and is associated with a score, which is the execution score of the predicate (see steps S701 to S704 for details). The predicates corresponding to all connecting edges in the execution tree are as follows: (meaning t.sname = s.sname) (meaning t.price = s.price) (meaning t.pname ≈ EDs.pname) (meaning t.color = s.color) (meaning t.description ≈ JDs.description) (meaning t.saddress = s.saddress), where ≈ED represents edit distance, ≈JD represents Jaccard distance, pname (product name), price (price), sname (store name), description (description), color (color), and saddress (store address).
[0048] The execution tree contains three rules to be executed, namely... and If the rules have already been processed during the construction process In the execution tree of Figure 3, the path ρ1 = (N0, N1, N2, N3, N4) is created. If the rule... The corresponding predicate ordering result is: Then according to the rules The process of constructing the execution tree can be as follows: starting from the root node, first process... Because the root node has a marker as If the child node is N1, then move to N1 and process it. Since there is no marker at N1 If the edge (N1, N5) is a child node, then create a new node N5 and mark it as a child node. because All predicates have been processed, node N5 becomes a leaf node, and its association rule is as follows:
[0049] When performing entity resolution on the dataset to be executed based on the execution plan corresponding to the execution tree, for any tuple pair (t1, t2) in the dataset to be executed, the execution tree is evaluated by traversing it from the root node using a depth-first search. At each internal node N of the execution tree, a child node Nc is selected such that the execution score of the predicate p associated with the edge (N, Nc) is the highest among all child nodes of N. Then, it is checked whether there is a tuple pair (t1, t2) that is satisfied by the predicate p. If so, the node is moved to Nc and processed in a similar manner. If not, it is checked whether N has any other unexplored child nodes, and they are processed in a similar manner according to the order of decreasing execution scores. If all child nodes of N have been explored, the process returns to the parent node Np of N and repeats. The evaluation process is complete when the first leaf node of the execution tree T is reached. Assume the rule associated with this leaf node is... This means that on the path from the root node to that leaf node, the tuple pair (t1, t2) satisfies all predicates in X. Therefore, the tuple pair (t1, t2) is regularized. If the match is satisfied, the remaining tree traversal can be skipped.
[0050] For example, when performing entity resolution on the dataset to be executed based on the execution tree shown in Figure 3, for any tuple pair (t1, t2) in the dataset to be executed, a depth-first search is performed starting from the root node N0. N0 has two child nodes. First, the nodes connected to N0 and labeled as... The edge, because the execution score of that edge is higher, if If the tuple pair (t1, t2) is matched, then move to node N1. The initial exploration marker connected to N1 is... The edge, because the execution score of that edge is higher, if If the pair (t1, t2) does not match, then explore the label connected by N1 as follows: If the edge, If N1 is not matched by the tuple pair (t1, t2), then return the parent node N0 of N1 and explore the nodes connected to N0 marked as... If the edge, If the tuple pair (t1, t2) is matched, move to node N6 and explore the nodes connected to N6. like If the tuple pair (t1, t2) satisfies the condition, then it is determined that the tuple pair (t1, t2) satisfies the rule on the path from the root node to the leaf node N7. All predicates in the set, therefore the tuple pair (t1, t2) is regularized. If the match is satisfied, the tuple pair (t1, t2) represents the same real entity, and the remaining tree traversal can be skipped.
[0051] Step S204: Based on the dataset to be executed, evaluate each connection edge of all execution trees to obtain the edge evaluation results. Based on the edge evaluation results, sort the execution order of the nodes of each execution tree to obtain the rule execution plan corresponding to each execution tree.
[0052] In this embodiment, the edge evaluation result can refer to the result obtained by evaluating the probability that the predicate is matched and satisfied on the dataset to be executed.
[0053] Specifically, for any execution tree, determine any rule to be executed in the execution tree and each predicate in the rule to be executed. Calculate the execution score of the rule to be executed based on the probability that each predicate in the rule to be executed is matched and satisfied in the dataset to be executed. Assign the execution score to each predicate in the rule to be executed. If there is a shared predicate in the execution tree that is shared by at least two rules to be executed, determine the highest score among the execution scores of the at least two rules to be executed as the execution score of the shared predicate. Traverse all execution trees and determine the edge evaluation result of the connection edge of the corresponding predicate based on the execution score of each predicate.
[0054] In this embodiment, by evaluating the predicates in the rule set, a predicate evaluation result is obtained, determining the cost-effectiveness of evaluating each predicate on the dataset to be executed. This cost-effectiveness may include the time it takes for the predicate to be checked on the dataset (evaluation cost) and the probability that the predicate is matched and satisfied on the dataset (evaluation effect). Based on the predicate evaluation result, all predicates are sorted to obtain a predicate ranking result, thereby determining the order in which all predicates in each rule to be executed are evaluated. This order strikes a balance between evaluation cost and evaluation effect. Based on the predicate ranking result, all rules to be executed are constructed into an execution tree. Based on the dataset to be executed, the execution... Each connecting edge of the tree is evaluated to obtain the edge evaluation result, which determines the probability that each rule to be executed, composed of the connecting edge, is matched and satisfied on the dataset to be executed. Based on this probability, the order in which all rules to be executed in the rule set are evaluated is determined. Therefore, based on the edge evaluation result and the execution plan generated by the execution tree, the execution order of predicates and rules to be executed is optimized. The cost-effectiveness of the evaluation can determine which predicates to evaluate first, and the evaluation effect can determine which rules to evaluate first. Entity resolution is then performed based on this execution plan, which can process the dataset to be executed more efficiently, reduce unnecessary computation and resource consumption, and improve the efficiency of entity resolution.
[0055] Referring to Figure 4, which is a flowchart illustrating a rule-based execution plan generation method according to Embodiment 3 of this application, as shown in Figure 4, step S202 above, which evaluates all predicates based on the dataset to be executed to obtain predicate evaluation results, may include the following steps:
[0056] Step S401: Obtain the dataset to be executed.
[0057] Step S402: For any predicate, use any two tuples in the dataset to be executed to calculate the evaluation time of the predicate, and traverse the dataset to be executed to obtain the total evaluation time.
[0058] In this embodiment, the dataset to be executed includes at least two tuples. The evaluation time can refer to the time required to check that the predicate is matched by any two tuples in the dataset to be executed. The total evaluation time can refer to the time required to check that the predicate is matched by all tuples in the dataset to be executed.
[0059] Specifically, given a predicate p and a dataset D to be executed, the total evaluation time of predicate p on the dataset D can be denoted as cost(p,D), and its calculation formula is as follows:
[0060] Where Tp(t1,t2) represents the evaluation time of tuples t1 and t2 executing predicate p, that is, the time required to check that predicate p is matched and satisfied by tuples t1 and t2. Tp(t1,t2) can be the actual time obtained by checking the actual execution process of tuples t1 and t2 executing predicate p, or it can be the estimated time obtained by evaluating and calculating the execution process of tuples t1 and t2 executing predicate p.
[0061] Step S403: Obtain the probability that the predicate is satisfied in the dataset to be executed.
[0062] Step S404: Determine the predicate evaluation result of the predicate based on the probability and the total evaluation time. Iterate through all predicates to obtain the predicate evaluation result of each predicate.
[0063] In this embodiment, the probability of being satisfied can refer to the probability that the predicate is matched and satisfied in the dataset to be executed.
[0064] Specifically, the probability difference is obtained by subtracting 1 from the probability. The probability difference is then compared with the total evaluation time to obtain the predicate evaluation result of the predicate. This process is repeated for all predicates to obtain the predicate evaluation result for each predicate.
[0065] The probability that predicate p is satisfied in the dataset D can be denoted as sp(p,D). Then, based on the probability and the total evaluation time, the formula for calculating the predicate evaluation result can be:
[0066] In this embodiment, for any predicate, the evaluation time of the predicate is calculated using any two tuples in the dataset to be executed. This determines the time required to check if the predicate is satisfied by matching any two tuples. The dataset to be executed is then traversed to obtain the time required to check if the predicate is satisfied by matching all tuples in the dataset. This determines the time cost of evaluating the predicate. Combined with the probability that the predicate is satisfied in the dataset to be executed, the predicate evaluation result is obtained. This predicate evaluation result strikes a balance between evaluation cost and evaluation effect. Based on this predicate evaluation result, predicates with lower total evaluation time and easier to be satisfied by matching in the dataset to be executed can be prioritized when generating the execution plan. This reduces unnecessary computation and resource consumption during entity resolution based on the generated execution plan, thereby improving the efficiency of entity resolution.
[0067] Referring to Figure 5, which is a flowchart illustrating a rule-based execution plan generation method provided in Embodiment 4 of this application, as shown in Figure 5, step S402 above uses any two tuples in the dataset to be executed to calculate the evaluation time of the execution predicate, and iterates through the dataset to be executed to obtain the total evaluation time. This may include the following steps:
[0068] Step S501: Obtain the trained neural network.
[0069] Step S502: Input any two tuples and the predicate in the dataset to be executed into the neural network to obtain the corresponding evaluation time. Iterate through all tuples in the dataset to be executed to obtain the total evaluation time.
[0070] In this embodiment, the trained neural network is obtained by offline training using a dataset with the same data distribution as the dataset to be executed. Its input consists of two tuples and a predicate, and its output is the evaluation time.
[0071] In step S402 above, iterating through all tuples in the dataset to be executed to calculate the total evaluation time of the predicate is extremely costly. For example, on a dataset containing 2 million tuples, calculating cost(p,D) takes an average of more than 100 seconds. To improve efficiency and accuracy, a shallow neural network, i.e. a small feedforward neural network, can be trained using a dataset with the same data distribution as the dataset to be executed to estimate Tp(t1,t2).
[0072] Based on the trained neural network, the total evaluation time of predicate p on the dataset D to be executed can be denoted as: Its calculation formula can be:
[0073] Where N(p,t1,t2) represents the evaluation time of tuples t1 and t2 for executing predicate p.
[0074] Corresponding to steps S401 to S404 above, based on the probability sp(p,D) that the predicate p is satisfied in the dataset D to be executed, and based on the trained neural network, the total evaluation time of the predicate p on the dataset D to be executed is... The formula for calculating the predicate evaluation result can be determined as follows:
[0075] In this embodiment, by inputting any two tuples and the predicate from the dataset to be executed into a trained neural network, the network outputs the evaluation time of the predicate. This reduces the overhead of actually executing the predicate to measure the time in traditional methods, thus improving evaluation efficiency. By using a dataset with the same data distribution as the dataset to be executed for offline training, the trained neural network can learn the potential patterns and features in the data, thereby improving the accuracy of the predicted evaluation time.
[0076] Referring to Figure 6, which is a flowchart illustrating a rule-based execution plan generation method according to Embodiment 5 of this application, as shown in Figure 6, obtaining the probability that the predicate is satisfied in the dataset to be executed in step S403 above may include the following steps:
[0077] Step S601: Obtain the attribute objects in the predicate.
[0078] Step S602: Using locality-sensitive hashing, hash the attribute values corresponding to the attribute objects of all tuples into k buckets, and determine the number of tuples in each bucket.
[0079] Step S603: Calculate the uniformity of the hash based on the number of buckets and the number of tuples in each bucket, and obtain the uniformity value as the probability that the predicate is satisfied in the dataset to be executed.
[0080] In this embodiment, the attribute object can refer to the attribute of the predicate comparison, k is a predefined parameter, and similar or identical attribute values are hashed into the same bucket with a relatively high probability.
[0081] Based on this, the probability that predicate p is satisfied in the dataset D to be executed can be denoted as sp(p,D), and its calculation formula can be:
[0082] Where k is the number of buckets, b i Let be the number of tuples in the i-th bucket.
[0083] For the attribute object A compared in predicate p, the probability that tuples t1 and t2 have different or dissimilar values on attribute object A is quantified. If the probability that tuples t1 and t2 have different values is high, then predicate p is unlikely to be satisfied. Therefore, such predicates should be evaluated first because they can determine earlier that the rule corresponding to the predicate is not matched. If all tuples are hashed into the same bucket, it means that the attribute object A values of all tuples are very similar. Therefore, predicate p can be satisfied by a large number of tuple pairs, and the priority of such predicates should be lower.
[0084] In this embodiment of the application, by using locality-sensitive hashing, the probability that a predicate is satisfied in the dataset to be executed is determined. Based on this probability, predicates that are more likely not to be matched and satisfied can be evaluated first when generating the execution plan. Thus, when performing entity resolution based on the generated execution plan, a large number of mismatched tuple pairs are eliminated in the early stage, reducing unnecessary computation and resource consumption and improving the efficiency of entity resolution.
[0085] Referring to Figure 7, which is a flowchart illustrating a rule-based execution plan generation method according to Embodiment Six of this application, as shown in Figure 7, step S204 above evaluates each connection edge of all execution trees based on the dataset to be executed to obtain the edge evaluation result, and may include the following steps:
[0086] Step S701: For any execution tree, obtain any rule to be executed in the execution tree and determine each predicate in the rule to be executed;
[0087] Step S702: Calculate the execution score of the rule to be executed based on the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed; traverse all rules to be executed in the execution tree and assign the execution score to each predicate in the corresponding rule to be executed.
[0088] Step S703: If there is a shared predicate in the execution tree that is shared by at least two rules to be executed, then determine the highest score among the execution scores of the at least two rules to be executed as the execution score of the shared predicate;
[0089] Step S704: Traverse all execution trees and determine the edge evaluation result of the connection edge of the corresponding predicate based on the execution score of each predicate.
[0090] In this embodiment, the execution score can refer to the score that represents the evaluation order of the rules to be executed.
[0091] Specifically, for any execution tree, obtain any rule to be executed in the execution tree, determine each predicate in the rule to be executed, multiply the probability of each predicate in the rule to be executed being satisfied in the dataset to be executed, obtain the multiplication result, determine the multiplication result as the execution score of the rule to be executed, traverse all rules to be executed in the execution tree, and assign the execution score to each predicate in the corresponding rule to be executed.
[0092] Let sp(p,D) denote the probability that predicate p is satisfied in the dataset D to be executed. The rule to be executed is... Rules to be executed The execution score is recorded as but The calculation formula can be:
[0093] If there is a shared predicate in the execution tree that is shared by at least two rules to be executed, then the highest score among the execution scores of the at least two rules to be executed is determined as the execution score of the shared predicate. Traverse all execution trees and determine the edge evaluation result of the connection edge of the corresponding predicate based on the execution score of each predicate.
[0094] For example, for the execution tree shown in Figure 3, if the predicate The execution score is 0.4, and the predicate... If the execution score is 0.2, then the rule Execution score Assuming the rules are also calculated Execution score Because of the rules and rules It has a common predicate Then common predicate The execution score is max{0.08,0.048}, which is the final score. The performance score was 0.08.
[0095] In this embodiment, the execution score of each predicate in the execution rule is calculated based on the probability that it is satisfied in the dataset to be executed, and the corresponding predicate is assigned. If there is a shared predicate in the execution tree that is shared by at least two execution rules, the highest score among the execution scores of the at least two execution rules is determined as the execution score of the shared predicate. Based on this execution score, predicates that are easily matched and satisfied by the dataset to be executed can be evaluated first when generating the execution plan. Thus, when performing entity resolution based on the generated execution plan, a more efficient and reasonable execution path can be selected based on the execution score, reducing unnecessary computation and resource consumption and improving the efficiency of entity resolution.
[0096] Corresponding to the rule-based execution plan generation method in the above embodiments, Figure 8 shows a structural block diagram of the rule-based execution plan generation apparatus provided in Embodiment 7 of this application. The execution plan generation apparatus is applied to the server in Figure 1. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0097] Referring to Figure 8, the execution plan generation device includes:
[0098] The initial data module 81 is used to obtain the rules to be executed to form a rule set and determine all the predicates in the rule set, wherein the rules to be executed include at least one predicate;
[0099] The predicate sorting module 82 is used to evaluate all predicates based on the dataset to be executed, obtain predicate evaluation results, and sort all predicates based on the predicate evaluation results to obtain predicate sorting results;
[0100] The execution tree construction module 83 is used to construct an execution tree for all rules to be executed in the rule set according to the predicate sorting result, so as to obtain at least one execution tree. The execution tree includes a root node and at least one leaf node. The connecting edge between any two nodes represents a predicate. The rules to be executed correspond to N connecting edges connected in sequence in the execution tree, where N is an integer greater than zero.
[0101] The execution plan generation module 84 is used to evaluate each connection edge of all execution trees according to the dataset to be executed, obtain the edge evaluation result, sort the execution order of the nodes of each execution tree according to the edge evaluation result, and obtain the rule execution plan corresponding to each execution tree.
[0102] Optionally, the predicate sorting module 82 includes:
[0103] A dataset acquisition unit is used to acquire a dataset to be executed, wherein the dataset to be executed includes at least two tuples;
[0104] The evaluation time calculation unit is used to calculate the evaluation time of executing the predicate for any predicate using any two tuples in the dataset to be executed, and to traverse the dataset to be executed to obtain the total evaluation time.
[0105] A probability acquisition unit is used to acquire the probability that the predicate is satisfied in the dataset to be executed;
[0106] The evaluation result calculation unit is used to determine the predicate evaluation result of the predicate based on the probability and the total evaluation time, and to traverse all predicates to obtain the predicate evaluation result of each predicate.
[0107] Optionally, the evaluation time calculation unit includes:
[0108] The network acquisition subunit is used to acquire a trained neural network, wherein the trained neural network is obtained by offline training using a dataset with the same data distribution as the dataset to be executed, and its input is two tuples and a predicate, and its output is the evaluation time;
[0109] The network prediction subunit is used to input any two tuples and the predicate from the dataset to be executed into the neural network to obtain the corresponding evaluation time, and to traverse all tuples in the dataset to be executed to obtain the total evaluation time.
[0110] Optionally, the probability acquisition unit includes:
[0111] The attribute acquisition subunit is used to acquire the attribute objects in the predicate;
[0112] The hashing subunit is used to hash the attribute values corresponding to the attribute objects of all tuples into k buckets using locality-sensitive hashing, and to determine the number of tuples in each bucket, where k is a predefined parameter, and similar or identical attribute values are hashed into the same bucket with a relatively high probability.
[0113] The uniformity calculation subunit is used to calculate the uniformity of the hash based on the number of buckets and the number of tuples in each bucket, and obtain the uniformity value as the probability that the predicate is satisfied in the dataset to be executed.
[0114] Optionally, the evaluation result calculation unit includes:
[0115] The difference calculation subunit is used to subtract 1 from the probability to obtain the probability difference value;
[0116] The ratio calculation subunit is used to compare the probability difference with the total evaluation time to obtain the predicate evaluation result of the predicate with the ratio value.
[0117] Optionally, the execution plan generation module 84 includes:
[0118] The predicate determination unit is used to obtain any rule to be executed in any execution tree and determine each predicate in the rule to be executed;
[0119] The scoring calculation unit is used to calculate the execution score of the rule to be executed based on the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed, traverse all rules to be executed in the execution tree, and assign the execution score to each predicate in the corresponding rule to be executed.
[0120] The scoring comparison unit is used to determine the highest score among the execution scores of the at least two rules to be executed as the execution score of the shared predicate if there is a shared predicate shared by at least two rules to be executed in the execution tree.
[0121] The evaluation result determination unit is used to traverse all execution trees and determine the edge evaluation result of the connection edge of the corresponding predicate based on the execution score of each predicate.
[0122] Optionally, the scoring unit includes:
[0123] The product calculation subunit is used to multiply the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed, and obtain the multiplication result;
[0124] The scoring determination subunit is used to determine the multiplication result as the execution score of the rule to be executed.
[0125] In one embodiment, a computer device, which may be a server, is provided, and its internal structure can be as shown in Figure 9. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, a readable storage medium, and the database. The internal memory provides an environment for the operation of the operating system and the readable storage medium. The database stores a set of rules. The network interface communicates with external terminals via a network connection. When executed by the processor, the readable storage medium implements a rule-based execution plan generation method.
[0126] In one embodiment, a computer device is provided, including a memory, a processor, and a readable storage medium stored on the memory and executable on the processor. When the processor executes the readable storage medium, it implements the steps of the rule-based execution plan generation method in the above embodiments, such as steps S201-S204 shown in FIG2, or the steps shown in FIG3 to 7. To avoid repetition, these steps will not be described again here. Alternatively, the functions of each module / unit in this embodiment of the rule-based execution plan generation apparatus when the processor executes the readable storage medium, such as the functions of the initial data module 81, predicate sorting module 82, execution tree construction module 83, and execution plan generation module 84 shown in FIG8, will also not be described again here to avoid repetition.
[0127] In one embodiment, one or more readable storage media storing computer-readable instructions are provided. When executed by one or more processors, these computer-readable instructions cause the processors to perform the steps of the rule-based execution plan generation method described in the above embodiments, such as steps S201-S204 shown in FIG2, or the steps shown in FIG3 to 7. To avoid repetition, these steps will not be described again here. Alternatively, the functions of each module / unit in this embodiment of the rule-based execution plan generation apparatus when the processor executes the readable storage medium may be described, such as the functions of the initial data module 81, predicate sorting module 82, execution tree construction module 83, and execution plan generation module 84 shown in FIG8. To avoid repetition, these functions will not be described again here.
[0128] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by instructing related hardware through a readable storage medium. The readable storage medium can be stored in a non-volatile computer-readable storage medium, which, when executed, can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0129] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0130] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A rule-based execution plan generation method, characterized in that, The execution plan generation method includes: Obtain the rules to be executed to form a rule set, and determine all the predicates in the rule set, wherein the rules to be executed include at least one predicate; Based on the dataset to be executed, all predicates are evaluated to obtain predicate evaluation results. Based on the predicate evaluation results, all predicates are sorted to obtain predicate sorting results. Based on the predicate sorting result, an execution tree is constructed for all rules to be executed in the rule set to obtain at least one execution tree. The execution tree includes a root node and at least one leaf node. The connecting edge between any two nodes represents a predicate. The rules to be executed correspond to N connecting edges connected sequentially in the execution tree, where N is an integer greater than zero. Based on the dataset to be executed, each connection edge of all execution trees is evaluated to obtain edge evaluation results. Based on the edge evaluation results, the execution order of the nodes of each execution tree is sorted to obtain the rule execution plan corresponding to each execution tree.
2. The execution plan generation method according to claim 1, characterized in that, The process involves evaluating all predicates based on the dataset to be executed, and obtaining predicate evaluation results, including: Obtain the dataset to be executed, which includes at least two tuples; For any predicate, use any two tuples in the dataset to be executed to calculate the evaluation time of executing the predicate, and traverse the dataset to be executed to obtain the total evaluation time; Obtain the probability that the predicate is satisfied in the dataset to be executed; Based on the probability and the total evaluation time, the predicate evaluation result of the predicate is determined, and all predicates are traversed to obtain the predicate evaluation result of each predicate.
3. The execution plan generation method according to claim 2, characterized in that, The step involves using any two tuples from the dataset to be executed to calculate the evaluation time for executing the predicate, and iterating through the dataset to obtain the total evaluation time, including: Obtain a trained neural network, wherein the trained neural network is obtained by offline training using a dataset with the same data distribution as the dataset to be executed, and its input is two tuples and a predicate, and its output is the evaluation time; Input any two tuples from the dataset to be executed and the predicate into the neural network to obtain the corresponding evaluation time. Then, traverse all tuples in the dataset to be executed to obtain the total evaluation time.
4. The execution plan generation method according to claim 2, characterized in that, The step of obtaining the probability that the predicate is satisfied in the dataset to be executed includes: Retrieve the attribute objects from the predicate; Locality-sensitive hashing is used to hash the attribute values corresponding to the attribute objects of all tuples into k buckets to determine the number of tuples in each bucket, where k is a predefined parameter. Similar or identical attribute values are hashed into the same bucket with a relatively high probability. The uniformity of the hash is calculated based on the number of buckets and the number of tuples in each bucket, and the uniformity value is the probability that the predicate is satisfied in the dataset to be executed.
5. The execution plan generation method according to claim 3, characterized in that, The step of determining the predicate evaluation result based on the probability and the total evaluation time includes: Subtract 1 from the probability to obtain the probability difference value; The probability difference is compared with the total evaluation time to obtain the predicate evaluation result of the predicate.
6. The execution plan generation method according to claim 1, characterized in that, The step of evaluating each connection edge of all execution trees based on the dataset to be executed, and obtaining the edge evaluation result, includes: For any execution tree, obtain any rule to be executed in the execution tree, and determine each predicate in the rule to be executed; Based on the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed, calculate the execution score of the rule to be executed, traverse all the rules to be executed in the execution tree, and assign the execution score to each predicate in the corresponding rule to be executed; If there is a shared predicate in the execution tree that is shared by at least two rules to be executed, then the highest score among the execution scores of the at least two rules to be executed is determined as the execution score of the shared predicate; Traverse all execution trees and determine the edge evaluation result of the connecting edges of the corresponding predicates based on the execution score of each predicate.
7. The execution plan generation method according to claim 6, characterized in that, The step of calculating the execution score of the rule to be executed based on the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed includes: Multiply the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed to obtain the multiplication result; The result of the multiplication is determined as the execution score of the rule to be executed.
8. A rule-based execution plan generation device, characterized in that, The execution plan generation device includes: An initial data module is used to acquire rules to be executed to form a rule set and to determine all predicates in the rule set, wherein the rules to be executed include at least one predicate; The predicate sorting module is used to evaluate all predicates based on the dataset to be executed, obtain predicate evaluation results, and sort all predicates based on the predicate evaluation results to obtain predicate sorting results; An execution tree construction module is used to construct an execution tree for all rules to be executed in the rule set according to the predicate sorting result, so as to obtain at least one execution tree. The execution tree includes a root node and at least one leaf node. The connecting edge between any two nodes represents a predicate. The rules to be executed correspond to N connecting edges connected in sequence in the execution tree, where N is an integer greater than zero. The execution plan generation module is used to evaluate each connection edge of all execution trees based on the dataset to be executed, obtain edge evaluation results, sort the execution order of the nodes of each execution tree based on the edge evaluation results, and obtain the rule execution plan corresponding to each execution tree.
9. A computer device comprising a memory, a processor, and a readable storage medium stored in the memory and operable on the processor, wherein, When the processor executes the readable storage medium, it performs the following steps: Obtain the rules to be executed to form a rule set, and determine all the predicates in the rule set, wherein the rules to be executed include at least one predicate; Based on the dataset to be executed, all predicates are evaluated to obtain predicate evaluation results. Based on the predicate evaluation results, all predicates are sorted to obtain predicate sorting results. Based on the predicate sorting result, an execution tree is constructed for all rules to be executed in the rule set to obtain at least one execution tree. The execution tree includes a root node and at least one leaf node. The connecting edge between any two nodes represents a predicate. The rules to be executed correspond to N connecting edges connected sequentially in the execution tree, where N is an integer greater than zero. Based on the dataset to be executed, each connection edge of all execution trees is evaluated to obtain edge evaluation results. Based on the edge evaluation results, the execution order of the nodes of each execution tree is sorted to obtain the rule execution plan corresponding to each execution tree.
10. The computer device according to claim 9, wherein, The process involves evaluating all predicates based on the dataset to be executed, and obtaining predicate evaluation results, including: Obtain the dataset to be executed, which includes at least two tuples; For any predicate, use any two tuples in the dataset to be executed to calculate the evaluation time of executing the predicate, and traverse the dataset to be executed to obtain the total evaluation time; Obtain the probability that the predicate is satisfied in the dataset to be executed; Based on the probability and the total evaluation time, the predicate evaluation result of the predicate is determined, and all predicates are traversed to obtain the predicate evaluation result of each predicate.
11. The computer device according to claim 10, wherein, The step involves using any two tuples from the dataset to be executed to calculate the evaluation time for executing the predicate, and iterating through the dataset to obtain the total evaluation time, including: Obtain a trained neural network, wherein the trained neural network is obtained by offline training using a dataset with the same data distribution as the dataset to be executed, and its input is two tuples and a predicate, and its output is the evaluation time; Input any two tuples from the dataset to be executed and the predicate into the neural network to obtain the corresponding evaluation time. Then, traverse all tuples in the dataset to be executed to obtain the total evaluation time.
12. The computer device according to claim 10, wherein, The step of obtaining the probability that the predicate is satisfied in the dataset to be executed includes: Retrieve the attribute objects from the predicate; Locality-sensitive hashing is used to hash the attribute values corresponding to the attribute objects of all tuples into k buckets to determine the number of tuples in each bucket, where k is a predefined parameter. Similar or identical attribute values are hashed into the same bucket with a relatively high probability. The uniformity of the hash is calculated based on the number of buckets and the number of tuples in each bucket, and the uniformity value is the probability that the predicate is satisfied in the dataset to be executed.
13. The computer device according to claim 11, wherein, The step of determining the predicate evaluation result based on the probability and the total evaluation time includes: Subtract 1 from the probability to obtain the probability difference value; The probability difference is compared with the total evaluation time to obtain the predicate evaluation result of the predicate.
14. The computer device according to claim 9, wherein, The step of evaluating each connection edge of all execution trees based on the dataset to be executed, and obtaining the edge evaluation result, includes: For any execution tree, obtain any rule to be executed in the execution tree, and determine each predicate in the rule to be executed; Based on the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed, calculate the execution score of the rule to be executed, traverse all the rules to be executed in the execution tree, and assign the execution score to each predicate in the corresponding rule to be executed; If there is a shared predicate in the execution tree that is shared by at least two rules to be executed, then the highest score among the execution scores of the at least two rules to be executed is determined as the execution score of the shared predicate; Traverse all execution trees and determine the edge evaluation result of the connecting edges of the corresponding predicates based on the execution score of each predicate.
15. The computer device according to claim 14, wherein, The step of calculating the execution score of the rule to be executed based on the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed includes: Multiply the probability that each predicate in the rule to be executed is satisfied in the dataset to be executed to obtain the multiplication result; The result of the multiplication is determined as the execution score of the rule to be executed.
16. One or more readable storage media storing computer-readable instructions, wherein, When the computer-readable instructions are executed by one or more processors, the one or more processors cause the processors to perform the following steps: Obtain the rules to be executed to form a rule set, and determine all the predicates in the rule set, wherein the rules to be executed include at least one predicate; Based on the dataset to be executed, all predicates are evaluated to obtain predicate evaluation results. Based on the predicate evaluation results, all predicates are sorted to obtain predicate sorting results. Based on the predicate sorting result, an execution tree is constructed for all rules to be executed in the rule set to obtain at least one execution tree. The execution tree includes a root node and at least one leaf node. The connecting edge between any two nodes represents a predicate. The rules to be executed correspond to N connecting edges connected sequentially in the execution tree, where N is an integer greater than zero. Based on the dataset to be executed, each connection edge of all execution trees is evaluated to obtain edge evaluation results. Based on the edge evaluation results, the execution order of the nodes of each execution tree is sorted to obtain the rule execution plan corresponding to each execution tree.
17. The readable storage medium according to claim 16, wherein, The process involves evaluating all predicates based on the dataset to be executed, and obtaining predicate evaluation results, including: Obtain the dataset to be executed, which includes at least two tuples; For any predicate, use any two tuples in the dataset to be executed to calculate the evaluation time of executing the predicate, and traverse the dataset to be executed to obtain the total evaluation time; Obtain the probability that the predicate is satisfied in the dataset to be executed; Based on the probability and the total evaluation time, the predicate evaluation result of the predicate is determined, and all predicates are traversed to obtain the predicate evaluation result of each predicate.
18. The readable storage medium according to claim 17, wherein, The step involves using any two tuples from the dataset to be executed to calculate the evaluation time for executing the predicate, and iterating through the dataset to obtain the total evaluation time, including: Obtain a trained neural network, wherein the trained neural network is obtained by offline training using a dataset with the same data distribution as the dataset to be executed, and its input is two tuples and a predicate, and its output is the evaluation time; Input any two tuples from the dataset to be executed and the predicate into the neural network to obtain the corresponding evaluation time. Then, traverse all tuples in the dataset to be executed to obtain the total evaluation time.
19. The readable storage medium according to claim 17, wherein, The step of obtaining the probability that the predicate is satisfied in the dataset to be executed includes: Retrieve the attribute objects from the predicate; Locality-sensitive hashing is used to hash the attribute values corresponding to the attribute objects of all tuples into k buckets to determine the number of tuples in each bucket, where k is a predefined parameter. Similar or identical attribute values are hashed into the same bucket with a relatively high probability. The uniformity of the hash is calculated based on the number of buckets and the number of tuples in each bucket, and the uniformity value is the probability that the predicate is satisfied in the dataset to be executed.
20. The readable storage medium according to claim 18, wherein, The step of determining the predicate evaluation result based on the probability and the total evaluation time includes: Subtract 1 from the probability to obtain the probability difference value; The probability difference is compared with the total evaluation time to obtain the predicate evaluation result of the predicate.