Service execution optimization method and device, computer equipment and storage medium

By calculating the predicate weights in the decision topology and optimizing the execution order, the problem of low efficiency of traditional decision engines under complex business rules is solved, and more efficient business execution is achieved.

CN121581271APending Publication Date: 2026-02-27ZHEJIANG BANGSUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511574979.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Traditional decision engines suffer from low business execution efficiency when business rules are complex and logic is deeply nested; simple logical sorting is insufficient to effectively improve performance.

Method used

By acquiring historical node call data of the initial decision topology, calculating the predicate weights of logical nodes, sorting logical predicates based on predicate weights, constructing the target decision topology, and optimizing the execution order to improve business execution efficiency.

Benefits of technology

By optimizing the decision-making topology, redundant calculations on invalid paths are reduced, average decision latency and system resource consumption are lowered, overall decision throughput is increased, and business execution efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121581271A_ABST
    Figure CN121581271A_ABST
Patent Text Reader

Abstract

The invention relates to a business execution optimization method and device, computer equipment and a storage medium. The method comprises the following steps: in response to a service execution optimization instruction, obtaining a to-be-adjusted initial decision topological structure matched with a service rule set; the decision topology structure comprises a plurality of logic nodes; according to historical node calling data of the initial decision topology structure, calculating a predicate weight of a logic predicate corresponding to each logic node; the historical node calling data comprises a node evaluation probability; on the basis of the predicate weights, sorting the plurality of logic predicates to obtain a predicate sorting result; and based on the predicate sorting result, constructing a target decision topological structure matched with the business rule set. By adopting the method, the service execution efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a business execution optimization method and device, computer equipment and a storage medium. BACKGROUND

[0002] As an automatic decision-making system, the decision engine can be used to process complex business logic and make decisions based on input data and predefined rules. With the development of technology, it has played an important role in data analysis and calculation in many application fields such as risk monitoring and financial risk control.

[0003] In the traditional technology, the performance of the decision engine is one of the important factors that determine the business execution efficiency and energy consumption. For performance optimization of the decision engine, the execution order of rules or conditions is usually logically reordered, but in the case of complex business rules and deep logic nesting, simple logical ordering of performance cannot effectively improve the efficiency of business execution.

[0004] Therefore, the prior art still has the problem of low business execution efficiency. SUMMARY

[0005] Therefore, it is necessary to provide a business execution optimization method, device, computer equipment and storage medium capable of improving the efficiency of business execution.

[0006] In a first aspect, the present application provides a business execution optimization method applied to a decision execution device, the business execution optimization method comprising:

[0007] In response to a business execution optimization instruction, an initial decision topology structure to be adjusted matching a business rule set is obtained; the decision topology structure comprises a plurality of logical nodes;

[0008] According to the historical node calling data of the initial decision topology structure, the predicate weight of the logical predicate corresponding to each logical node is calculated; the historical node calling data comprises a node evaluation probability;

[0009] Based on the predicate weight, the plurality of logical predicates are sorted to obtain a predicate sorting result;

[0010] Based on the predicate sorting result, a target decision topology structure matching the business rule set is constructed.

[0011] In one embodiment, the initial decision topology structure to be adjusted matching the business rule set comprises:

[0012] performing logical character extraction on each business rule in the business rule set to obtain a plurality of logical predicates and logical operators;

[0013] constructing a plurality of logical nodes based on the logical predicates and logical operators;

[0014] determining the initial decision topology to be adjusted based on the plurality of logical nodes.

[0015] In one of the embodiments, before calculating the predicate weight of each logical predicate corresponding to each logical node according to the historical node invocation data of the initial decision topology, the method further comprises:

[0016] In response to the decision execution device processing a business data request based on the initial decision topology, counting the execution times and evaluation results of each logical node;

[0017] determining the node evaluation probability of each logical node based on the evaluation results and the execution times.

[0018] In one of the embodiments, the node evaluation probability comprises the probability of the evaluation result being false; the predicate weight is directly proportional to the node evaluation probability; and the sorting of the plurality of logical predicates based on the predicate weight to obtain the predicate sorting result comprises:

[0019] sorting the plurality of logical predicates based on the predicate weight from large to small to obtain the predicate sorting result.

[0020] In one of the embodiments, the historical node invocation data further comprises node invocation frequency; and the calculation of the predicate weight of each logical predicate corresponding to each logical node according to the historical node invocation data of the initial decision topology comprises:

[0021] performing weighted calculation on the node evaluation probability based on the node invocation frequency to obtain the predicate weight of each logical predicate.

[0022] In one of the embodiments, the construction of the target decision topology matching the business rule set based on the predicate sorting result comprises:

[0023] creating a node object according to each logical predicate in the predicate sorting result to obtain a plurality of logical nodes;

[0024] constructing a reference relationship between the plurality of logical nodes according to the predicate sorting result;

[0025] constructing the target decision topology matching the business rule set based on the logical nodes and the reference relationship.

[0026] In one of the embodiments, the decision execution device invokes a decision topology to process the service data request by preset node mapping information; the preset node mapping information comprises a mapping relationship between the service data request and a logical node; and the method further comprises:

[0027] updating the preset node mapping information based on the target decision topology;

[0028] when there is no mapping relationship in the preset node mapping information that is mapped to the initial decision topology, clearing the initial decision topology.

[0029] In a second aspect, the application provides a service execution optimization device applied to a decision execution device, the service execution optimization device comprising:

[0030] an acquisition module configured to acquire an initial decision topology to be adjusted matched with a service rule set in response to a service execution optimization instruction; the decision topology comprises a plurality of logical nodes;

[0031] a calculation module configured to calculate a predicate weight of a logical predicate corresponding to each of the logical nodes according to historical node invocation data of the initial decision topology; the historical node invocation data comprises a node evaluation probability;

