Multi-condition approval flow engine method and system based on recursive matching of rule tree

CN123014930APending Publication Date: 2026-10-30HUNAN JINXIU CLOUD INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611218015.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-12
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

批量并发业务请求下,大量相同条件参数会重复触发完整规则树遍历、审批节点提取与路径计算流程,重复计算带来高额CPU运算开销,使得审批路径解析响应延迟显著提升,高并发场景下引擎整体吞吐能力受限

Benefits of technology

[0062]1.本发明通过对业务传入条件参数完成排重分组并生成统一哈希排重标识,依托该标识构建缓存检索键完成前置缓存匹配,命中场景可直接复用历史匹配结果,无需重复执行规则树全量遍历逻辑,大幅削减重复条件下规则解析与路径计算的计算开销,有效提升多条件审批路径的匹配响应速度。同时采用深度优先递归遍历规则树提取审批节点,同步完成路径冗余节点剔除,减少无效节点参与后续路径运算,进一步压缩单次审批路径生成的运算耗时。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123014930A_ABST
    Figure CN123014930A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of enterprise examination and approval, and provides a multi-condition examination and approval flow engine method and system based on rule tree recursive matching, which comprises the following steps: performing de-duplication grouping on a condition parameter object to obtain a condition grouping, a de-duplication identification string and business data identification; performing matching search on a cache area to extract rule tree node data; performing recursive traversal on the rule tree to obtain a rule tree node chain; performing examination and approval person node information extraction on the rule tree node chain to obtain an examination and approval path; performing path redundancy elimination on the examination and approval path to obtain a de-duplication examination and approval path; performing path difference degree discrimination on the de-duplication examination and approval path to obtain a candidate difference path; performing matching path extraction on the candidate difference path to obtain a final examination and approval path; and associating and caching the condition grouping and the de-duplication identification string based on the final examination and approval path to obtain a cached matching result; and the application can improve the efficiency of the multi-condition examination and approval flow engine based on rule tree recursive matching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of enterprise approval technology, and in particular to a multi-condition approval flow engine method and system based on rule tree recursive matching. Background Technology

[0002] In enterprise multi-condition approval scenarios, existing approval flow engines mostly use a linear rule-by-rule traversal matching mode to process the condition parameters passed in by the business, without uniformly identifying and caching duplicate condition parameters for reuse. Under batch concurrent business requests, a large number of identical condition parameters will repeatedly trigger the complete rule tree traversal, approval node extraction, and path calculation process. Repeated calculations bring high CPU computing overhead, significantly increasing the response latency of approval path parsing, and limiting the overall throughput of the engine in high-concurrency scenarios. At the same time, existing solutions lack a standardized path redundancy removal mechanism. The original approval path generated by rule tree traversal contains a large number of duplicate approver nodes. Redundant nodes continue to participate in subsequent path comparison calculations, further amplifying the processing time of a single request.

[0003] Existing approval workflow engines rely solely on simple sequence length matching to filter multiple candidate approval paths. This single-dimensional comparison method cannot accurately quantify the structural differences between different paths, easily resulting in non-optimal approval paths that deviate from business rules. Furthermore, the path matching results lack persistent caching and association logic, requiring a complete rule parsing process from scratch for each business request, making it impossible to reduce computational load by leveraging historical matching results. The lack of a multi-dimensional difference measurement model that integrates sequence similarity, edit offset, and length difference leads to insufficient path identification accuracy, frequent path matching errors, and repeated retry calculations, making it difficult to reliably support the efficient operation of large-scale, multi-condition approval processes. Summary of the Invention

[0004] This invention provides a multi-condition approval flow engine method and system based on rule tree recursive matching to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides a multi-condition approval flow engine method based on rule tree recursive matching, comprising:

[0006] S1. Perform deduplication and grouping on the condition parameter object passed in from the business end to obtain the condition group, deduplication identifier string and business data identifier from the business end.

[0007] S2. Based on the deduplication identifier string and the preset rule tree, perform matching and retrieval on the built-in cache of the business terminal, and extract the rule tree node data of the business terminal when no match is found.

[0008] S3. Based on the rule tree node data, recursively traverse the rule tree to obtain the rule tree node chain of the business end, and extract the approver node information from the rule tree node chain to obtain the approval path of the business end.

[0009] S4. Perform path redundancy elimination on the approval path to obtain the deduplicated approval path of the business end;

[0010] S5. Based on the preset path difference degree, perform path difference degree discrimination on the deduplication approval path to obtain the candidate difference path of the business end, and perform matching path extraction on the candidate difference path to obtain the final approval path of the business end.

[0011] S6. Based on the final approval path, associate and cache the approvers of the condition group and the deduplication identifier string to obtain the cached matching result of the business end.

[0012] In a preferred embodiment, the condition parameter object input from the business terminal is deduplicated and grouped to obtain the condition grouping from the business terminal, the deduplication identifier string, and the business data identifier, including:

[0013] The condition parameter object passed from the business side is parsed and constructed to obtain the condition key-value pairs from the business side;

[0014] The condition key-value pairs are merged to obtain the condition feature sequence of the business terminal;

[0015] The conditional feature sequence is hashed to obtain the deduplication identifier string of the business end;

[0016] The condition parameter object is parsed to obtain the business data identifier of the business end.

[0017] Based on the deduplication identifier string, the condition parameter objects are grouped and merged to obtain the condition groups of the business side.

[0018] In a preferred embodiment, based on the deduplication identifier string and a preset rule tree, a matching search is performed on the cache built into the business terminal, and when a match is not found, the rule tree node data of the business terminal is extracted, including:

