Business processing method, device, computer equipment and medium based on rule engine
Through a rule engine-based method, multiple rule configuration tables are parsed and matched and process nodes are updated, complex problems of complex business process design are solved, and applicability and flexibility of process nodes are improved.
Patent Information
- Application Number
- CN202210734098.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-06-27
AI Technical Summary
When handling complex business processes, the existing technology requires frequent modification and maintenance of the platform or system, resulting in complex process node design and is not conducive to modification and application.
Through a rule engine-based method, obtain business data and business status, call multiple rule configuration tables, parse and sort rule nodes, match rule content, determine hit and miss rule nodes, and update process nodes according to the next stage processing conditions to avoid Set up multiple process nodes to reduce design complexity.
It realizes the ability to handle complex services while ensuring the basic process nodes, improves the applicability in actual scenarios, meets the needs of the same process node for multiple rules, and reduces the complexity of process node design.
Smart Images

Figure CN115033816B_ABST
Abstract
Description
Technical Field
[0001] The present application is applicable to the field of rule engine technology, and in particular, relates to a business processing method, apparatus, computer equipment and medium based on a rule engine. Background Art
[0002] At present, with the popularization of Internet technology, online approval, testing, verification and other methods have become effective audit methods to improve work efficiency and meet the huge business audit needs. However, the above audit methods all need to rely on platforms, systems, etc. For situations where the business is more complex and the process changes frequently, it is necessary to modify and launch the hard codes related to the business or process in the platform or system. In this case, a large amount of resources are required to maintain the platform or system. In order to reduce the difficulty and complexity of maintenance, the process node is separated from the hard code executed by the audit by the rule engine, and the hard code is changed to code and stored in the database to form a rule engine. Each time the corresponding process node is executed, the rules in the rule engine are called for automatic audit and other operations. However, in terms of actual usage scenarios, there may be more than one rule corresponding to a process node, and redundant nodes need to be designed to execute the rules that should be completed in the same node, resulting in a more complex design of the process node, which is not conducive to modification and application. Therefore, how to achieve the processing of complex business while ensuring the basic process nodes to improve the applicability in actual scenarios has become an urgent problem to be solved. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a business processing method, apparatus, computer equipment and medium based on a rule engine to solve the problem of processing complex business while ensuring the basic process nodes to improve the applicability in actual scenarios.
[0004] In a first aspect, an embodiment of the present application provides a business processing method based on a rule engine, the business processing method comprising:
[0005] Acquire business data and the business status of the business data in the business process, analyze the business status, and determine the target process node corresponding to the business data;
[0006] Calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes, wherein the rule configuration table includes a current rule node, current rule content, a preceding rule node, and a succeeding rule node, where N is an integer greater than 1;
[0007] Matching the business data with the corresponding rule content in sequence according to the order of the rule nodes, and determining the rule nodes that hit the match and the rule nodes that do not hit the match;
[0008] According to the hit-matched rule nodes and the unmatched rule nodes, combined with the next-stage processing conditions of the target process node, the next-stage process node is determined, and according to the next-stage process node, the business status of the business data in the business process is updated.
[0009] In one embodiment, before matching the service data with the corresponding rule content in sequence according to the order of the rule nodes and determining the matched rule nodes and the unmatched rule nodes, the method further includes:
[0010] Precompile corresponding rule contents in sequence according to the order of the rule nodes;
[0011] The corresponding precompilation results are cached in sequence according to the time order of precompilation to form a cache queue;
[0012] Matching the business data with the corresponding rule content in sequence according to the order of the rule nodes, and determining the matched rule nodes and the unmatched rule nodes comprises:
[0013] The precompiled results in the cache queue are matched with the service data in sequence to determine the rule nodes that hit the match and the rule nodes that do not hit the match.
[0014] In one implementation, matching the precompiled results in the cache queue with the service data in sequence, and determining the matched rule nodes and the unmatched rule nodes includes:
[0015] Using an expression evaluation engine to perform expression parsing on the precompiled results in the cache queue in sequence to obtain corresponding parsing results;
[0016] The corresponding parsing result is compared with the business data for similarity, and the rule node corresponding to the parsing result whose similarity meets the threshold is determined as a hit-match rule node, and the rule node corresponding to the parsing result whose similarity does not meet the threshold is determined as a miss-match rule node.
[0017] In one embodiment, after matching the service data with the corresponding rule content in sequence according to the order of the rule nodes and determining the matched rule nodes and the unmatched rule nodes, the method further includes:
[0018] Determine the presentation template corresponding to the matching rule node from the presentation template database;
[0019] The business data is filled into the display template for display.
[0020] In one embodiment, before calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes, the method further includes:
[0021] Get the user's configuration request;
[0022] According to the configuration request, calling a configuration template table, the configuration template table is used to collect the modification data of the user to the original configuration;
[0023] The configuration template table is updated using the collected modification data, and the updated configuration template table is determined to be a rule configuration table.
[0024] In one implementation, according to the configuration request, calling the configuration template table includes:
[0025] Parsing the configuration request to determine type information of the process node corresponding to the configuration request;
[0026] According to the type information, a configuration template table is determined and called from a configuration template database.
[0027] In one embodiment, determining the next stage process node according to the hit-matched rule node and the unhit-matched rule node in combination with the next stage processing condition of the target process node includes:
[0028] If the rule node that does not hit the match is the first rule node in the rule node ranking, it is determined that the rule configuration is wrong; if the rule node that hits the rule is the first rule node in the rule node ranking, it is determined that the rule configuration is correct;
[0029] If it is determined that the rule configuration is incorrect, the next stage process node is determined to be the previous process node of the target process node. If it is determined that the rule configuration is correct, the next stage process node is determined to be the next process node of the target process node. The next stage processing condition of the target process node is to return to the previous process node when the rule configuration is incorrect, and to execute the next process node when the rule matching is incorrect.
[0030] In a second aspect, an embodiment of the present application provides a business processing device based on a rule engine, the business processing device comprising:
[0031] A process node determination module is used to obtain business data and the business status of the business data in the business process, analyze the business status, and determine the target process node corresponding to the business data;
[0032] A rule node sorting module is used to call N rule configuration tables corresponding to the target process node, parse each rule configuration table, and determine the rule node sorting, wherein the rule configuration table includes the current rule node, the current rule content, the preceding rule node, and the succeeding rule node, where N is an integer greater than 1;
[0033] A rule node matching module, used to match the business data with the corresponding rule content in sequence according to the order of the rule nodes, and determine the rule nodes that hit the match and the rule nodes that do not hit the match;
[0034] The process node processing module is used to determine the next stage process node according to the hit-matched rule nodes and the unmatched rule nodes, combined with the next stage processing conditions of the target process node, and update the business status of the business data in the business process according to the next stage process node.
[0035] In one implementation, the service processing device further includes:
[0036] A pre-compilation module, used for matching the business data with the corresponding rule content in sequence according to the rule node sequence, and before determining the matched rule nodes and the unmatched rule nodes, pre-compiling the corresponding rule content in sequence according to the rule node sequence;
[0037] A cache module is used to cache the corresponding precompilation results in sequence according to the precompilation time sequence to form a cache queue;
[0038] The rule node matching module includes:
[0039] A rule node matching unit is used to match the pre-compiled results in the cache queue with the business data in sequence, and determine the rule nodes that hit the match and the rule nodes that do not hit the match.
[0040] In one implementation, the rule node matching unit includes:
[0041] The parsing operator unit is used to use the expression evaluation engine to perform expression parsing on the precompiled results in the cache queue in sequence to obtain corresponding parsing results;
[0042] The matching operation subunit is used to compare the similarity between the corresponding analysis result and the business data, determine the rule node corresponding to the analysis result whose similarity meets the threshold as the hit match rule node, and determine the rule node corresponding to the analysis result whose similarity does not meet the threshold as the miss match rule node.
[0043] In one implementation, the service processing device further includes:
[0044] A display template determination module, used to match the business data with the corresponding rule content in sequence according to the order of the rule nodes, determine the matched rule nodes and the unmatched rule nodes, and then determine the display template corresponding to the matched rule nodes from the display template database;
[0045] The display module is used to fill the business data into the display template for display.
[0046] In one implementation, the service processing device further includes:
[0047] A configuration request acquisition module, used to acquire a user's configuration request before calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes;
[0048] A configuration template calling module, used to call a configuration template table according to the configuration request, wherein the configuration template table is used to collect the modification data of the user to the original configuration;
[0049] The configuration table updating module is used to update the configuration template table using the collected modification data, and determine that the updated configuration template table is a rule configuration table.
[0050] In one embodiment, the configuration template calling module includes:
[0051] A configuration type determination unit, used to parse the configuration request and determine type information of the process node corresponding to the configuration request;
[0052] The configuration template calling unit is used to determine and call a configuration template table from a configuration template database according to the type information.
[0053] In one embodiment, the process node processing module includes:
[0054] A rule configuration judgment module, configured to determine that the rule configuration is wrong if the rule node that does not hit the match is the first rule node in the rule node ranking, and to determine that the rule configuration is correct if the rule node that hits the match is the first rule node in the rule node ranking;
[0055] The next node determination module is used to determine that the next stage process node is the previous process node of the target process node if it is determined that the rule configuration is incorrect, and to determine that the next stage process node is the next process node of the target process node if it is determined that the rule configuration is correct, wherein the next stage processing condition of the target process node is to return to the previous process node when the rule configuration is incorrect, and to execute the next process node when the rule matching is incorrect.
[0056] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the business processing method based on the rule engine as described in the first aspect is implemented.
[0057] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the business processing method based on the rule engine as described in the first aspect is implemented.
[0058] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the present application obtains business data and the business status of the business data in the business process, analyzes the business status, determines the corresponding target process node, calls N rule configuration tables corresponding to the target process node, parses each rule configuration table, determines the rule node sorting, the rule configuration table contains the current rule node, the current rule content, the preceding rule node and the succeeding rule node, matches the business data with the corresponding rule content in sequence according to the rule node sorting, determines the matched rule nodes and the unmatched rule nodes, determines the next stage process node according to the matched rule nodes and the unmatched rule nodes, and according to the next stage processing conditions of the target process node, updates the business status of the business data in the business process according to the next stage process node, sets multiple rule configuration tables in a process node to match multiple rules, avoids setting multiple process nodes, reduces the complexity of process node design, and at the same time, meets the demand for multiple rules for the same process node in actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0060] Figure 1 This is a schematic diagram of an application environment of a business processing method based on a rule engine provided in Example 1 of the present application;
[0061] Figure 2 This is a flowchart of a business processing method based on a rule engine provided in Example 2 of the present application;
[0062] Figure 3 This is a flowchart of a business processing method based on a rule engine provided in Example 3 of the present application;
[0063] Figure 4 It is a structural diagram of a business processing device based on a rule engine provided in Embodiment 4 of the present application;
[0064] Figure 5 It is a structural diagram of a computer device provided in Example 5 of the present application. DETAILED DESCRIPTION
[0065] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0066] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0067] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0068] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0069] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0070] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0071] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) 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 knowledge to obtain the best results.
[0072] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0073] It should be understood that the size of the serial numbers of the steps in the following embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0074] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0075] The first embodiment of the present application provides a business processing method based on a rule engine, which can be applied in the following aspects: Figure 1 In an application environment, a client communicates with a server. The client includes but is not limited to a PDA, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud computer device, a personal digital assistant (PDA), and other computer devices. The server can be implemented by an independent server or a server cluster consisting of multiple servers.
[0076] See also Figure 2, is a flow chart of a business processing method based on a rule engine provided in Embodiment 2 of the present application. The business processing method based on the rule engine is Figure 1 The above business processing method can be used in both the server and client, provided that the computer devices corresponding to the above server and client are connected to the corresponding business system, database, rule base, etc. to support the necessary equipment required for business processing, or the business system is run in the computer devices corresponding to the above server and client, and the database, rule base, etc. are connected or configured. The above business processing method is used in the business system to realize the processing of business data in the business system, including the status update of business data, rule verification, etc. Figure 2 As shown, the business processing method based on the rule engine may include the following steps:
[0077] Step S201, obtaining business data and the business status of the business data in the business process, analyzing the business status, and determining the target process node corresponding to the business data.
[0078] In this application, the above business processing method can be applied to any business system to realize the processing of corresponding business data in the business system. In a business system, a processing flow is formulated for one of the business data according to the needs, and the business data and its business status in the corresponding business process are obtained at any time, and the corresponding process node (that is, the target process node) in the business process can be determined according to the business status.
[0079] Business data may refer to approval data, addition, deletion, modification and query data submitted in the business system. Depending on the application scenarios of the business system, the business data may include different types. Business processes may refer to processes set in the business system. Business processes corresponding to different business data may be different. Business status may refer to the status of business data in the business system. This status is set manually according to needs when the business system is established. For example, if the business system is a financial system, the business data may be financial approval data. The business status includes the primary review status, the secondary review status and the loan status. Financial approval in the financial system needs to go through the primary review, the secondary review and the loan process in sequence. If the financial approval enters the secondary review after the primary review is completed, the corresponding business status is the secondary review status.
[0080] When business data reaches a certain business state in a business process, the attributes representing the business state in the business data can be updated according to the attribute values pre-configured for the business state. Analyzing the business state is to extract the attributes representing the business state of the business data to obtain the attribute values. In the business system, the attribute values representing each business state form a mapping relationship with the process nodes of the business process. Therefore, the process nodes can be determined after the business state is determined. In one embodiment, the mapping relationship can be represented by a mapping map.
[0081] Step S202, calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes.
[0082] In the present application, the rule configuration table includes the current rule node, the current rule content, the preceding rule node and the succeeding rule node, and N is an integer greater than 1.
[0083] The execution rules of the process node are separated from the node. The execution rules are independent of at least one rule configuration table. The rule node name, rule content, leading rule node name and trailing rule node name are set in the rule configuration table. At this time, the process node is separated from the execution rules. When modifying the execution rules of the process node, there is no need to hard-code the process node, which helps to improve management efficiency.
[0084] The above process node corresponds to at least one rule configuration table, and each rule configuration table corresponds to a rule. Therefore, the process node can correspond to multiple rules, and the order of use of the rules is determined by the information configured in the rule configuration table. For example, the current rule node in the first rule configuration table is rule node A, the preceding rule node is rule node B, and the succeeding rule node is rule node C. Then the rule content in the second rule configuration table needs to be executed after the rule content corresponding to rule node B is executed.
[0085] The rule configuration table can be structured as follows:
[0086] Rule_category: the rule category corresponding to the current rule;
[0087] Rule_id: The ID corresponding to the Rule_category rule category. Under the same category, the ID is unique and its function is to locate the uniqueness of the node in the graph;
[0088] Prev_id: the ID of the corresponding preceding rule node under the Rule_category rule category;
[0089] Next_id: the corresponding post-rule node ID under the Rule_category rule category;
[0090] Rule_type: rule type, different from Rule_category, represents the matching method of the current rule. For example, when rule_type is boolOne (see the enumeration class RuleTypeEnum for the latest definition), it indicates the matching logic of the current rule.
[0091] Rule_content: rules, driven by the Google Aviator expression engine, support four arithmetic operations, variable operations, ternary operators, etc.
[0092] True_action: the text returned when the rule is hit;
[0093] False_action: The text returned when the rule is not matched.
[0094] Use the rule configuration table to configure the rule nodes so that the rules can be configured more flexibly, which can not only support the current business scenarios, but also be more conducive to future expansion.
[0095] Optionally, before calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes, the following is further included:
[0096] Get the user's configuration request;
[0097] According to the configuration request, the configuration template table is called, and the configuration template table is used to collect the user's modification data on the original configuration;
[0098] The configuration template table is updated using the collected modification data, and the updated configuration template table is determined to be a rule configuration table.
[0099] Among them, the user can perform operations such as adding, deleting, modifying, and checking the rule configuration table corresponding to the target process node according to the needs, that is, the user generates a configuration request, which is used to indicate the type of process node that the user wants to configure, and thereby calls the corresponding configuration template table. In essence, the architecture of all configuration template tables can be the same, and the original configurations in the configuration template tables corresponding to different process nodes may be different. Of course, in one embodiment, the architecture and original configuration of the configuration template table called by different types of process nodes may be different.
[0100] The user modifies the original configuration in the configuration template table, that is, configures the configuration template table to obtain a configured table, which is a rule configuration table corresponding to the target process node. The target process node is separated from the rule configuration table. The rule configuration table can be modified to achieve the modification of the rules of the target process node, which is simple and easy to implement.
[0101] Optionally, according to the configuration request, calling the configuration template table includes:
[0102] Parse the configuration request and determine the type information of the process node corresponding to the configuration request;
[0103] According to the type information, the configuration template table is determined and called from the configuration template database.
[0104] The configuration request includes type information of the process node. Different types correspond to corresponding configuration template tables. The configuration template table can be stored in a configuration template database and can be called through query.
[0105] Step S203, matching the business data with the corresponding rule content in order according to the order of the rule nodes, and determining the matched rule nodes and the unmatched rule nodes.
[0106] In the present application, after determining the order of the rule nodes, the corresponding rule contents are called in sequence according to the order of the rule nodes to match the business data. Matching can refer to comparing the business data with the rule contents to determine whether the business data conforms to the provisions of the rule contents. If the business data conforms to the provisions of the rule contents, it is determined to be a hit match, and the corresponding rule node is the hit match rule node. If the business data does not conform to the provisions of the rule contents, it is determined to be a miss match, and the corresponding rule node is the miss match rule node.
[0107] For example, the business data is a compressed data packet, and the rule content corresponding to a rule node is that the data packet size is not greater than the file size threshold. When the size of the compressed data packet is not greater than the file size threshold, it complies with the rule content. When the size of the compressed data packet is greater than the file size threshold, it does not comply with the rule content.
[0108] Optionally, before matching the business data with the corresponding rule content in order according to the order of the rule nodes and determining the matched rule nodes and the unmatched rule nodes, the method further includes:
[0109] Precompile the corresponding rule contents in sequence according to the order of rule nodes;
[0110] The corresponding precompilation results are cached in sequence according to the time order of precompilation to form a cache queue;
[0111] The business data is matched with the corresponding rule content in order according to the order of the rule nodes, and the rule nodes that hit the match and the rule nodes that do not hit the match include:
[0112] The precompiled results in the cache queue are matched with the business data in sequence to determine the rule nodes that hit the match and the rule nodes that do not hit the match.
[0113] Among them, in order to further accelerate the rule engine and cope with high concurrency scenarios, the rule content of the rule node can be precompiled, and the precompilation is performed in the order of the rule nodes, so that according to the time sequence of the precompilation, the precompilation results can be cached in sequence to form a cache queue for subsequent matching operations. In one embodiment, the above-mentioned precompilation can introduce a Guava Cache plug-in to precompile the rule content.
[0114] Pre-compilation is to form executable files and execute the corresponding files in sequence, so as to realize the matching judgment between business data and rules, and to determine the matching rule nodes and the non-matching rule nodes.
[0115] Optionally, matching the precompiled results in the cache queue with the business data in sequence, and determining the matched rule nodes and the unmatched rule nodes includes:
[0116] Use the expression evaluation engine to perform expression analysis on the precompiled results in the cache queue in sequence to obtain the corresponding analysis results;
[0117] The corresponding parsing results are compared with the business data for similarity, and the rule nodes corresponding to the parsing results whose similarity meets the threshold are determined as hit-matched rule nodes, and the rule nodes corresponding to the parsing results whose similarity does not meet the threshold are determined as miss-matched rule nodes.
[0118] The essence of the rule content is a regular expression, and in the pre-compiled result, an expression evaluation engine needs to be used to parse the expression to obtain a parsing result, which may include a regular expression.
[0119] The parsing result is compared with the business data for similarity, and whether there is a match is determined based on the comparison result. If the parsing result is a regular expression, the string corresponding to the business data can be compared with the regular expression to determine whether the string corresponding to the business data belongs to the regular expression. The threshold at this time is 100%. If so, it means that the business data and the parsing result are similar, otherwise it means that the business data and the parsing result are not similar.
[0120] Step S204, determining the next stage process node according to the matched rule nodes and the unmatched rule nodes in combination with the next stage processing conditions of the target process node.
[0121] In the present application, at least one rule configuration table is included in a target process node, that is, at least one rule node is used for rule matching. Therefore, the number of rule nodes that hit the match can be 0 or more, and the number of rule nodes that do not hit the match can be 0 or more.
[0122] The next stage processing condition may refer to the condition that the target process node needs to meet to enter the next stage of processing, and the condition may be a combination of multiple conditions. For example, the next stage processing condition is that the next process node can be entered as long as there is a hit-matched rule node, that is, as long as there is a hit-matched rule node, the next stage process node is the next process node of the target process node in the business process; for another example, the next node processing condition is that the first rule node in the rule node sorting is a rule node that does not hit a match and needs to return to the previous process node, that is, the first rule node in the rule node sorting does not hit a match, and the next stage process node is the previous process node of the target process node in the business process.
[0123] In one embodiment, the next stage processing condition can determine the next stage process node based on the ratio of the number of rule nodes that hit the rule to the number of rule nodes that do not hit the match. For example, when the ratio exceeds the ratio threshold, that is, the number of rule nodes that hit the rule is large, the next process node of the target process node in the business process is used as the next stage process node; when the ratio is lower than the ratio threshold, that is, the number of rule nodes that hit the rule is small, the previous process node of the target process node in the business process is used as the next stage process node.
[0124] Optionally, after matching the business data with the corresponding rule content in order according to the order of the rule nodes and determining the matched rule nodes and the unmatched rule nodes, the method further includes:
[0125] Determine the presentation template corresponding to the matching rule node from the presentation template database;
[0126] Fill the business data into the display template for display.
[0127] Among them, in order to facilitate users' viewing and enable users to understand the results of rule matching to judge whether the results are correct, forming a human-computer interaction function, after determining the matched rule nodes and the unmatched rule nodes, the business data can also be displayed. Of course, the display also needs to reflect the rule characteristics of the matched rule nodes. Therefore, it is necessary to give a display template based on the matched rule nodes, and the display template can characterize the rule characteristics of the corresponding rule nodes.
[0128] The business data is filled into the display template for display, so that the user can understand both the business data and the matching rule nodes, to prevent a series of subsequent errors caused by matching errors. The above-mentioned display template database and configuration template database can be stored in one database.
[0129] Step S205: updating the business status of the business data in the business process according to the process node of the next stage.
[0130] In this application, after determining the next stage process node, the attribute value of the current business state can be determined based on the relationship between the process node and the attribute value representing the business state, so as to update the business state with the attribute value. Ultimately, all process nodes and corresponding rule nodes form a response link to realize the automated processing of business data, which helps to improve processing efficiency.
[0131] The embodiment of the present application obtains business data and the business status of the business data in the business process, analyzes the business status, determines the corresponding target process node, calls N rule configuration tables corresponding to the target process node, parses each rule configuration table, determines the rule node order, the rule configuration table contains the current rule node, the current rule content, the preceding rule node and the succeeding rule node, matches the business data with the corresponding rule content in sequence according to the rule node order, determines the rule nodes that hit the match and the rule nodes that do not hit the match, determines the next stage process node based on the hit match and the rule nodes that do not hit the match and the next stage processing conditions of the target process node, and updates the business status of the business data in the business process based on the next stage process node, sets multiple rule configuration tables in a process node to match multiple rules, avoids setting multiple process nodes, reduces the complexity of process node design, and at the same time, meets the demand for multiple rules in the same process node in actual application scenarios.
[0132] See also Figure 3 , is a flowchart of a business processing method based on a rule engine provided in Example 3 of the present application, such as Figure 3 As shown, the business processing method based on the rule engine may include the following steps:
[0133] Step S301, obtaining business data and the business status of the business data in the business process, analyzing the business status, and determining the target process node corresponding to the business data.
[0134] Step S302, calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes.
[0135] Step S303 , matching the business data with the corresponding rule content in order according to the order of the rule nodes, and determining the matched rule nodes and the unmatched rule nodes.
[0136] Among them, the contents of steps S301 to S303 are the same as those of the above-mentioned steps S201 to S203, and the description of steps S201 to S203 may be referred to, and will not be repeated here.
[0137] Step S304: if the rule node that does not hit the match is the first rule node in the rule node ranking, it is determined that the rule configuration is wrong; if the rule node that hits the match is the first rule node in the rule node ranking, it is determined that the rule configuration is correct.
[0138] In this application, as long as the first rule node in the rule node sorting does not hit a match, it can be said that the business data cannot pass through the target process node, that is, the output rule configuration is incorrect. As long as the first rule node in the rule node sorting hits a match, it can be said that the business data can pass through the target process node, that is, the output rule configuration is correct.
[0139] In one implementation, if there is no unmatched rule node, it is determined that the rule configuration is correct, that is, the target process node can be passed only when all rules are matched.
[0140] Step S305: if it is determined that the rule configuration is wrong, the next stage process node is determined to be the previous process node of the target process node; if it is determined that the rule configuration is correct, the next stage process node is determined to be the next process node of the target process node.
[0141] In this application, the next stage processing condition of the target process node is to return to the previous process node when the rule configuration is wrong, and to execute the next process node when the rule matching is wrong.
[0142] The next stage processing condition adopts a simple [0, 1] mode, that is, the rule configuration error is 0, and the rule configuration is 1. If 0 is received, the next stage process node is determined to be the previous process node of the target process node. If 1 is received, the next stage process node is determined to be the next process node of the target process node, thereby improving
[0143] Step S306: updating the business status of the business data in the business process according to the process node of the next stage.
[0144] Among them, the content of step S306 is the same as that of the above-mentioned step S205, and reference may be made to the description of step S205, which will not be repeated here.
[0145] The rule engine proposed in the embodiment of the present application can automatically perform rule verification on the recruitment information in the process according to the rules configured in the database, and return various corresponding processing methods according to the verification results. The configuration method through the database eliminates the manpower required for publishing when changing the rules. In this way, the manpower that must be invested in the operation and organization is greatly reduced, the efficiency of the entire process of rule change is improved, and the new rules can be implemented faster and more agilely and respond to the feedback of the front-line business on the specific details of the rules. This can help enterprises improve service quality and improve user satisfaction efficiently. The rule engine also encapsulates the complex rules, making the code of the recruitment project more concise, the core logic clearer and more prominent, which is conducive to reducing the maintenance cost of the code in the later stage and the cost of getting started for new developers, and increasing the project's Luban and maintainability. This makes the project easier to maintain and iterate, and the long-term maintenance cost is reduced. The entire rule engine is designed to be lightweight, and it is kept as lightweight as possible while fully supporting the existing business logic. In combination with business scenarios, the configuration logic of the database configuration rules is designed, which can better respond to business needs and reduce labor costs.
[0146] Corresponding to the business processing method based on the rule engine in the above embodiment, Figure 4 The structure block diagram of the business processing device based on the rule engine provided in the fourth embodiment of the present application is shown. Figure 1 The above business processing method can be used in both the server and the client, provided that the computer devices corresponding to the above server and the client are connected to the corresponding business system, database, rule base, etc. to support the necessary equipment required for business processing, or the business system is run in the computer devices corresponding to the above server and the client, and the database, rule base, etc. are connected or configured. The above business processing method is used in the business system to realize the processing of business data in the business system, including the status update of business data, rule verification, etc. For the convenience of explanation, only the parts related to the embodiments of the present application are shown.
[0147] See also Figure 4 , the business processing device based on the rule engine includes:
[0148] A process node determination module 41 is used to obtain business data and the business status of the business data in the business process, analyze the business status, and determine the target process node corresponding to the business data;
[0149] A rule node sorting module 42 is used to call N rule configuration tables corresponding to the target process node, parse each rule configuration table, and determine the rule node sorting, wherein the rule configuration table includes the current rule node, the current rule content, the preceding rule node, and the succeeding rule node, where N is an integer greater than 1;
[0150] A rule node matching module 43 is used to match the business data with the corresponding rule content in order according to the rule node sorting, and determine the rule nodes that hit the match and the rule nodes that do not hit the match;
[0151] The process node processing module 44 is used to determine the next stage process node according to the matched rule nodes and the unmatched rule nodes, combined with the next stage processing conditions of the target process node, and update the business status of the business data in the business process according to the next stage process node.
[0152] Optionally, the service processing device further includes:
[0153] A pre-compilation module is used to match the business data with the corresponding rule content in order according to the order of the rule nodes, and to pre-compile the corresponding rule content in order according to the order of the rule nodes before determining the matched rule nodes and the unmatched rule nodes;
[0154] A cache module is used to cache the corresponding precompilation results in sequence according to the precompilation time sequence to form a cache queue;
[0155] The rule node matching module 43 includes:
[0156] The rule node matching unit is used to match the pre-compiled results in the cache queue with the business data in sequence, and determine the rule nodes that hit the match and the rule nodes that do not hit the match.
[0157] Optionally, the rule node matching unit includes:
[0158] The parsing operator unit is used to use the expression evaluation engine to perform expression parsing on the pre-compiled results in the cache queue in sequence to obtain corresponding parsing results;
[0159] The matching operation subunit is used to compare the similarity between the corresponding analysis result and the business data, determine the rule node corresponding to the analysis result whose similarity meets the threshold as the rule node that hits the match, and determine the rule node corresponding to the analysis result whose similarity does not meet the threshold as the rule node that does not hit the match.
[0160] Optionally, the service processing device further includes:
[0161] A display template determination module is used to match the business data with the corresponding rule content in order according to the order of the rule nodes, determine the matched rule nodes and the unmatched rule nodes, and then determine the display template corresponding to the matched rule nodes from the display template database;
[0162] The display module is used to fill business data into the display template for display.
[0163] Optionally, the service processing device further includes:
[0164] The configuration request acquisition module is used to obtain the user's configuration request before calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes;
[0165] The configuration template calling module is used to call the configuration template table according to the configuration request, and the configuration template table is used to collect the user's modification data on the original configuration;
[0166] The configuration table updating module is used to update the configuration template table using the collected modification data, and determine that the updated configuration template table is a rule configuration table.
[0167] Optionally, the configuration template calling module includes:
[0168] A configuration type determination unit, used to parse a configuration request and determine type information of a process node corresponding to the configuration request;
[0169] The configuration template calling unit is used to determine and call the configuration template table from the configuration template database according to the type information.
[0170] Optionally, the process node processing module 44 includes:
[0171] A rule configuration judgment module is used to determine that the rule configuration is wrong if the rule node that does not hit the match is the first rule node in the rule node ranking, and to determine that the rule configuration is correct if the rule node that hits the match is the first rule node in the rule node ranking;
[0172] The next node determination module is used to determine that the next stage process node is the previous process node of the target process node if it is determined that the rule configuration is incorrect, and to determine that the next stage process node is the next process node of the target process node if it is determined that the rule configuration is correct. The next stage processing condition of the target process node is to return to the previous process node when the rule configuration is incorrect, and to execute the next process node when the rule matching is incorrect.
[0173] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0174] Figure 5 This is a schematic diagram of the structure of a computer device provided in Example 5 of this application. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5Only one is shown), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned embodiments of the business processing method based on the rule engine are implemented.
[0175] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Figure 5 These are merely examples of computer devices and do not constitute limitations on the computer devices. The computer devices may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, they may also include a network interface, a display screen, and an input device.
[0176] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0177] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of an operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments may also be an external storage device of a computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on a computer device. Further, the memory may also include both an internal storage unit of a computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0178] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiment when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0179] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be completed through a computer program product. When the computer program product runs on a computer device, the steps in the above-mentioned method embodiment can be implemented when the computer device executes it.
[0180] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0181] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0182] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0183] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0184] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A business processing method based on a rule engine, characterized in that: The business processing method comprises: Acquire business data and the business status of the business data in the business process, analyze the business status, and determine the target process node corresponding to the business data; Calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes, wherein the rule configuration table includes a current rule node, current rule content, a preceding rule node, and a succeeding rule node, where N is an integer greater than 1; Matching the business data with the corresponding rule content in sequence according to the order of the rule nodes, and determining the rule nodes that hit the match and the rule nodes that do not hit the match; Determine the next stage process node according to the hit-matched rule node and the unmatched rule node, combined with the next stage processing condition of the target process node, and update the business state of the business data in the business process according to the next stage process node; Before matching the service data with the corresponding rule content in sequence according to the order of the rule nodes and determining the matched rule nodes and the unmatched rule nodes, the method further includes: Precompile corresponding rule contents in sequence according to the order of the rule nodes; The corresponding precompilation results are cached in sequence according to the time order of precompilation to form a cache queue; Matching the business data with the corresponding rule content in sequence according to the order of the rule nodes, and determining the matched rule nodes and the unmatched rule nodes comprises: Matching the precompiled results in the cache queue with the service data in sequence, and determining rule nodes that hit the match and rule nodes that do not hit the match; Matching the precompiled results in the cache queue with the business data in sequence, and determining the matched rule nodes and the unmatched rule nodes comprises: Using an expression evaluation engine to perform expression parsing on the precompiled results in the cache queue in sequence to obtain corresponding parsing results; Compare the corresponding parsing results with the business data for similarity, determine the rule nodes corresponding to the parsing results whose similarity meets the threshold as hit-match rule nodes, and determine the rule nodes corresponding to the parsing results whose similarity does not meet the threshold as miss-match rule nodes; Determining the next stage process node according to the hit-matched rule node and the unmatched rule node in combination with the next stage processing condition of the target process node includes: If the rule node that does not hit a match is the first rule node in the rule node ranking, it is determined that the rule configuration is wrong; if the rule node that hits a match is the first rule node in the rule node ranking, it is determined that the rule configuration is correct; If it is determined that the rule configuration is incorrect, the next stage process node is determined to be the previous process node of the target process node. If it is determined that the rule configuration is correct, the next stage process node is determined to be the next process node of the target process node. The next stage processing condition of the target process node is to return to the previous process node when the rule configuration is incorrect, and to execute the next process node when the rule matching is incorrect.
2. The service processing method according to claim 1, characterized in that: After matching the service data with the corresponding rule content in sequence according to the order of the rule nodes, and determining the matched rule nodes and the unmatched rule nodes, the method further includes: Determine the presentation template corresponding to the matching rule node from the presentation template database; The business data is filled into the display template for display.
3. The service processing method according to claim 1, characterized in that: Before calling N rule configuration tables corresponding to the target process node, parsing each rule configuration table, and determining the order of the rule nodes, the method further includes: Get the user's configuration request; According to the configuration request, calling a configuration template table, the configuration template table is used to collect the modification data of the user to the original configuration; The configuration template table is updated using the collected modification data, and the updated configuration template table is determined to be a rule configuration table.
4. The service processing method according to claim 3, characterized in that: According to the configuration request, calling the configuration template table includes: Parsing the configuration request to determine type information of the process node corresponding to the configuration request; According to the type information, a configuration template table is determined and called from a configuration template database.
5. A business processing device based on a rule engine, characterized in that: The service processing device comprises: A process node determination module is used to obtain business data and the business status of the business data in the business process, analyze the business status, and determine the target process node corresponding to the business data; A rule node sorting module is used to call N rule configuration tables corresponding to the target process node, parse each rule configuration table, and determine the rule node sorting, wherein the rule configuration table includes the current rule node, the current rule content, the preceding rule node, and the succeeding rule node, where N is an integer greater than 1; A rule node matching module, used to match the business data with the corresponding rule content in sequence according to the order of the rule nodes, and determine the rule nodes that hit the match and the rule nodes that do not hit the match; A process node processing module, used to determine the next stage process node according to the hit-matched rule node and the unmatched rule node, combined with the next stage processing condition of the target process node, and update the business state of the business data in the business process according to the next stage process node; The service processing device further includes: A pre-compilation module, used for matching the business data with the corresponding rule content in sequence according to the rule node sequence, and before determining the matched rule nodes and the unmatched rule nodes, pre-compiling the corresponding rule content in sequence according to the rule node sequence; A cache module is used to cache the corresponding precompilation results in sequence according to the precompilation time sequence to form a cache queue; The rule node matching module includes: A rule node matching unit, used to match the precompiled results in the cache queue with the business data in sequence, and determine the rule nodes that hit the match and the rule nodes that do not hit the match; The rule node matching unit includes: The parsing operator unit is used to use the expression evaluation engine to perform expression parsing on the precompiled results in the cache queue in sequence to obtain corresponding parsing results; A matching operation subunit, used to compare the corresponding parsing result with the business data for similarity, determine the rule node corresponding to the parsing result whose similarity meets the threshold as a hit-match rule node, and determine the rule node corresponding to the parsing result whose similarity does not meet the threshold as a miss-match rule node; The process node processing module includes: A rule configuration judgment module, configured to determine that the rule configuration is wrong if the unmatched rule node is the first rule node in the rule node ranking, and to determine that the rule configuration is correct if the matched rule node is the first rule node in the rule node ranking; The next node determination module is used to determine that the next stage process node is the previous process node of the target process node if it is determined that the rule configuration is incorrect, and to determine that the next stage process node is the next process node of the target process node if it is determined that the rule configuration is correct, wherein the next stage processing condition of the target process node is to return to the previous process node when the rule configuration is incorrect, and to execute the next process node when the rule matching is incorrect.
6. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the business processing method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the service processing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Payment rejection task processing method, payment rejection task processing device and server
CN110728519A