[0032] an ordering module configured to order a plurality of the logical predicates based on the predicate weight to obtain a predicate ordering result;

[0033] a construction module configured to construct a target decision topology matched with the service rule set based on the predicate ordering result.

[0034] In a third aspect, the application provides a computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the method as described above when executing the computer program.

[0035] In a fourth aspect, the application provides a computer readable storage medium storing a computer program, and the computer program is executed by a processor to implement the method as described above.

[0036] The business execution optimization method, device, computer device and storage medium described above, by responding to a business execution optimization instruction, an initial decision topology structure to be adjusted matching a business rule set is obtained; the decision topology structure comprises a plurality of logical nodes; a predicate weight of a logical predicate corresponding to each logical node is calculated according to historical node invocation data of the initial decision topology structure; the historical node invocation data comprises a node evaluation probability; based on the predicate weight, a plurality of logical predicates are sorted to obtain a predicate sorting result; based on the predicate sorting result, a target decision topology structure matching the business rule set is constructed, the predicate weight of each logical predicate is calculated according to the historical node invocation data thereof, the logical nodes are sorted based on the predicate weight to form an execution sequence, and the target decision topology structure with consistent semantics but optimized sequence is reconstructed according to the sequence, so that nodes with higher value are preferentially executed and sorted to an early stage, more business processing requests are quickly released in the early stage, redundant calculation of original invalid paths is reduced, average decision delay and system resource consumption are reduced, and overall decision throughput is improved, thereby achieving the technical effect of improving business execution efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0037] Figure 1 An application environment diagram of a business execution optimization method in an embodiment;

[0038] Figure 2 A flowchart of a business execution optimization method in an embodiment;

[0039] Figure 3 A flowchart of a business execution optimization method in another embodiment;

[0040] Figure 4 A schematic diagram of a business execution optimization result in an embodiment;

[0041] Figure 5 A structural block diagram of a business execution optimization device in an embodiment;

[0042] Figure 6 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0043] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description of the present application will be given below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0044] The business execution optimization method provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The terminal 102 responds to the business execution optimization instruction, obtains the initial decision topology structure to be adjusted matched with the business rule set; the decision topology structure includes a plurality of logical nodes; according to the historical node calling data of the initial decision topology structure, the predicate weight of the logical predicate corresponding to each logical node is calculated; the historical node calling data includes node evaluation probability; based on the predicate weight, the plurality of logical predicates are sorted to obtain the predicate sorting result; based on the predicate sorting result, the target decision topology structure matched with the business rule set is constructed. Among them, the terminal 102 can be but not limited to various personal computers, notebook computers, smart phones and tablet computers. The server 104 can be realized by an independent server or a server cluster composed of multiple servers.

[0045] In one embodiment, as Figure 2 shown, a business execution optimization method is provided, applied to a decision execution device, the business execution optimization method comprising:

[0046] Step S100, in response to the business execution optimization instruction, obtaining the initial decision topology structure to be adjusted matched with the business rule set. The decision topology structure includes a plurality of logical nodes.

[0047] Among them, the decision execution device can be a computing system that executes business decision logic and outputs decision results. By loading the business rule set and the decision topology structure, the logical nodes are executed in sequence at runtime, so as to complete the condition judgment and result output, and realize the automatic business judgment. Illustratively, the decision execution device can include but not limited to one or more of embedded decision terminal, cloud native decision service, edge computing decision node, etc.

[0048] The business execution optimization instruction can be a control signal triggering business rule execution optimization or decision topology structure dynamic reconstruction, which can be issued by a business system or an operation and maintenance platform to notify the decision execution device or the terminal 102 to start the decision path optimization process based on historical calling data. Illustratively, the business execution optimization instruction can include but not limited to one or more of periodic optimization instruction, event-driven optimization instruction, manual intervention optimization instruction, etc.

[0049] The business rule set can be a set of business rules describing business decision logic, wherein each business rule can include one or more logical predicates. The business rules can be defined by business personnel through a rule editor and stored in a rule base in a structured language or a configuration file. For example, the business rule set can include a risk control rule set, a credit granting rule set, an anti-fraud rule set, etc. according to different application fields, which are not limited in the embodiment.

[0050] The initial decision topology, as the decision topology to be optimized, can be a directed structure of logical nodes arranged in order of reference relationship of the business rule set, or can be a decision topology that has been optimized at least once and enters the optimization process again. For example, each logical predicate can be mapped to a logical node by parsing the business rule set, and the dependency relationship between nodes can be constructed in a syntax order or a configuration order as a benchmark decision path before optimization. In another exemplary embodiment, the target decision topology of the last optimization period can be used as the initial decision topology to perform the business execution optimization process in the current period in response to the business execution optimization instruction. For example, the decision topology can include one or more of a depth-first topology, a breadth-first topology, a rule declaration order topology, etc. according to different execution priorities.

[0051] The logical node can be an execution entity representing an atomic condition judgment unit in the business rule and can be generated by logical predicate compilation. For example, each node can include a predicate expression, an input parameter, and an output branch result, etc. to constitute a basic execution unit of the decision topology for determining whether to continue execution along a certain path.

[0052] In the embodiment, the initial decision topology matching the business rule set in response to the business execution optimization instruction can be parsed from the business execution optimization instruction, the corresponding business rule set can be loaded from the rule base, and the directed structure of logical nodes can be generated in a default order. Alternatively, the existing decision topology matching the business execution optimization instruction can be obtained as the initial decision topology in response to the business execution optimization instruction.

[0053] In step S200, the predicate weight of the logical predicate corresponding to each logical node is calculated according to the historical node call data of the initial decision topology. The historical node call data includes node evaluation probability.