[0019] The deduplication identifier string is converted into a cache key to obtain the cache retrieval key of the business side;

[0020] Based on the cache retrieval key, a primary key matching retrieval is performed on the cache area built into the business terminal to obtain the primary key cache retrieval result of the business terminal;

[0021] When the primary key cache retrieval result indicates a no-hit, a node extraction instruction for the business side is generated based on the cache retrieval key;

[0022] Based on the node extraction instruction, the node data of the preset rule tree is read to obtain the rule tree node data of the business end.

[0023] In a preferred embodiment, based on the rule tree node data, the rule tree is recursively traversed to obtain the rule tree node chain of the business end, and the approver node information is extracted from the rule tree node chain to obtain the approval path of the business end, including:

[0024] Based on the root node identifier in the rule tree node data, the rule tree is traversed recursively in a depth-first manner to obtain the rule tree node chain of the business side.

[0025] Based on the preset approver node type, the rule tree node chain is compared with the type label to obtain the approver candidate node record of the business end;

[0026] Redundancy is removed from the candidate approver node records to obtain the deduplicated approver node records in the business end;

[0027] The attributes of the deduplicated approver node records are parsed to obtain the approver identity identifier sequence of the business end;

[0028] The approval path of the business terminal is obtained by integrating the path nodes of the approver's identity sequence.

[0029] In a preferred embodiment, based on a preset approver node type, the rule tree node chain is compared using type tags to obtain the approver candidate node record for the business side, including:

[0030] The node type labels of the rule tree node chain are read to obtain the node type label sequence of the business side;

[0031] The node type tag sequence is matched with the preset approver node type to obtain the tag matching result of the business end;

[0032] The tag matching results are marked as approver candidate nodes to obtain the matching node tag set of the business side;

[0033] The approving person integration and extraction are performed on the matching node tag set to obtain the approving person candidate node record of the business end.

[0034] In a preferred embodiment, path redundancy elimination is performed on the approval path to obtain a deduplicated approval path for the business end, including:

[0035] Sequence parsing is performed on the approver's identity identifier in the approval path to obtain the path node sequence of the business end;

[0036] The path node sequence is marked with repeating nodes to obtain the marked approval node sequence of the business side;

[0037] The deduplication path is constructed by performing deduplication on the marked approval node sequence to obtain the deduplication approval path of the business end.

[0038] In a preferred embodiment, based on a preset path difference degree, the deduplication approval path is judged to obtain candidate difference paths for the business end, and the candidate difference paths are matched and extracted to obtain the final approval path for the business end, including:

[0039] The structural features of the deduplication approval path are obtained to obtain the path identifier sequence of the business end;

[0040] The rule tree node data is used to construct paths to obtain the reference approval path for the business side;

[0041] The reference approval path is parsed to obtain the reference identifier sequence of the reference approval path;

[0042] The path difference between the path identifier sequence and the reference identifier sequence is calculated to obtain the difference count of the business end.

[0043] The difference count is compared with the preset path difference count to obtain the candidate difference path of the business end;

[0044] The candidate difference paths are sorted by path similarity to obtain the sorted candidate path list for the business side;

[0045] The optimal path is selected from the list of candidate paths to obtain the final approval path for the business side.

[0046] In a preferred embodiment, the formula for calculating the difference count is:

[0047] ;

[0048] in, Count the degree of difference; The length of the path identifier sequence; The length of the reference identifier sequence; The path identifier sequence length With the length of the reference identifier sequence The absolute difference; The larger of the lengths of the path identifier sequence and the reference identifier sequence; The length of the longest common subsequence of the path identifier sequence and the reference identifier sequence; The edit distance between the path identifier sequence and the reference identifier sequence; To measure the degree of missing global sequential matches; It is the logarithm of the ratio of the absolute difference to the total size; The hyperbolic tangent of the ratio of the edit distance to the larger value is given.

[0049] In a preferred embodiment, based on the final approval path, the approvers of the conditional group and the deduplication identifier string are associated and cached to obtain the cached matching results from the business side, including:

[0050] The approver identifier sequence is parsed from the final approval path to obtain the approver identifier sequence from the business side.

[0051] The deduplication identifier string and the condition grouping are merged and constructed to obtain the composite cache key of the business side;

[0052] The approver identifier sequence is mapped to the composite cache key to obtain the associated cache data of the business side;

[0053] The associated cached data is written into the cache area of ​​the business terminal to obtain the cached matching result of the business terminal.

[0054] To address the aforementioned problems, this invention also provides a multi-condition approval flow engine system based on rule tree recursive matching, the system comprising:

[0055] The deduplication and grouping module is used to deduplicatize and group the condition parameter objects passed in from the business end, and obtain the condition group, deduplication identifier string and business data identifier from the business end.

[0056] The cache matching module is used to perform matching and retrieval of the built-in cache area of ​​the business terminal based on the deduplication identifier string and the preset rule tree, and extract the rule tree node data of the business terminal when no match is found.

[0057] The recursive traversal module is used to recursively traverse the rule tree based on the rule tree node data to obtain the rule tree node chain of the business end, and extract the approver node information of the rule tree node chain to obtain the approval path of the business end.

[0058] The path deduplication module is used to eliminate path redundancy in the approval path to obtain the deduplicated approval path of the business end.

[0059] The multi-path parsing module is used to determine the path difference of the deduplication approval path based on a preset path difference degree, obtain the candidate difference path of the business end, and perform matching path extraction on the candidate difference path to obtain the final approval path of the business end.

[0060] The result caching module is used to associate and cache the approvers of the condition group and the deduplication identifier string based on the final approval path, so as to obtain the cached matching result of the business side.

[0061] Compared with the prior art, the present invention has the following beneficial effects:

[0062] 1. This invention performs deduplication and grouping on business input condition parameters and generates a unified hash deduplication identifier. Based on this identifier, a cache retrieval key is constructed to complete the pre-cache matching. In the case of a match, historical matching results can be directly reused without repeatedly executing the full traversal of the rule tree. This significantly reduces the computational overhead of rule parsing and path calculation under repeated conditions, effectively improving the matching response speed of multi-condition approval paths. At the same time, a depth-first recursive traversal of the rule tree is used to extract approval nodes, and redundant nodes in the path are removed simultaneously, reducing the participation of invalid nodes in subsequent path calculations, further compressing the computation time of generating a single approval path.

[0063] 2. This invention constructs a multi-dimensional path difference calculation formula by integrating the longest common subsequence and edit distance, quantitatively distinguishing and optimally selecting multiple candidate approval paths, and outputting a logically compliant final approval path that conforms to business rules. Furthermore, the final approval path is bound to conditional grouping and deduplication flags and written to the cache for persistent matching results, continuously reducing the repetitive calculation load of batch business requests, steadily improving the overall throughput of the approval flow engine, and ensuring the stability and computational efficiency of approval path parsing output in multi-concurrent business scenarios. Attached Figure Description

[0064] Figure 1 This is a flowchart illustrating a multi-condition approval flow engine method based on rule tree recursive matching, provided in an embodiment of the present invention.

[0065] Figure 2 This is a functional block diagram of a multi-condition approval flow engine system based on rule tree recursive matching provided in an embodiment of the present invention;

[0066] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0067] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0068] This application provides a multi-condition approval flow engine method based on rule tree recursive matching. The execution entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the multi-condition approval flow engine method based on rule tree recursive matching can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0069] Reference Figure 1 The diagram shown is a flowchart illustrating a multi-condition approval flow engine method based on rule tree recursive matching according to an embodiment of the present invention. In this embodiment, the multi-condition approval flow engine method based on rule tree recursive matching includes:

[0070] S1. Perform deduplication and grouping on the condition parameter object passed in from the business end to obtain the condition group, deduplication identifier string and business data identifier from the business end.

[0071] In this embodiment of the invention, the step of deduplicating and grouping the condition parameter object passed from the business terminal to obtain the condition grouping, deduplication identifier string, and business data identifier from the business terminal includes:

[0072] The condition parameter object passed from the business side is parsed and constructed to obtain the condition key-value pairs from the business side;

[0073] The condition key-value pairs are merged to obtain the condition feature sequence of the business terminal;

[0074] The conditional feature sequence is hashed to obtain the deduplication identifier string of the business end;

[0075] The condition parameter object is parsed to obtain the business data identifier of the business end.

[0076] Based on the deduplication identifier string, the condition parameter objects are grouped and merged to obtain the condition groups of the business side.

[0077] For the complete condition parameter object actively passed in by the business side, according to the attribute dimensions corresponding to the internal data structure of the object, we decompose and extract all the attribute names and corresponding attribute values ​​contained therein, complete the accurate splitting and matching of all valid parameter content, and organize each set of attribute names and corresponding attribute values ​​into an independent pairing structure, uniformly and systematically forming a standardized condition key-value pair for the business side, completely preserving all valid business condition information in the condition parameter object, without omission or tampering with the original parameter content.

[0078] For the condition key-value pairs of the completed business terminal, the attribute names of all condition key-value pairs are sequentially arranged according to a fixed and unique preset sorting rule, completely disrupting the original disordered arrangement and forming an ordered arrangement of all key-value pairs. Then, adjacent duplicate or redundant condition key-value pairs with the same attribute meaning and value after sorting are merged and integrated, and duplicate and invalid key-value pairs are removed. Only the unique and valid condition key-value pair combination is retained, and finally, an ordered, non-redundant, and standardized condition feature sequence of the business terminal is formed, which fully carries all valid business condition feature information.

[0079] For the well-organized condition feature sequence of the business end, all ordered condition content contained within the sequence is extracted. According to a fixed character mapping conversion rule, the complete condition feature sequence is converted into a fixed-length, uniquely corresponding string content. This string content can accurately match the current complete condition feature sequence. Each unique condition feature sequence corresponds to a set of exclusive strings, and finally, a deduplication identifier string that can be used to identify the uniqueness of the condition features of the business end is generated.

[0080] The system performs targeted business data decomposition and identification on the original condition parameter objects passed in from the business side, accurately filters out the unique identifiers within the objects that distinguish the unique business entity, business item, and business source, removes auxiliary parameters that are only used for condition filtering, extracts the core business identifier information separately and completes its regularization and integration, and organizes it into a business data identifier for the business side that can accurately locate the corresponding business data, thereby achieving precise binding between a single set of condition parameter objects and the corresponding business data.

[0081] Using the deduplication identifier string generated by the completed business end as the sole grouping criterion, all business end condition parameter objects to be processed are traversed. Condition parameter objects with completely identical deduplication identifier strings are grouped into the same set, while condition parameter objects with different deduplication identifier strings are divided into different sets. This process completes the classification and integration of all condition parameter objects, ultimately forming multiple groups of clearly defined, non-overlapping, and non-repeating business end condition groups.