[0054] The historical node invocation data can be statistical information recording the frequency and result distribution of each logical node actually evaluated in past decision execution. The historical node invocation data can be automatically collected by the decision execution apparatus during operation, or collected and stored by a third-party monitoring tool in a thread-safe manner. For example, the historical node invocation data can include one or more of the number of times the node is triggered, the evaluation probability, the evaluation time consumption, the average evaluation time consumption, the number of times of short-circuit skipping, the short-circuit rate, and the like, so as to reflect the execution probability of each predicate in a real business scenario as comprehensively as possible.

[0055] The logical predicate can be a Boolean condition expression that can be independently evaluated in a business rule and can be extracted from a business rule set. For example, the logical predicate can include, but is not limited to, one or more of a numerical comparison predicate, a string matching predicate, a null value detection predicate, and the like. In an exemplary embodiment, the logical predicate can be an atomic condition such as "user age > 18" or "transaction amount > 10000".

[0056] The predicate weight can be a numerical index reflecting the priority of the logical predicate in real execution, which is calculated based on the historical invocation data, integrates the node evaluation probability and the calculation overhead estimation, and is generated by a weighting function, so that the logical predicate with high probability and low overhead obtains a higher weight, and the execution value of the logical predicate is quantified. In this embodiment, by quantitatively calculating the predicate weight of the logical predicate, the logical predicate with greater performance improvement value of the decision execution apparatus can be executed more preferentially.

[0057] According to the historical node invocation data of the initial decision topology, the predicate weight of the logical predicate corresponding to each logical node can be calculated by traversing the historical invocation data, weighting the evaluation probability and the estimated overhead of each logical node, and outputting a normalized weight value. For example, the weighting calculation can include introducing an overhead penalty factor to reduce the weight, or introducing an overhead reward factor to increase the weight, so as to convert the static rule into a dynamic execution priority index and realize dynamic adjustment based on the actual business execution situation.

[0058] In step S300, the plurality of logical predicates are sorted based on the predicate weight to obtain a predicate sorting result.

[0059] The predicate sorting result can be an execution sequence formed by rearranging all logical predicates according to the predicate weight. For example, when the predicate weight represents the priority execution value, the logical predicates can be arranged in descending order of the predicate weight as a direct basis for constructing the optimized decision topology. For example, the predicate sorting result can be a combination of one or more of probability priority sorting, overhead priority sorting, and comprehensive priority sorting, so as to generate an optimal execution sequence that conforms to the actual invocation distribution.

[0060] Step S400, based on the predicate ordering result, constructing a target decision topology structure matched with the business rule set.

[0061] The target decision topology structure can be a logical node directed structure reconstructed according to the predicate ordering result and optimized in execution order. For example, the execution order of the nodes can be adjusted only to reconstruct the dependency relationship to replace the initial topology structure and realize dynamic adaptive optimization of the execution path while maintaining the semantic integrity of the business rule set.

[0062] In further embodiments, the dependency relationship can also be ensured not to be destroyed by a topology sorting algorithm, and a virtual jump node can be inserted to support short circuit optimization, and a multi-version topology can also be generated for cold-hot switching, so that non-intrusive dynamic reconstruction of the decision path can be realized to improve the execution efficiency.

[0063] Taking the approval process as an example, through the business execution optimization method of the embodiment, the node calling data in the past preset period is collected, the probability of the evaluation of "age > XX" being false is high, and then a higher predicate weight can be calculated. The target decision topology structure generated according to the predicate weight can make more business processing requests end the processing flow quickly at the first node, avoid invalid calculation of subsequent high-overhead rules, and realize improvement of the approval throughput.

[0064] The business execution optimization method provided in the embodiment includes the following steps: in response to a business execution optimization instruction, an initial decision topology structure matched with a business rule set and to be adjusted is acquired; the decision topology structure includes a plurality of logical nodes; according to historical node calling data of the initial decision topology structure, a predicate weight of a logical predicate corresponding to each logical node is calculated; the historical node calling data includes a node evaluation probability; based on the predicate weight, the plurality of logical predicates are sorted to obtain a predicate ordering result; and based on the predicate ordering result, a target decision topology structure matched with the business rule set is constructed. By calculating the predicate weight of each logical predicate according to the historical node calling data, the logical nodes are sorted based on the predicate weight to form an execution sequence, and the target decision topology structure with consistent semantics but optimized in order is reconstructed according to the sequence, so that the nodes with higher value are preferentially executed and sorted to an early stage, more business processing requests are quickly released in the early stage, the redundant calculation of the original invalid path is reduced, the average decision delay and system resource consumption are reduced, and the overall decision throughput is improved, thereby achieving the technical effect of improving the business execution efficiency.

[0065] In one of the embodiments, acquiring the initial decision topology structure matched with the business rule set includes:

[0066] For each business rule in the business rule set, logical characters are extracted to obtain multiple logical predicates and logical operators;

[0067] Multiple logical nodes are constructed based on logical predicates and logical operators;

[0068] Based on multiple logical nodes, the initial decision topology structure to be adjusted is determined.

[0069] Logical character extraction can be achieved by parsing each rule in the business rule set to extract its logical conditions and operators, thereby forming atomic logical units that can be used to construct decision tree nodes. In this embodiment, logical character extraction can convert the logical conditions and operators in the rules into structured node expressions according to a preset algorithm, which are used to construct the initial topology of the decision tree.