[0082] The beneficial effects are that by performing a complete standardized processing flow of layer-by-layer decomposition, regularization, feature transformation, identifier extraction, and precise grouping of business condition parameter objects, it can achieve fully automatic and accurate deduplication and standardized grouping of business condition parameters, completely avoiding the problems of omission, misclassification, and duplicate grouping that occur in manual grouping. It accurately generates unique deduplication identifier strings and business data identifiers, ensuring that each group of business condition groups corresponds to unique business condition features and exclusive business data, greatly improving the regularity, accuracy, and uniformity of business condition data organization, providing an accurate, standardized, and non-redundant data foundation for subsequent business data statistics, filtering, matching, and subsequent business logic processing, and effectively improving the efficiency and quality of overall business data processing.

[0083] S2. Based on the deduplication identifier string and the preset rule tree, perform matching and retrieval on the built-in cache of the business terminal, and extract the rule tree node data of the business terminal when no match is found.

[0084] In this embodiment of the invention, the step of matching and searching the built-in cache of the business terminal based on the deduplication identifier string and the preset rule tree, and extracting the rule tree node data of the business terminal when no match is found, includes:

[0085] The deduplication identifier string is converted into a cache key to obtain the cache retrieval key of the business side;

[0086] Based on the cache retrieval key, a primary key matching retrieval is performed on the cache area built into the business terminal to obtain the primary key cache retrieval result of the business terminal;

[0087] When the primary key cache retrieval result indicates a no-hit, a node extraction instruction for the business side is generated based on the cache retrieval key;

[0088] Based on the node extraction instruction, the node data of the preset rule tree is read to obtain the rule tree node data of the business end.

[0089] The device retrieves the corresponding logic for cache key conversion, performs bit-by-bit content adaptation and format conversion on the obtained deduplication identifier string, uniformly adapts to the primary key storage specification of the business-side cache area, and finally generates a compliant and uniquely corresponding cache retrieval key for the business side.

[0090] The device relies on the cache retrieval key of the converted business end, traverses all stored cached primary key content in the built-in cache area of ​​the business end, completes the full matching and comparison of character content one by one, accurately determines whether there is primary key data in the cache area that is completely consistent with the current cache retrieval key, and finally outputs a clear primary key cache retrieval result of the business end.

[0091] When the primary key cache retrieval result on the business side clearly determines that there is no matching data in the cache area, i.e., the retrieval is a miss, the device retrieves the preset instruction generation specification, uses the currently generated cache retrieval key on the business side as the core basis, fully assembles the corresponding instruction content, and generates a node extraction instruction on the business side that can directly call the rule tree.

[0092] The device responds to the node extraction command generated by the business end, locates the preset rule tree that has been configured in advance in the system, and reads the complete node content data under the corresponding path layer by layer according to the node hierarchy storage structure of the rule tree. It then obtains all the information in the rule tree that matches the current search requirements and gets the complete rule tree node data of the business end.

[0093] The device integrates the entire process execution logic of cache retrieval and node extraction. It completes the standardized conversion of cache keys by relying on deduplication identifier strings, and retrieves cache data first through accurate cache primary key matching. It only triggers the rule tree node data reading operation in the case of cache miss, thus fully realizing the complete set of business operations of business-side cache area matching retrieval and accurate extraction of rule tree node data.

[0094] The beneficial effects of this implementation process are that by standardizing the deduplication identifier string into a dedicated cache retrieval key, accurate cache matching is carried out, cached data is reused first, and rule tree node data extraction is only performed when the cache is not hit. The entire operation logic is fixed and standardized, and each step has a clear execution basis and corresponding output product, which completely avoids the problems of chaotic retrieval matching and misaligned data extraction. This effectively improves the overall efficiency of data retrieval and node acquisition on the business side, while ensuring the accuracy and stability of data retrieval, avoiding invalid rule tree reading operations, and reducing the unnecessary consumption of system resources.

[0095] S3. Based on the rule tree node data, recursively traverse the rule tree to obtain the rule tree node chain of the business end, and extract the approver node information from the rule tree node chain to obtain the approval path of the business end.

[0096] In this embodiment of the invention, the step of recursively traversing the rule tree based on the rule tree node data to obtain the rule tree node chain of the business end, and extracting approver node information from the rule tree node chain to obtain the approval path of the business end, includes:

[0097] Based on the root node identifier in the rule tree node data, the rule tree is traversed recursively in a depth-first manner to obtain the rule tree node chain of the business side.

[0098] Based on the preset approver node type, the rule tree node chain is compared with the type label to obtain the approver candidate node record of the business end;

[0099] Redundancy is removed from the candidate approver node records to obtain the deduplicated approver node records in the business end;

[0100] The attributes of the deduplicated approver node records are parsed to obtain the approver identity identifier sequence of the business end;

[0101] The approval path of the business terminal is obtained by integrating the path nodes of the approver's identity sequence.

[0102] The method of comparing type tags of the rule tree node chain based on the preset approver node type to obtain the approver candidate node record of the business side includes:

[0103] The node type labels of the rule tree node chain are read to obtain the node type label sequence of the business side;

[0104] The node type tag sequence is matched with the preset approver node type to obtain the tag matching result of the business end;

[0105] The tag matching results are marked as approver candidate nodes to obtain the matching node tag set of the business side;

[0106] The approving person integration and extraction are performed on the matching node tag set to obtain the approving person candidate node record of the business end.

[0107] Based on the acquired rule tree node data, a depth-first recursive traversal operation is performed on the complete rule tree. The traversal process searches all related nodes layer by layer downwards according to the hierarchical structure of the rule tree, collects all rule tree nodes corresponding to the business side, and connects them in the traversal order to finally form a complete rule tree node chain for the business side.

[0108] The system retrieves the pre-defined fixed approver node types and compares the tag content of the type attributes of each node in the generated business side rule tree node chain one by one. It accurately filters out all nodes whose node types completely match the preset approver node types and summarizes all matching nodes to form the business side approver candidate node record.

[0109] Redundancy removal is performed on the generated candidate approver node records for the business side. The core content such as node identity information, node number, and node affiliation attribute in each record is verified one by one. All duplicate and redundant node content of the same type is removed, and the unique and valid node information is retained to form a deduplicated approver node record for the business side without duplicate content.

[0110] The inherent attribute information of each node in the deduplication approver node record of the business side is fully analyzed, and the unique identity information corresponding to each valid approval node is extracted one by one. The nodes are arranged and integrated in sequence according to the hierarchical order and traversal order in the rule tree to form an ordered sequence of approver identity information of the business side.

[0111] The path node integration operation is carried out on the generated approval person identity sequence of the business side. The multiple discrete approval person identities are sequentially connected and spliced ​​according to the business approval flow logic and rule tree hierarchical relationship, and uniformly organized into a complete node path structure, and finally the approval path of the business side is generated.

[0112] Read the node type label content of each node in the rule tree node chain of the business side one by one, collect the type labels of all nodes completely, and summarize them in the order of node arrangement to form a continuous and complete node type label sequence of the business side.

[0113] Each tag in the node type tag sequence on the business side is compared and matched one by one with the preset approver node type content of the system to determine whether each tag content is completely consistent with the preset type content. The matching result status of each node is accurately recorded and the overall results are summarized to form the tag matching result on the business side.

[0114] Based on the generated tag matching results of the business side, all nodes whose tag content completely matches the preset approver node type are uniformly marked as approver candidate nodes. All marked nodes are centrally summarized and collected to form a complete set of matching node tags for the business side.

[0115] The system integrates and extracts the approver information of all candidate nodes within the matching node tag set on the business side, extracts the core approver information corresponding to each tag node, removes invalid non-approval attribute content from the tag set, and organizes all valid approver node information to finally generate the approver candidate node record on the business side.

[0116] The beneficial effects of this implementation process are that, through hierarchical and progressive rule tree recursive traversal, precise tag matching, redundancy removal, attribute parsing, and path integration, the entire process is standardized. It can accurately and completely extract valid approver nodes from the rule tree, completely avoiding interference from duplicate and invalid nodes in the generation of approval paths. It strictly relies on the original node data of the rule tree and preset standards to complete the entire process, ensuring that the generated approval paths are unique, accurate, and standardized. At the same time, the entire process is detailed and orderly connected, which can adapt to the approval path parsing scenarios of rule trees in various business terminals, effectively improving the standardization and accuracy of business approval path generation, and providing reliable, compliant, and complete path data support for subsequent business approval processes.

[0117] S4. Perform path redundancy elimination on the approval path to obtain the deduplicated approval path of the business end;

[0118] In this embodiment of the invention, the step of eliminating path redundancy in the approval path to obtain the deduplicated approval path on the business side includes:

[0119] Sequence parsing is performed on the approver's identity identifier in the approval path to obtain the path node sequence of the business end;

[0120] The path node sequence is marked with repeating nodes to obtain the marked approval node sequence of the business side;

[0121] The deduplication path is constructed by performing deduplication on the marked approval node sequence to obtain the deduplication approval path of the business end.

[0122] Retrieve all approver identity information stored internally in the complete approval path of the business end, extract each group of approver identity information in the order of the approval process, arrange all extracted approver identity information in the order of the approval flow, and directly define the continuous combination of the arranged identity information as the path node sequence of the business end, retaining the flow order corresponding to all original approver identity information without deletion or modification.

[0123] The system reads each independent approver identifier from the path node sequence on the business side, and compares the content of the currently read approver identifier with all approver identifiers in the path node sequence that precede it. If the content of the two approver identifiers is completely consistent, a unique duplicate mark is added to the corresponding position of the currently repeated approver identifier. If the content of the two approver identifiers is different, no mark is added. After completing the identification comparison and marking operation for all positions in the path node sequence, a marked approval node sequence is generated on the business side. The marked approval node sequence completely retains the original path node sequence's node arrangement order and only adds a unique mark for duplicate nodes.

[0124] The process iterates through the marked approval node sequence on the business side from beginning to end, prioritizing the retention of all approver identity nodes within the marked approval node sequence that do not carry duplicate marks. Nodes without duplicate marks are collected sequentially according to the original flow order of the marked approval node sequence. If an approver identity node with a duplicate mark is encountered, it is skipped and not included in the collection. All approved approver identity nodes that have been collected and have no duplicate nodes are combined and assembled according to the original flow order. The completed flow content is directly used as the deduplication approval path on the business side. The deduplication approval path only retains the approver identity node that appears only once, and the node flow order is consistent with the original approval path.

[0125] The beneficial effects are that the entire approval process is completed by relying on the approver's identity to eliminate redundancy. The entire process relies on the original approval flow order to carry out node parsing, marking and path reconstruction operations, accurately remove duplicate approver nodes in the approval path, fully retain the compliant and valid approval flow order, avoid the process redundancy problem caused by duplicate approval nodes, simplify the actual approval flow link on the business side without destroying the original approval process's sequential logic, and ensure that the approval path flow logic on the business side is accurate and reliable.