[0070] Logical predicates can be semantic units expressing a single judgment condition, used to describe the specific judgment basis in business rules. Logical operators can be Boolean operators used to combine logical predicates to express complex judgment relationships, such as AND, OR, and NOT, which determine the branching connection method between nodes in a decision tree. Logical operators can be extracted from the rule parsing process, including "AND," "OR," "NOT," and their equivalent forms, used to construct logical connections between decision nodes. Furthermore, logical operators can guide the connection order and branching structure of decision nodes in the decision tree, affecting the execution flow of the decision path. Logical operators, together with logical predicates, constitute the judgment content of nodes in the decision tree, and their combination relationships determine the parent-child link structure between nodes.

[0071] Based on multiple logical nodes, the initial decision topology to be adjusted is determined. This can be achieved by forming a decision graph with a hierarchical branching structure based on the connections between logical nodes. In an exemplary embodiment, logical nodes can be arranged according to operator precedence and nesting relationships to construct a tree-like or directed acyclic graph structure, which serves as an executable representation of the initial decision topology.

[0072] This embodiment provides a business execution optimization method. By extracting logical characters from each rule in the business rule set to obtain logical predicates and logical operators, and constructing logical nodes accordingly, the initial decision topology is determined based on the logical relationships between nodes. This allows the semantic content of business rules to be transformed into an executable structured decision model, thereby enabling rapid response and adaptation of the topology when rules change, and ultimately improving business execution efficiency.

[0073] In one embodiment, before calculating the predicate weight of the logical predicate corresponding to each logical node based on the historical node call data of the initial decision topology, the following steps are included:

[0074] In response to the decision execution device processing business data requests based on the initial decision topology, the number of executions and evaluation results of each logical node are counted.

[0075] Based on the evaluation result and the number of executions, determine the node evaluation probability of each logical node.

[0076] In this embodiment, the decision execution device evaluates the business data request node by node according to the initial decision topology, and the execution count and Boolean evaluation result of each logical node are recorded by the decision execution device or a third-party monitoring module. For example, the decision execution device can be one or more of the following: an embedded decision terminal, a cloud-native decision service, or an edge computing decision node.

[0077] A business data request can be an instance of input data that triggers the decision engine to evaluate logical nodes based on the initial decision topology. Business data requests can be sent by upstream business systems and, for example, may include entity attributes and context parameters to be evaluated, Boolean evaluation processes driving logical nodes, etc. For example, business data requests can manifest as credit application requests, anti-fraud verification requests, compliance check requests, etc., depending on the application scenario.

[0078] The execution count can be the total number of times a logical node is actually evaluated during the processing of business data requests. Alternatively, it can be the counting and accumulation of evaluation events for each logical node during the operation of the decision execution device, with its Boolean output recorded, thus reflecting the frequency at which logical nodes are triggered in the actual business flow.

[0079] The evaluation result can be a Boolean judgment returned by the logic node during execution, used to determine whether the path should continue execution. It is output by the logic node after evaluating the predicate expression at runtime and captured by the decision execution device as a true or false value record. For example, the evaluation result can include one or more of the following: a true value result, a false value result, or an unexecuted result.

[0080] Furthermore, the execution count and evaluation result of each logical node can be maintained in memory and accumulated in real time by a counter. The results are asynchronously written to the statistics library through the event log. Unexecuted nodes can also be specially marked to distinguish between unexecuted nodes and false results. This enables non-intrusive online collection of logical node behavior under real business load, resulting in accurate raw observation data.

[0081] The node evaluation probability can be the conditional probability that a logical node returns a true value in a historical business data request. It can be calculated based on the total number of times it is executed and the number of times a true or false value appears. It can represent the triggering tendency of the predicate in real business scenarios.

[0082] Furthermore, the node evaluation probability can be improved by introducing a sliding time window to count only requests within a specific time range. A smoothing factor can also be applied to low-frequency nodes to avoid zero probability. In addition, the probability distribution can be calculated independently by grouping by business category to transform the abstract rule logic into a quantifiable dynamic trigger tendency indicator, so that the predicate weight calculation can be free from static assumptions and conform to the actual distribution at runtime.

[0083] This embodiment provides a business execution optimization method that, in response to a decision execution device processing business data requests based on an initial decision topology, counts the execution count and evaluation results of each logical node, and determines the node evaluation probability of each logical node based on the evaluation results and execution count. This achieves non-intrusive online collection and dynamic probability modeling of logical node behavior under real business load, ensuring that the generation of predicate weights is entirely based on the actual runtime trigger distribution, avoiding inaccurate sorting caused by theoretical assumptions or static configurations, thereby improving the execution efficiency and adaptability of decision paths and ultimately enhancing business execution efficiency.

[0084] In one embodiment, the node evaluation probability includes the probability that the evaluation result is false; the predicate weight is proportional to the node evaluation probability; based on the predicate weight, multiple logical predicates are sorted to obtain the predicate sorting result, which includes:

[0085] Based on the predicate weights from largest to smallest, multiple logical predicates are sorted to obtain the predicate sorting result.

[0086] The probability of a false evaluation result can be the proportion of the number of times a logical predicate evaluates to false in its historical execution to the total number of evaluations. It can be used as an indicator to measure the potential of a predicate to trigger short-circuit termination.

[0087] Predicate weights can be numerical indicators reflecting the priority of logical predicates in the decision path. They can be used as a ranking criterion to give higher priority to predicates with high false probabilities, thereby maximizing the short-circuit pruning effect. In this embodiment, predicate weights can be normalized by uniformly scaling with a linear scaling factor. Zero-probability predicates are assigned minimum baseline weights to avoid computational errors caused by zero values. Furthermore, an upper limit saturation value can be set for extremely high-probability predicates, thereby enhancing the ranking stability and robustness.

[0088] Based on the predicate weights from largest to smallest, multiple logical predicates are sorted to obtain the predicate sorting result. This can be achieved by arranging all logical predicates from highest to lowest weight to form a deterministic execution sequence. In this embodiment, this sorting mechanism ensures that the predicate most likely to trigger short-circuit termination is placed at the beginning of the execution sequence, maximizing the probability of prematurely truncating invalid paths. For example, the sorting can preserve the original topological order when weights are equal, or it can group predicates with weight differences less than a threshold in parallel. A stable sorting algorithm can also be introduced to ensure the reproducibility of the results.

[0089] This embodiment provides a business execution optimization method. By defining the node evaluation probability as the proportion of the number of times the evaluation result is false out of the total number of evaluations, and making the predicate weight proportional to the node evaluation probability, the logical predicates are sorted according to the predicate weight from large to small. This allows the execution sequence to prioritize the deployment of predicates with high short-circuit probability, thereby effectively improving path pruning efficiency, reducing redundant computational overhead, improving decision engine performance, and achieving the effect of improving business execution efficiency.

[0090] In one embodiment, the historical node call data also includes the node call frequency; based on the historical node call data of the initial decision topology, the predicate weight of the logical predicate corresponding to each logical node is calculated, including:

[0091] The predicate weight of each logical predicate is obtained by weighting the node evaluation probability based on the node call frequency.

[0092] The node call frequency can be the ratio of the total number of times a logical node is evaluated in historical decision execution to the statistical duration. This reflects the activity level of the logical predicate in the actual business flow, thus quantifying the influence of the logical predicate in the overall decision path. It is used for weighted calculations to comprehensively evaluate the priority of predicates. Incorporating the node call frequency into the historical node call data can be achieved by adding a new field to the existing historical node call data structure to record the total number of times each logical predicate node is evaluated.

[0093] The predicate weight of each logical predicate is obtained by weighting the node evaluation probability based on the node call frequency. This can be achieved by multiplying the false probability of the logical predicate by the call frequency to generate a predicate weight value that reflects the overall priority. Furthermore, this calculation can suppress the impact of extreme values ​​by logarithmically compressing the access call frequency, normalizing the evaluation probability and call frequency separately before multiplying, and introducing a decay factor to reduce the weight of historical data. This ensures that the predicate weight simultaneously reflects its ability to trigger short-circuit attacks and the breadth of actual calls, avoiding excessive interference from low-frequency, high-false-probability predicates in the ranking process and ensuring that the optimization direction aligns with the actual business load distribution.

[0094] This embodiment provides a business execution optimization method that incorporates the node call frequency into historical node call data and performs weighted calculations based on the node evaluation probability. This allows the predicate weight to comprehensively reflect the execution frequency and short-circuit triggering capability of logical predicates, thereby prioritizing predicates with both high frequency and high short-circuit probability in decision path sorting. This improves the average decision efficiency and resource utilization of the system in high-concurrency scenarios, ultimately enhancing business execution efficiency.

[0095] In one embodiment, constructing a target decision topology structure that matches the business rule set based on the predicate ranking result includes:

[0096] Create a node object for each logical predicate in the predicate sorting result to obtain multiple logical nodes;

[0097] Based on the predicate sorting results, construct the reference relationships between multiple logical nodes;

[0098] Based on logical nodes and reference relationships, construct a target decision topology structure that matches the business rule set.

[0099] In this context, logical nodes can be dynamically instantiated node objects from logical predicates, used to decouple rule logic from execution structure at runtime. In this embodiment, node objects can be instantiated for each logical predicate and bound to its expression and runtime statistical metadata based on the optimal predicate execution sequence.

[0100] Reference relationships can describe parent-child references and short-circuit branch relationships between node objects constructed according to the optimal execution sequence, which can ensure the semantic integrity of business rules in the refactored topology.

[0101] For example, constructing a decision topology based on logical nodes and reference relationships can include implementation methods such as inserting jump anchors for short-circuit conditions, establishing parallel reference groups for mutually exclusive branches, and establishing reference reuse markers for shared subexpressions. This can accurately restore the semantic constraints of business rules while maintaining the optimization of execution order, and avoid logical breaks or path failures.

[0102] This embodiment provides a business execution optimization method that dynamically creates node objects carrying expressions and statistical states for each logical predicate, constructs parent-child and short-circuit reference relationships arranged by weight, and builds an executable target decision topology structure. This can achieve priority triggering of high-probability predicates and delay or skipping of low-probability predicates, thereby reducing CPU cycle and memory access overhead, improving real-time response capabilities in complex rule scenarios, and achieving the effect of improving business execution efficiency.

[0103] In one embodiment, the decision execution device invokes a decision topology structure to process business data requests through preset node mapping information; the preset node mapping information includes the mapping relationship between business data requests and logical nodes; after constructing a target decision topology structure matching the business rule set based on the predicate sorting result, the device further includes:

[0104] Based on the target decision topology, the preset node mapping information is updated;

[0105] If there is no mapping relationship to the initial decision topology in the preset node mapping information, the initial decision topology is cleared.

[0106] The preset node mapping information can be an index table recording the mapping relationship between business data requests and the execution sequence of predicate nodes in the decision tree. This can be used to quickly bind business requests to optimized decision paths, avoiding the need to re-parse the rule set for each request. In this embodiment, the preset node mapping information is dynamically generated by the decision execution device during initialization or dynamic reconstruction. For example, it can store the association path between the request identifier and the execution sequence of predicate nodes in the newly constructed decision tree in key-value pairs. For example, the preset node mapping information can include, but is not limited to, one or more of the following: request-node hash mapping, session-level mapping table, versioned mapping snapshot, etc.