[0126] S5. Based on the preset path difference degree, perform path difference degree discrimination on the deduplication approval path to obtain the candidate difference path of the business end, and perform matching path extraction on the candidate difference path to obtain the final approval path of the business end.

[0127] In this embodiment of the invention, the step of determining the path difference of the deduplication approval path based on a preset path difference degree to obtain candidate difference paths for the business end, and extracting matching paths from the candidate difference paths to obtain the final approval path for the business end, includes:

[0128] The structural features of the deduplication approval path are obtained to obtain the path identifier sequence of the business end;

[0129] The rule tree node data is used to construct paths to obtain the reference approval path for the business side;

[0130] The reference approval path is parsed to obtain the reference identifier sequence of the reference approval path;

[0131] The path difference between the path identifier sequence and the reference identifier sequence is calculated to obtain the difference count of the business end.

[0132] The difference count is compared with the preset path difference count to obtain the candidate difference path of the business end;

[0133] The candidate difference paths are sorted by path similarity to obtain the sorted candidate path list for the business side;

[0134] The optimal path is selected from the list of candidate paths to obtain the final approval path for the business side.

[0135] The formula for calculating the difference count is:

[0136] ;

[0137] in, Count the degree of difference; The length of the path identifier sequence; The length of the reference identifier sequence; The path identifier sequence length With the length of the reference identifier sequence The absolute difference; The larger of the lengths of the path identifier sequence and the reference identifier sequence; The length of the longest common subsequence of the path identifier sequence and the reference identifier sequence; The edit distance between the path identifier sequence and the reference identifier sequence; To measure the degree of missing global sequential matches; It is the logarithm of the ratio of the absolute difference to the total size; The hyperbolic tangent of the ratio of the edit distance to the larger value is given.

[0138] Collect all structural feature information such as node arrangement, node type, and node flow order of all deduplication approval paths. Standardize and encode the collected structural feature information to transform the structural features of each deduplication approval path into a unique corresponding sequence identifier, and finally generate a complete and accurate path identifier sequence for the business end.

[0139] Retrieve the pre-stored rule tree node data, and according to the standard workflow logic of the approval business, the hierarchical relationship of the nodes, and the node jump constraints, perform step-by-step splicing, hierarchical association, and path connection processing on the scattered rule tree node data to build a reference approval path for the business end that conforms to business specifications, has complete node associations, and has smooth workflow logic.

[0140] The constructed reference approval path is decomposed into all nodes. The unique identifier information corresponding to each approval node in the path is extracted one by one. According to the actual flow order of the reference approval path, all the unique identifiers of the nodes are arranged in an orderly manner, and the reference identifier sequence of the corresponding reference approval path is completely parsed.

[0141] A comprehensive content comparison analysis is conducted between the path identifier sequence of the business side and the reference identifier sequence of the reference approval path. First, the continuous subsequences with completely identical positions and contents in the two sequences are identified and their maximum length is calculated. Then, the number of node addition, deletion, replacement, and shift operations required to achieve complete content matching between the two sequences is calculated. Combining the overall length value, length difference, and overall scale ratio of the two sequences, the path difference calculation of the two sequences is completed, and finally, an accurate difference count of the business side is obtained.

[0142] The calculated difference counts from the business side are compared one-to-one with the path difference counts set in the system according to a fixed standard. The deduplication approval paths that meet the preset path difference compliance standards are selected. All the selected compliant paths are categorized and summarized to form a complete set of candidate difference paths for the business side.

[0143] For all candidate difference paths from all business ends that have been screened, each path is compared with the reference approval path in terms of overall matching degree, node flow consistency, and sequence content overlap. According to a fixed sorting rule of overall path similarity from high to low, all candidate difference paths are arranged in an orderly manner to generate an ordered list of sorted candidate paths for business ends.

[0144] The optimal path selection process is carried out on the candidate path list of the sorted business terminals. The path similarity ranking result is used as the core judgment criterion. The candidate path with the highest similarity level and the closest matching degree with the standard approval flow logic is selected and determined as the only compliant and valid final approval path for the business terminal.

[0145] The beneficial effects are that this entire approval path processing flow relies on a complete closed-loop logic of path structure feature analysis, sequence comparison difference calculation, similarity ranking, and optimal selection. It can accurately identify the differences between different approval paths and standard reference paths, eliminate subjective biases and omissions caused by manual judgment of path differences, and strictly select the final approval path that is suitable for the business scenario according to standardized rules. This effectively improves the accuracy and standardization of approval path selection, avoids the use of invalid or biased approval paths in business, and the entire process is standardized and has a complete logical closed loop. It can adapt to the path optimization and selection needs of various complex approval business scenarios, greatly improve the intelligence and accuracy of business approval path configuration, and ensure the compliance and smoothness of approval business flow.

[0146] S6. Based on the final approval path, associate and cache the approvers of the condition group and the deduplication identifier string to obtain the cached matching result of the business end.

[0147] In this embodiment of the invention, the step of associating and caching the approvers of the conditional group and the deduplication identifier string based on the final approval path to obtain the cached matching result on the business side includes:

[0148] The approver identifier sequence is parsed from the final approval path to obtain the approver identifier sequence from the business side.

[0149] The deduplication identifier string and the condition grouping are merged and constructed to obtain the composite cache key of the business side;

[0150] The approver identifier sequence is mapped to the composite cache key to obtain the associated cache data of the business side;

[0151] The associated cached data is written into the cache area of ​​the business terminal to obtain the cached matching result of the business terminal.