[0107] By invoking the decision topology structure through preset node mapping information to process business data requests, one can look up the corresponding new decision tree execution sequence reference in the preset node mapping information based on the unique identifier of the business data request, and directly call the ordered execution path of its predicate node for judgment. Furthermore, a cache hit-first strategy can be used to accelerate mapping lookup, and for requests with invalid mappings, a fallback to the rule set can be triggered for re-parsing, thereby enabling zero-parsing and fast invocation of the decision path, reducing the startup overhead of a single request.

[0108] Updating the preset node mapping information based on the target decision topology can be achieved by binding the execution sequence reference of the new decision tree with all relevant business data request identifiers after the new decision tree is constructed, and updating the corresponding entries in the mapping table. In this embodiment, an atomic write mechanism can be used to ensure thread safety of the mapping update, enabling batch mapping refresh for batch requests, and retaining the historical decision topology to support implementations such as canary switching. This ensures that business requests always point to the latest optimized execution path, achieving seamless dynamic optimization.

[0109] When there is no mapping relationship to the initial decision topology in the preset node mapping information, the initial decision topology is cleared. This can be done by periodically scanning the preset node mapping information, identifying old decision tree structures that are not referenced by any current mapping, releasing their memory usage and metadata resources, thereby automatically reclaiming old topologies that are no longer in use, preventing the accumulation of redundant resources, and maintaining the memory stability of the system for long-term operation.

[0110] This embodiment provides a business execution optimization method that enables rapid binding of business data requests and decision topology structures through preset node mapping information. Based on the newly constructed target decision topology structure, the mapping relationship is updated synchronously, and the initial decision topology structure without references is automatically cleared according to the mapping dependency. This allows decision calls to effectively optimize paths and take effect seamlessly without repeatedly parsing rule sets, and achieves accurate recycling of redundant resources. It enhances the stability and resource utilization of the system under high concurrency and long-term operation, thereby improving the technical effect of improving business execution efficiency.

[0111] To more clearly illustrate the technical solution of this application, a detailed embodiment is also provided.

[0112] In one embodiment, such as Figure 3 As shown, a business execution optimization method is provided, including:

[0113] Step S1 involves initialization during system startup or when the business rule set changes. It receives a set of business rules, each rule consisting of a logical predicate or a combination of multiple logical predicates using logical operators (such as AND and OR). Multiple logical predicates can form a tree structure interconnected by multiple logical node objects via pointers or references, where non-leaf nodes represent logical operators. During initialization, these rules are parsed and, based on a preset algorithm (such as ID3 or C4.5 decision tree generation algorithms and their variants), an initial, physical decision tree execution structure—the initial decision topology—is generated.

[0114] Specifically, the decision tree can be represented as a combination of in-memory instantiated objects. For example, an instantiation point in memory represents a specific logical predicate, while leaf nodes represent a final decision result, such as a Boolean value like True or False. This initial decision tree is the initial version for the decision engine to execute subsequent business requests.

[0115] Step S2: When the decision engine begins processing real-time business data requests, it makes a decision based on the currently active decision tree structure. Runtime monitoring involves a monitoring module that non-intrusively monitors the evaluation behavior of each predicate node in the decision tree during the decision engine's operation, continuously calculating the probability of False on the current decision tree. In one specific embodiment, a thread-safe, high-performance global data structure can be maintained internally within the system. For example, in Java, a thread-safe hash table (ConcurrentHashMap) can be used to store runtime statistics for each predicate node. Whenever the decision engine executes a predicate node and obtains its Boolean evaluation result (True or False), the monitoring module atomically updates the two core counts corresponding to that predicate: the total number of executions and the False count. The total number of executions refers to the total number of times the predicate has been evaluated, and the False count refers to the total number of times the predicate evaluation result is False.

[0116] The above statistical methods can accurately and in real time capture the performance characteristics of each logical condition under real business data without significantly affecting business processing performance.

[0117] Step S3: The system periodically initiates the analysis process for this stage according to preset triggering conditions. The triggering conditions can be one or more of time-based triggering and count-based triggering. Time-based triggering can occur according to a preset time period, for example, triggered every 30 minutes by a background scheduled task. Count-based triggering can occur based on threshold conditions such as the number of evaluation executions or the false count value; for example, a counter within the decision engine triggers once after accumulating 1,000,000 requests.

[0118] Step S4: When the triggering condition is met, dynamically analyze and calculate the probability and generate the optimal predicate sequence. Specifically, this includes performing the following operations through the dynamic analysis module:

[0119] (1) Calculate the probability: Traverse the global data structure and calculate the False probability of each monitored predicate node in the current statistical period according to the formula P(False) = False_count / Total_count. False_count is the False count value and Total_count is the total number of executions.

[0120] (2) Weighted sorting: In order to make the optimization more refined, the call frequency is introduced as a weighting factor to correct the False probability, so as to ensure that the optimization resources can be preferentially tilted to the most frequently executed logic.

[0121] (3) Sequence Generation: Based on the calculated final False probability, i.e., the predicate weights, all predicates are sorted in descending order according to their weights, thereby generating a current optimal predicate execution sequence, i.e., the predicate sorting result. This sequence represents the ideal logical judgment order that can trigger "short-circuit evaluation" the fastest under the current business environment. For example... Figure 4 As shown, assuming the decision tree includes predicates A, B, and C executed sequentially, the predicate weights of predicates A, B, and C, obtained from historical call data, are 0.1, 0.3, and 0.9, respectively. This means that in most cases, predicate C is more likely to be a false positive. If predicate C is placed in the shallow layer of the decision tree, unnecessary overhead on predicates B and A can be reduced. Therefore, by sorting the predicate weights in descending order, after reconstruction, predicate C can finish processing faster when handling business processing requests, reducing the computation of predicates B and A, reducing memory usage, and thus improving business execution efficiency.