[0152] For the final approval path that has been determined, a special work of parsing the approver identifier sequence is carried out to completely extract all approver-related identifier information carried within the final approval path. According to the pre-set approval flow sequence of the final approval path, all extracted approver identifiers are arranged and integrated in an orderly manner to completely sort out the approver identifier sequence specific to the corresponding business end. This sequence completely retains all approver information and flow sequence information corresponding to the final approval path.

[0153] Lock the deduplication identifier string generated by the system and the condition grouping for classification and integration. Perform comprehensive merging and integration of the two types of data. Use the association rules for matching business data cache as the integration standard. Bind and merge the unique identifier attribute of the deduplication identifier string with the condition classification attribute of the condition group to complete the construction of the key-value carrier of the composite structure. Finally, generate a composite cache key that is adapted to business cache storage and matching.

[0154] The parsed business-side approver identifier sequence is used as the value content of the cached data, and the constructed business-side composite cache key is used as the index content of the cached data. A fixed one-to-one correspondence between the two is established, and standardized key-value pairing integration processing is completed to generate business-side associated cached data that contains both index information and corresponding value information.

[0155] The integrated and generated associated cache data is completely entered into the dedicated cache storage area of ​​the business side, completing the solidification and storage operation of the cache data. This allows the associated cache data to form effective cache data that can be directly called and quickly matched in the business side cache area, ultimately obtaining cached matching results that can be called by the business side.

[0156] The beneficial effects are that through the complete standardized operation of parsing the final approval path layer by layer, constructing cache keys, accurately mapping key-value pairs, and solidifying cache data, a fixed association cache correspondence can be formed between the approvers corresponding to the condition groups and the deduplication identifier strings. This accurately retains the approval process personnel information and unique deduplication identifier information corresponding to each group of business, completely avoiding the problems of chaotic cache data matching, missing information, and duplicate matching. At the same time, it standardizes the generation and storage standards of business-side cache data, greatly improves the speed and accuracy of subsequent business approval matching queries, and ensures the integrity, uniqueness, and reusability of various business approval cache data.

[0157] like Figure 2The diagram shown is a functional block diagram of a multi-condition approval flow engine system based on rule tree recursive matching provided in an embodiment of the present invention.

[0158] The multi-condition approval flow engine system 100 based on rule tree recursive matching described in this invention can be installed in an electronic device. Depending on the functions implemented, the multi-condition approval flow engine system 100 based on rule tree recursive matching may include a deduplication grouping module 101, a cache matching module 102, a recursive traversal module 103, a path deduplication module 104, a multi-path parsing module 105, and a result caching module 106. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and are stored in the memory of the electronic device.

[0159] In this embodiment, the functions of each module / unit are as follows:

[0160] The deduplication grouping module 101 is used to deduplicatize and group the condition parameter objects passed in by the business terminal to obtain the condition grouping, deduplication identifier string and business data identifier of the business terminal.

[0161] The cache matching module 102 is used to perform matching and retrieval of the built-in cache area of ​​the business terminal based on the deduplication identifier string and the preset rule tree, and extract the rule tree node data of the business terminal when the match is not found.

[0162] The recursive traversal module 103 is used to recursively traverse the rule tree based on the rule tree node data to obtain the rule tree node chain of the business end, and extract the approver node information of the rule tree node chain to obtain the approval path of the business end.

[0163] The path deduplication module 104 is used to eliminate path redundancy in the approval path to obtain the deduplicated approval path of the business end.

[0164] The multipath parsing module 105 is used to determine the path difference of the deduplication approval path based on a preset path difference degree, obtain the candidate difference path of the business end, and perform matching path extraction on the candidate difference path to obtain the final approval path of the business end.

[0165] The result caching module 106 is used to associate and cache the approvers of the condition group and the deduplication identifier string based on the final approval path, so as to obtain the cached matching result of the business end.

[0166] In the several embodiments provided by this invention, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0167] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0168] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0169] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0170] This application embodiment can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A multi-condition approval flow engine method based on rule tree recursive matching, characterized in that, The method includes: S1. Perform deduplication and grouping on the condition parameter object passed in from the business end to obtain the condition group, deduplication identifier string and business data identifier from the business end. S2. Based on the deduplication identifier string and the preset rule tree, perform matching and retrieval on the built-in cache of the business terminal, and extract the rule tree node data of the business terminal when no match is found. S3. Based on the rule tree node data, recursively traverse the rule tree to obtain the rule tree node chain of the business end, and extract the approver node information from the rule tree node chain to obtain the approval path of the business end. S4. Perform path redundancy elimination on the approval path to obtain the deduplicated approval path of the business end; S5. Based on the preset path difference degree, perform path difference degree discrimination on the deduplication approval path to obtain the candidate difference path of the business end, and perform matching path extraction on the candidate difference path to obtain the final approval path of the business end. S6. Based on the final approval path, associate and cache the approvers of the condition group and the deduplication identifier string to obtain the cached matching result of the business end.

2. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 1, characterized in that, The condition parameter object passed from the business side is deduplicated and grouped to obtain the condition grouping from the business side, the deduplication identifier string, and the business data identifier, including: The condition parameter object passed from the business side is parsed and constructed to obtain the condition key-value pairs from the business side; The condition key-value pairs are merged to obtain the condition feature sequence of the business terminal; The conditional feature sequence is hashed to obtain the deduplication identifier string of the business end; The condition parameter object is parsed to obtain the business data identifier of the business end. Based on the deduplication identifier string, the condition parameter objects are grouped and merged to obtain the condition groups of the business side.

3. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 1, characterized in that, Based on the deduplication identifier string and the preset rule tree, the built-in cache of the business terminal is matched and searched, and when no match is found, the rule tree node data of the business terminal is extracted, including: The deduplication identifier string is converted into a cache key to obtain the cache retrieval key of the business side; Based on the cache retrieval key, a primary key matching retrieval is performed on the cache area built into the business terminal to obtain the primary key cache retrieval result of the business terminal; When the primary key cache retrieval result indicates a no-hit, a node extraction instruction for the business side is generated based on the cache retrieval key; Based on the node extraction instruction, the node data of the preset rule tree is read to obtain the rule tree node data of the business end.

4. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 1, characterized in that, Based on the rule tree node data, the rule tree is recursively traversed to obtain the rule tree node chain of the business end, and the approver node information is extracted from the rule tree node chain to obtain the approval path of the business end, including: Based on the root node identifier in the rule tree node data, the rule tree is traversed recursively in a depth-first manner to obtain the rule tree node chain of the business side. Based on the preset approver node type, the rule tree node chain is compared with the type label to obtain the approver candidate node record of the business end; Redundancy is removed from the candidate approver node records to obtain the deduplicated approver node records in the business end; The attributes of the deduplicated approver node records are parsed to obtain the approver identity identifier sequence of the business end; The approval path of the business terminal is obtained by integrating the path nodes of the approver's identity sequence.

5. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 4, characterized in that, Based on the preset approver node type, the rule tree node chain is compared with type tags to obtain the approver candidate node record of the business side, including: The node type labels of the rule tree node chain are read to obtain the node type label sequence of the business side; The node type tag sequence is matched with the preset approver node type to obtain the tag matching result of the business end; The tag matching results are marked as approver candidate nodes to obtain the matching node tag set of the business side; The approving person integration and extraction are performed on the matching node tag set to obtain the approving person candidate node record of the business end.

6. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 1, characterized in that, The approval path is redundancy eliminated to obtain the deduplicated approval path for the business end, including: Sequence parsing is performed on the approver's identity identifier in the approval path to obtain the path node sequence of the business end; The path node sequence is marked with repeating nodes to obtain the marked approval node sequence of the business side; The deduplication path is constructed by performing deduplication on the marked approval node sequence to obtain the deduplication approval path of the business end.

7. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 1, characterized in that, Based on a preset path difference degree, the deduplication approval path is judged to obtain candidate difference paths for the business end, and the candidate difference paths are matched and extracted to obtain the final approval path for the business end, including: The structural features of the deduplication approval path are obtained to obtain the path identifier sequence of the business end; The rule tree node data is used to construct paths to obtain the reference approval path for the business side; The reference approval path is parsed to obtain the reference identifier sequence of the reference approval path; The path difference between the path identifier sequence and the reference identifier sequence is calculated to obtain the difference count of the business end. The difference count is compared with the preset path difference count to obtain the candidate difference path of the business end; The candidate difference paths are sorted by path similarity to obtain the sorted candidate path list for the business side; The optimal path is selected from the list of candidate paths to obtain the final approval path for the business side.

8. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 7, characterized in that, The formula for calculating the difference count is: ; in, Count the degree of difference; The length of the path identifier sequence; The length of the reference identifier sequence; The path identifier sequence length With the length of the reference identifier sequence The absolute difference; The larger of the lengths of the path identifier sequence and the reference identifier sequence; The length of the longest common subsequence of the path identifier sequence and the reference identifier sequence; The edit distance between the path identifier sequence and the reference identifier sequence; To measure the degree of missing global sequential matches; It is the logarithm of the ratio of the absolute difference to the total size; The hyperbolic tangent of the ratio of the edit distance to the larger value is given.

9. The multi-condition approval flow engine method based on rule tree recursive matching as described in claim 1, characterized in that, Based on the final approval path, the approvers in the conditional group and the deduplication identifier string are associated and cached to obtain the cached matching results from the business side, including: The approver identifier sequence is parsed from the final approval path to obtain the approver identifier sequence from the business side. The deduplication identifier string and the condition grouping are merged and constructed to obtain the composite cache key of the business side; The approver identifier sequence is mapped to the composite cache key to obtain the associated cache data of the business side; The associated cached data is written into the cache area of ​​the business terminal to obtain the cached matching result of the business terminal.

10. A multi-condition approval flow engine system based on rule tree recursive matching, characterized in that, The system for implementing the multi-condition approval flow engine method based on rule tree recursive matching as described in claim 1 includes: The deduplication and grouping module is used to deduplicatize and group the condition parameter objects passed in from the business end, and obtain the condition group, deduplication identifier string and business data identifier from the business end. The cache matching module is used to perform matching and retrieval of the built-in cache area of ​​the business terminal based on the deduplication identifier string and the preset rule tree, and extract the rule tree node data of the business terminal when no match is found. The recursive traversal module is used to recursively traverse the rule tree based on the rule tree node data to obtain the rule tree node chain of the business end, and extract the approver node information of the rule tree node chain to obtain the approval path of the business end. The path deduplication module is used to eliminate path redundancy in the approval path to obtain the deduplicated approval path of the business end. The multi-path parsing module is used to determine the path difference of the deduplication approval path based on a preset path difference degree, obtain the candidate difference path of the business end, and perform matching path extraction on the candidate difference path to obtain the final approval path of the business end. The result caching module is used to associate and cache the approvers of the condition group and the deduplication identifier string based on the final approval path, so as to obtain the cached matching result of the business side.