[0122] Step S5: After receiving the optimal predicate execution sequence generated in the previous step, the physical reconstruction module creates a new decision tree based on the optimal sequence. Specifically, a new structure can be created in memory to instantiate a completely new, empty decision tree. Through nodeization and linking, the optimal predicate execution sequence is traversed. For each predicate in the sequence, a new node object is created. Then, according to the order of the sequence, these newly created node objects are linked together, reconstructing the parent-child node reference relationships, thereby forming a completely new tree-like topology. In this new structure, the higher the probability of a predicate being false, the shallower the corresponding node in the tree, i.e., the closer it is to the root node.

[0123] Step S6, after the new decision tree is built in memory, to ensure business continuity and data consistency, includes an atomic replacement to safely switch the old decision tree currently used by the decision execution engine to the new decision tree. By ensuring the atomicity of the update, the current decision tree can be updated concurrently without affecting performance. This replacement process is completed through a single atomic reference switching operation. For example, if the reference to the current decision tree held by the decision engine is a volatile variable or an AtomicReference object, its set method is called to move the reference from the root node of the old tree to the root node of the new tree. Because this process is atomic, it ensures that during the switch, all newly arriving business requests can be seamlessly directed to the optimized new decision tree for processing. The old decision tree, no longer referenced by any currently processed requests, will be automatically reclaimed at some point in the future through the Java Virtual Machine's (JVM) garbage collection (GC) mechanism, thus releasing memory.

[0124] In step S7, after the replacement is completed, the runtime monitoring module (step S2) will continue to monitor the new decision tree, thus initiating a new round of "monitoring-analysis-reconstruction" cycle. Therefore, this invention constructs a complete, closed-loop, and adaptive deep optimization system capable of adapting to changes in business data.

[0125] This embodiment provides a business execution optimization method. By monitoring the runtime of predicate nodes, a thread-safe key-value store is used as the data structure for statistical data. The key is a unique identifier for the predicate node, and the value is an array of atomic counters containing "total execution count" and "False count." This ensures lock-free or low-lock real-time updates of statistical data in high-concurrency scenarios with extremely low performance overhead. When sorting predicate nodes, a weighted scoring model is used. This model not only calculates the core False probability but also introduces the node's call frequency as a weighting factor. After calculating the predicate weights, the nodes are sorted, allowing optimization resources to prioritize high-frequency predicates in the business logic. Finally, based on the optimal predicate execution sequence, entirely new node objects are created in memory. By reconstructing the parent-child reference relationships between these new node objects, a decision tree with a completely new topology is generated. This differs from simply adjusting the order of existing nodes in the logical list, enabling more thorough physical structure-level optimization. An atomic reference switching mechanism is used to replace the old and new decision trees, instantly switching the execution reference of the decision engine from the old root node to the new root node. This ensures that the optimization deployment process does not interrupt real-time business operations, improving system high availability. An automated closed-loop process of "monitoring-analysis-reconstruction-replacement" is constructed, enabling the system to automatically adapt to dynamic changes in business data without manual intervention. This ensures the smoothness and safety of the optimization process, achieving system self-evolution without affecting business continuity, making the system more intelligent and stable. Since updating and adjusting the tree structure does not involve locking, dynamic updates do not affect the performance of real-time decision-making. Through the above improvements, this embodiment can move "truncated" nodes with a high probability of false to the front, effectively achieving short-circuit evaluation, minimizing unnecessary computation, and improving business execution efficiency.

[0126] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0127] Based on the same inventive concept, this application also provides a business execution optimization apparatus for implementing the business execution optimization method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more business execution optimization apparatus embodiments provided below can be found in the limitations of the business execution optimization method described above, and will not be repeated here.

[0128] In one embodiment, such as Figure 5 As shown, a business execution optimization device is provided, applied to a decision execution device. The business execution optimization device includes:

[0129] The acquisition module 100 is used to acquire the initial decision topology structure to be adjusted, which matches the business rule set, in response to the business execution optimization command. The decision topology structure includes multiple logical nodes.

[0130] The calculation module 200 is used to calculate the predicate weight of the logical predicate corresponding to each logical node based on the historical node call data of the initial decision topology. The historical node call data includes the node evaluation probability.

[0131] The sorting module 300 is used to sort multiple logical predicates based on predicate weights to obtain the predicate sorting result.

[0132] Module 400 is used to construct a target decision topology that matches the business rule set based on the predicate sorting results.

[0133] In one embodiment, the acquisition module 100 is used for:

[0134] For each business rule in the business rule set, logical characters are extracted to obtain multiple logical predicates and logical operators;

[0135] Based on the aforementioned logical predicates and logical operators, multiple logical nodes are constructed;

[0136] Based on multiple logical nodes, the initial decision topology structure to be adjusted is determined.

[0137] In one embodiment, the computing module 200 is further configured to:

[0138] In response to the decision execution device processing business data requests based on the initial decision topology, the number of executions and evaluation results of each logical node are counted.

[0139] Based on the evaluation result and the number of executions, the node evaluation probability of each logical node is determined.

[0140] In one embodiment, the node evaluation probability includes the probability that the evaluation result is false; the predicate weight is proportional to the node evaluation probability; the sorting module 300 is further configured to:

[0141] Based on the predicate weights from largest to smallest, the logical predicates are sorted to obtain the predicate sorting result.

[0142] In one embodiment, the historical node call data further includes node call frequency; the calculation module 200 is also used for:

[0143] The predicate weight of each logical predicate is obtained by weighting the node evaluation probability based on the node call frequency.

[0144] In one embodiment, the building module 400 is used for:

[0145] Based on each logical predicate in the predicate sorting result, a node object is created to obtain multiple logical nodes;

[0146] Based on the predicate sorting results, construct the reference relationships between the multiple logical nodes;

[0147] Based on the logical nodes and the reference relationships, a target decision topology structure matching the business rule set is constructed.

[0148] In one embodiment, the decision execution device invokes a decision topology structure to process business data requests through preset node mapping information; the preset node mapping information includes the mapping relationship between business data requests and logical nodes; the construction module 400 is further configured to:

[0149] Based on the target decision topology, the preset node mapping information is updated;

[0150] When there is no mapping relationship to the initial decision topology in the preset node mapping information, the initial decision topology is cleared.

[0151] Each module in the aforementioned business execution optimization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0152] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores historical call data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a business execution optimization method.

[0153] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0154] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the business execution optimization method of any of the above embodiments.

[0155] In response to a business execution optimization command, an initial decision topology structure to be adjusted is obtained that matches the business rule set; the decision topology structure includes multiple logical nodes;

[0156] Based on the historical node call data of the initial decision topology, calculate the predicate weight of the logical predicate corresponding to each logical node; the historical node call data includes the node evaluation probability;

[0157] Based on the predicate weights, the logical predicates are sorted to obtain the predicate sorting result;

[0158] Based on the predicate ranking results, a target decision topology structure matching the business rule set is constructed.

[0159] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the business execution optimization method of any of the above embodiments:

[0160] In response to a business execution optimization command, an initial decision topology structure to be adjusted is obtained that matches the business rule set; the decision topology structure includes multiple logical nodes;

[0161] Based on the historical node call data of the initial decision topology, calculate the predicate weight of the logical predicate corresponding to each logical node; the historical node call data includes the node evaluation probability;

[0162] Based on the predicate weights, the logical predicates are sorted to obtain the predicate sorting result;

[0163] Based on the predicate ranking results, a target decision topology structure matching the business rule set is constructed.

[0164] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0165] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0166] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0167] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A service execution optimization method characterized by, The business execution optimization method is applied to a decision execution device, and the business execution optimization method comprises the following steps: In response to a business execution optimization instruction, an initial decision topology structure to be adjusted that matches a business rule set is obtained; the decision topology structure comprises a plurality of logical nodes; According to historical node invocation data of the initial decision topology structure, a predicate weight of a logical predicate corresponding to each of the logical nodes is calculated; the historical node invocation data comprises a node evaluation probability; Based on the predicate weight, the plurality of logical predicates are sorted to obtain a predicate sorting result; Based on the predicate sorting result, a target decision topology structure that matches the business rule set is constructed.

2. The business execution optimization method of claim 1, wherein, The obtaining of the initial decision topology structure to be adjusted that matches the business rule set comprises the following steps: Logical character extraction is performed on each business rule in the business rule set to obtain a plurality of logical predicates and logical operators; Based on the logical predicates and the logical operators, a plurality of logical nodes are constructed; Based on the plurality of logical nodes, the initial decision topology structure to be adjusted is determined.

3. The business execution optimization method of claim 1, wherein, Before the calculating of the predicate weight of the logical predicate corresponding to each of the logical nodes according to the historical node invocation data of the initial decision topology structure, the following steps are further included: In response to the processing of a business data request by the decision execution device based on the initial decision topology structure, the number of executions and the evaluation result of each of the logical nodes are counted; Based on the evaluation result and the number of executions, a node evaluation probability of each of the logical nodes is determined.

4. The business execution optimization method of claim 1, wherein, The node evaluation probability comprises a probability of a false evaluation result; The predicate weight is directly proportional to the node evaluation probability; based on the predicate weight, the plurality of logical predicates are sorted to obtain a predicate sorting result, which comprises the following step: Based on the predicate weight from large to small, the plurality of logical predicates are sorted to obtain the predicate sorting result.

5. The business execution optimization method according to claim 1 or claim 4, characterized by, The historical node invocation data further comprises a node invocation frequency; the calculating of the predicate weight of the logical predicate corresponding to each of the logical nodes according to the historical node invocation data of the initial decision topology structure comprises the following step: Based on the node invocation frequency, the node evaluation probability is weighted to obtain the predicate weight of each of the logical predicates.

6. The business execution optimization method of claim 1, wherein, Based on the predicate sorting result, a target decision topology structure that matches the business rule set is constructed, which comprises the following steps: According to each of the logical predicates in the predicate sorting result, a node object is created to obtain a plurality of logical nodes; According to the predicate sorting result, a reference relationship between the plurality of logical nodes is constructed; Based on the logical nodes and the reference relationship, a target decision topology structure that matches the business rule set is constructed.

7. The business execution optimization method of claim 1, wherein, The decision execution device invokes a decision topology structure through preset node mapping information to process a business data request; the preset node mapping information comprises a mapping relationship between a business data request and a logical node; After the construction of the target decision topology structure that matches the business rule set based on the predicate sorting result, the following step is further included: Based on the target decision topology structure, the preset node mapping information is updated. When the mapping relationship mapped to the initial decision topology structure does not exist in the preset node mapping information, the initial decision topology structure is cleared.

8. A service execution optimization apparatus characterized by comprising: The business execution optimization device is applied to a decision execution device, and the business execution optimization device comprises: An acquisition module is configured to acquire an initial decision topology structure to be adjusted matched with a business rule set in response to a business execution optimization instruction; the decision topology structure comprises a plurality of logical nodes; A calculation module is configured to calculate a predicate weight of a logical predicate corresponding to each of the logical nodes according to historical node invocation data of the initial decision topology structure; the historical node invocation data comprises a node evaluation probability; An ordering module is configured to order a plurality of the logical predicates based on the predicate weight to obtain a predicate ordering result; A construction module is configured to construct a target decision topology structure matched with the business rule set based on the predicate ordering result. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to implement the method in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1 to 7.