CN112308570A - Method and device for generating business rule output value - Google Patents

Method and device for generating business rule output value Download PDF

Info

Publication number
CN112308570A
CN112308570A CN202011328714.7A CN202011328714A CN112308570A CN 112308570 A CN112308570 A CN 112308570A CN 202011328714 A CN202011328714 A CN 202011328714A CN 112308570 A CN112308570 A CN 112308570A
Authority
CN
China
Prior art keywords
rule
service
matched
elements
business
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011328714.7A
Other languages
Chinese (zh)
Other versions
CN112308570B (en
Inventor
梁广会
王培君
管虹翔
董妙英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202011328714.7A priority Critical patent/CN112308570B/en
Publication of CN112308570A publication Critical patent/CN112308570A/en
Application granted granted Critical
Publication of CN112308570B publication Critical patent/CN112308570B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/405Establishing or using transaction specific rules

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method and a device for generating a business rule output value, which are suitable for the financial field and other fields. The method comprises the following steps: extracting service elements from the acquired service data, and using the service elements as elements to be matched to form an element set to be matched; and matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch. The invention overcomes the defect of repeated coding of complex scenes of the financial market, solves the situation of managing multi-service scenes of the financial market by quickly generating the rule output value, separates the service process from the system code, and can effectively improve the flexibility and the adaptability of the project so as to meet the requirements of quick development and efficiency improvement of the financial market service and improve the satisfaction degree of the customer experience.

Description

Method and device for generating business rule output value
Technical Field
The invention relates to the technical field of business rules, which can be applied to the financial field and other fields, in particular to a method and a device for generating a business rule output value.
Background
The rule engine is developed from an inference engine, is a component embedded in an application program, and writes a business decision by using a predefined business rule to realize the separation of the business decision from the application program code. For the value of the rules engine, a simple generalization is made to three points: one is better management of business rules, so that sublimation and precipitation are obtained; secondly, the wind control means is more flexible and convenient; thirdly, the rule engine framework can meet the continuous change of the future requirements.
In the actual use process in the financial market, the rule engine separates the business from the code in an agent mode, transmits the business rule design language to the system in the agent mode, and maintains and manages the complex business rules, so that the function of supporting the flexibility and the changeability of the business is achieved. However, under the condition that the business rules are relatively complex and have many branches, the operation efficiency of the rule engine is low, and the initial purpose of flexibility and rapidness cannot be met gradually under the condition that the business scene becomes more efficient.
Disclosure of Invention
The embodiment of the invention mainly aims to provide a method and a device for generating a business rule output value, which are used for separating a business process from a system code and effectively improving the flexibility and the adaptability of a project aiming at the situation of managing a plurality of business scenes in a financial market.
In order to achieve the above object, an embodiment of the present invention provides a method for generating a business rule output value, where the method includes:
extracting service elements from the acquired service data, and using the service elements as elements to be matched to form an element set to be matched;
and matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch.
Optionally, in an embodiment of the present invention, the extracting the service element from the obtained service data, and forming the to-be-matched element set by using the service element as the to-be-matched element includes: acquiring service data from a service system, and extracting service elements from the service data; and taking the service elements as the elements to be matched to form an element set to be matched, wherein the element set to be matched is consistent with a preset service rule structure.
Optionally, in an embodiment of the present invention, the preset service rule is set by the following method: dividing service elements corresponding to a service scene into fixed service elements and dynamic service elements, and determining corresponding element output results according to the fixed service elements and the dynamic service elements; generating a group of rule branches according to the fixed business elements, the dynamic business elements and the element output results by using a business rule language; and combining the rule branches to obtain a preset service rule.
Optionally, in an embodiment of the present invention, the matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch includes: matching each element to be matched in the element set to be matched with each element of all rule branches in a preset service rule to obtain the matching saturation of each service rule branch; and determining a matched rule branch according to the matching saturation, and taking an output element result of the matched rule branch as a rule output result.
The embodiment of the present invention further provides a device for generating a service rule output value, where the device includes:
the service element module is used for extracting service elements from the acquired service data and forming an element set to be matched by using the service elements as the elements to be matched;
and the rule matching module is used for matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch.
Optionally, in an embodiment of the present invention, the service element module includes: the element extraction unit is used for acquiring service data from a service system and extracting service elements from the service data; and the element combination unit is used for taking the service elements as the elements to be matched to form an element set to be matched, wherein the element set to be matched is consistent with a preset service rule structure.
Optionally, in an embodiment of the present invention, the apparatus further includes: the business rule module is used for dividing business elements corresponding to a business scene into fixed business elements and dynamic business elements and determining corresponding element output results according to the fixed business elements and the dynamic business elements; generating a group of rule branches according to the fixed business elements, the dynamic business elements and the element output results by using a business rule language; and combining the rule branches to obtain a preset service rule.
Optionally, in an embodiment of the present invention, the rule matching module includes: the matching saturation unit is used for matching each element to be matched in the element set to be matched with each element of all rule branches in a preset service rule to obtain the matching saturation of each service rule branch; and the output result unit is used for determining the matched rule branch according to the matching saturation and taking the output element result of the matched rule branch as a rule output result.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method when executing the program.
The present invention also provides a computer-readable storage medium storing a computer program for executing the above method.
The invention overcomes the defect of repeated coding of complex scenes of the financial market, solves the situation of managing multi-service scenes of the financial market by quickly generating the rule output value, separates the service process from the system code, and can effectively improve the flexibility and the adaptability of the project so as to meet the requirements of quick development and efficiency improvement of the financial market service and improve the satisfaction degree of the customer experience.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for generating a business rule output value according to an embodiment of the present invention;
FIG. 2 is a flow chart of extracting business elements in an embodiment of the present invention;
FIG. 3 is a flow chart of setting business rules in an embodiment of the present invention;
FIG. 4 is a flow chart of generating a rule output result in an embodiment of the present invention;
FIG. 5 is a flow chart of the operation of the rules engine in an embodiment of the present invention;
FIG. 6 is a flow chart of business rule customization in an embodiment of the present invention;
FIG. 7 is a flow chart of service element extraction according to an embodiment of the present invention;
FIG. 8 is a flow chart of rule matching and output in an embodiment of the present invention;
FIG. 9 is a schematic diagram of an application of a rules engine in accordance with an embodiment of the present invention;
FIG. 10 is a flow chart of business rule customization and display in an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a device for generating a business rule output value according to an embodiment of the present invention;
FIG. 12 is a schematic structural diagram of a service element module according to an embodiment of the present invention;
FIG. 13 is a block diagram of a rule matching module according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method and a device for generating a business rule output value.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
There are two definitions of business rules: "A business rule is a rule from a business perspective that is contained within a particular activity or context, that is a specification of behavior with respect to guidance, operation, practice, or process," a business rule is a statement that defines or limits certain aspects of a business from an information system perspective (IT-related) that is intended to assert a business structure, or to control or affect a business behavior.
The theoretical basis of the business rules is: the business rules must be interpreted relative to each other before they can be run, and in fact the rules engine can be viewed as a high-performance, specialized interpreter that sets one or more conditions that when satisfied trigger one or more actions. When the workflow component sends out a command for operating the business rules, the rule engine screens out a set of business rules to be executed according to the data source, operates the business rules, and finally returns an operation result to the workflow component.
The rules are mainly composed of two parts: conditions and conclusions, the condition part becomes the left-hand end (LHS) and the conclusion part is called the right-hand end (RHS). For the convenience of analysis, it is assumed that there are N rules in the system, the condition part of each rule has P patterns on average, and there are M facts in the working memory, and the facts can be understood as the rule data objects to be processed.
Rule matching is to determine whether the current fact o is lhs (r) True for each rule r, and if so, add the instance r (o) of the rule r to the conflict set. An example of a rule r is to replace the corresponding parameter of the rule r with the value of the data object o, i.e. the rule r to which the data object o is bound. General algorithm:
taking one r out of N rules;
extracting a combination o of P facts from the M facts;
testing LHS (r) by o, if LHS (r (o)) is true, adding RHS (r (o)) into a conflict set, and if yes, resolving the conflict; the activated rules are placed into the execution transaction in order.
Fourthly, taking out the next combination o, goto;
taking out the next rule r, goto.
Fig. 1 is a flowchart of a method for generating a business rule output value according to an embodiment of the present invention, where the method includes:
and step S1, extracting service elements from the acquired service data, and forming a to-be-matched element set by using the service elements as to-be-matched elements.
The service data is extracted from the service system, and the service elements are extracted from the service data, wherein the service elements can be data such as transaction detail information, messages, cash flow and the like. And after the service elements are taken, assembling into an element set to be matched. Furthermore, the element set to be matched is consistent with a preset business rule structure.
And step S2, matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch.
And traversing all the service rule branches by using the assembled element set to be matched, judging whether all the service rules meeting the certain rule branch exist, and outputting the service rules as rule output results. Furthermore, rule matching can be prioritized to meet the flexibility of rule matching.
For the case where no priority is set. As shown in table 1, rule branch 2, rule branch 3, and rule branch 4 are predefined business rules, each of which includes an input fixed element, an input dynamic element, and an element output result, and is designed by a business rule language. The element to be matched is branched into an element set to be matched, and comprises elements to be matched of a fixed unit and a dynamic unit. When the element branch 1 to be matched is matched with the business rule as basic data, the input element 3 can be found to be non-compliant, so that the element branch 1 to be matched can not obtain the rule output result. The element branch 2 to be matched is used as basic data to be matched with the business rule, all input rule elements can be seen to accord with the business rule language of the rule branch 1, and the rule branch 1 is a matched rule branch, so that the rule output result of the rule branch 1 can be obtained. Similarly, the element branch 3 to be matched may also obtain the rule output result of the service rule branch 3.
TABLE 1
Figure BDA0002795157700000051
Figure BDA0002795157700000061
For the case of setting the priority, as shown in table 2, as in the case of not setting the priority, each element to be matched in the element to be matched branch is matched with the business rule branch. If multiple matching rule branches exist in the element to be matched, the rule branch output unit with the set priority element and the highest saturation is required to be taken as a result. The priority setting is generally for each element of the fixed unit (the priority for which the element value is not null holds), the priority is lowered in the order of element 1> element 2> element 3> … … in the order of rule update time, and when the saturation is the same, the latest rule output data is taken in the order of priority as a result. Saturation degree: when all the elements to be matched and all the elements of the regular branch accord with the matching conditions (the elements of the regular branch are null for representing the matching of any value), the number of the elements of the regular branch which are not null is the saturation. As shown in table 2, the elements of the branch to be matched are matched with the rule branches 1 to 4, respectively, it is seen that the saturation degrees of the rule branches 1 to 4 are 6, 6 and 5, respectively, the rule branch 4 is excluded first, the rule branches 1 to 3 are sorted according to the non-empty priority of each element of the fixed unit (the priority is: element 1> element 2> element 3 … …), and the business rule matching result is rule branch 2> rule branch 3> rule branch 1, so the rule branch 2 is the final matching branch. The order of setting the priority may be set by a client, and is not necessarily in accordance with element 1> element 2> element 3> … …. If no matching result exists, the rule result is finally returned to be null.
TABLE 2
Figure BDA0002795157700000062
Figure BDA0002795157700000071
As an embodiment of the present invention, as shown in fig. 2, extracting a service element from acquired service data, and forming a to-be-matched element set by using the service element as a to-be-matched element includes:
step S21, obtaining service data from the service system, and extracting service elements from the service data.
The method comprises the steps of obtaining service data from a service system, and extracting service elements such as transaction detail information, messages, cash flow and the like from the service data. Certainly, for the condition that the extracted contents of the service data elements of various service rules are inconsistent, the logic contents of the acquired service element data need to be developed in a customized manner so as to be matched with the service rules.
And step S22, using the service elements as the elements to be matched to form an element set to be matched which is consistent with a preset service rule structure.
And after the service element data are obtained, assembling the service element data into an element set to be matched, wherein the element set to be matched is consistent with a preset service rule structure.
As an embodiment of the present invention, as shown in fig. 3, the preset business rule is set by the following way:
step S31, dividing the service elements corresponding to the service scene into fixed service elements and dynamic service elements, and determining corresponding element output results according to the fixed service elements and the dynamic service elements.
The service scenario, for example, a transaction, corresponds to a plurality of service elements, for example, a transaction type, a transaction date, various numbers, a currency type, and the like. The business elements are divided into fixed business elements and dynamic business elements, taking transaction as an example, the subordinate business of the transaction comprises bond transaction, fund transaction, derivatives and the like, the public part of the transaction is used as the fixed business elements, and the differentiation part is used as the dynamic business elements for customization. The element output result is a result required by the service, for example, the message rule is matched and passed, and the output result is a message allowed to be generated or allowed to be sent.
Step S32, generating a set of rule branches according to the fixed business elements, the dynamic business elements and the element output results by using a business rule language.
Wherein, the fixed service element, the dynamic service element and the element output result are processed with the service rule language design, and the common ones are <, >, |! In, notin, indexof, left, right, number, abs, decode, today, etc., examples: transaction type in (1,2,3,4), currency type notin (CNY, USD), transaction date >20200918, no 1234567, thus generating a set of rule branches.
And step S33, combining all the rule branches to obtain a preset service rule.
Wherein, as shown in table 3, the business formulation rule import template is shown, and the business element name is the second row in the figure.
TABLE 3
Figure BDA0002795157700000081
As an embodiment of the present invention, as shown in fig. 4, matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch includes:
step S41, matching each element to be matched in the element set to be matched with each element of all rule branches in a preset service rule to obtain the matching saturation of each service rule branch;
and step S42, determining the matched rule branch according to the matching saturation, and taking the output element result of the matched rule branch as the rule output result. Specifically, according to the matching saturation and the set priority, the matched rule branches are determined, and the element output result of the latest rule branch matched after the sorting is used as the rule output result
The rule matching can also be set as priority. Specifically, in the case where the priority is not set, as shown in table 1, when the element data 1 to be matched matches the business rule as the basic data, it can be found that the input element 3 is not matched, and therefore the element data 1 to be matched does not obtain the rule output result. The element data 2 to be matched is used as basic data to be matched with the business rule, and the rule output element result of the branch 1 can be obtained by seeing that all input rule elements accord with the business rule language of the branch 1. Similarly, the data to be matched 3 may also obtain the output element result of the business rule branch 3. For the case of setting the priority, as shown in table 2, the element data to be matched is matched with the business rule branch as in the case of not setting the priority.
If multiple matching rule branches exist in the element to be matched, the rule branch output unit with the set priority element and the highest saturation is required to be taken as a result. The priority setting is generally for each element of the fixed unit (the priority for which the element value is not null holds), the priority is lowered in the order of element 1> element 2> element 3> … … in the order of rule update time, and when the saturation is the same, the latest rule output data is taken in the order of priority as a result. Saturation degree: when all the elements to be matched and all the elements of the regular branch accord with the matching conditions (the elements of the regular branch are null for representing the matching of any value), the number of the elements of the regular branch which are not null is the saturation. As shown in table 2, the elements of the branch to be matched are matched with the rule branches 1 to 4, respectively, it is seen that the saturation degrees of the rule branches 1 to 4 are 6, 6 and 5, respectively, the rule branch 4 is excluded first, the rule branches 1 to 3 are sorted according to the non-empty priority of each element of the fixed unit (the priority is: element 1> element 2> element 3 … …), and the business rule matching result is rule branch 2> rule branch 3> rule branch 1, so the rule branch 2 is the final matching branch. The order of setting the priority may be set by a client, and is not necessarily in accordance with element 1> element 2> element 3> … …. If no matching result exists, the rule result is finally returned to be null.
In an embodiment of the present invention, the method for generating the business rule output value in the present invention can be executed by a rule engine, for example, fig. 5 is a work flow diagram of the rule engine in the embodiment of the present invention. The rules engine workflow includes: customizing a business rule 1, extracting business elements 2, matching the rule 3 and outputting the rule 4. The business rule customization adopts the design language grammar of the business rule, and each basic principle only comprises two parts of judgment and action (IF is used for judgment, and THEN-ELSE is follow-up action). And the service element extraction is mainly to obtain necessary service element data from transaction data, receipt and payment stream data, service parameters and the like, and then assemble the necessary service element data into an element set to be matched in a format consistent with a preset service rule. And (4) rule matching, namely judging the business rule and the business element to be matched in a basic principle. And (5) rule output, namely determining a rule output result according to the judgment result.
In the present embodiment, the business rule customizing fig. 6 is a business rule customizing flow. The business rule customization firstly determines a fixed dimension unit 204, a dynamic dimension unit 205 and an output element unit 206, each unit has a plurality of business elements corresponding to business scenes needing rule matching, such as transaction types, transaction dates, various numbers, currency types and the like. The business rule language design is carried out on the business elements, and the common factors are <, >, |! In, notin, indexof, left, right, number, abs, decode, today, etc., examples: transaction type in (1,2,3,4), currency type notin (CNY, USD), transaction date >20200918, No. 1234567. The fixed dimension unit can make a set aiming at the same business category, the lower level business classification is used as a dynamic dimension unit, for example, the transaction is used as a big category, the lower level business transaction is provided with bond transaction, fund transaction, derivative transaction and the like, the common part of the transactions is used as a business element in the fixed dimension unit, and the differentiation part is used as a dynamic dimension unit element to make a customization. The output element unit element is a result obtained by the service requirement, for example, the message rule is matched and passed, and the output result is that the message is allowed to be generated or sent.
The rules customize the implementation of the visualization in the application. The maintenance 201 includes the addition, deletion, modification, check and rechecking of the business rule data, and the flexible configuration of the rule data is realized; the import/export service rule 202 provides an offline and online interaction channel, which facilitates the service to check rule parameters; and a business rule display 203, wherein the business rules are displayed as business languages comprising fixed and dynamic dimension units and output element units after being converted according to a certain logic sequence and rule language, and the display mode of the specific class of business rules can be adjusted.
In this embodiment, the service element data in the service data is extracted and assembled into element data to be matched corresponding to the service rule structure, such as transaction detail information and related service parameters. Fig. 7 is a process of extracting a business element, after a business is triggered, a rule engine obtains business necessary data of a current rule, such as data of transaction detail information, a message, a cash flow, and the like, through transaction data 301, parameter data 302, and the like. For the condition that the extracted contents of the service data elements of various service rules are inconsistent, the logic contents for acquiring the necessary data need to be developed in a customized manner so as to realize the matching with the service rules. After the service element data is obtained, the service data is extracted 303, the fixed dimension unit data 304 and the dynamic dimension unit data 305 are assembled into an element set to be matched, for matching convenience, when the data is assembled, the element data to be matched 306 is packaged and put into a queue according to the service rule unit element name as a key and the service element as a value.
In this embodiment, the rule matching and rule outputting process is shown in fig. 8, which specifically includes: business rules 401, extracted requirements 402, fixed dimension unit matching 403, dynamic dimension unit matching 404, and matching result output 405. And traversing all the service rule branches by using the unit data of the assembled service elements, judging whether all the service rules meeting all the service rules in a certain branch exist, and outputting the service rules as a return result. Wherein, rule matching can be set as priority.
For the case of no priority setting, as shown in table 1, the rule branch 2, the rule branch 3, and the rule branch 4 are business rules established by the business, and include an input fixed unit, an input dynamic unit, and an output unit, and each element is designed by a business rule language. When the element data 1 to be matched is used as basic data to be matched with the business rule, the input element 3 can be found to be inconsistent, so that the rule output result cannot be obtained from the element data 1 to be matched. The element branch 2 to be matched is used as basic data to be matched with the business rule, and the rule output element of the rule branch 1 can be obtained by seeing that all input rule elements accord with the business rule language of the rule branch 1. Similarly, the element branch 3 to be matched may also obtain an element output result of the service rule branch 3.
For the case of setting the priority, as shown in table 2, the element branch to be matched is matched with the business rule branch as in the case of not setting the priority. If multiple matching rule branches exist in the element to be matched, the rule branch output unit with the set priority element and the highest saturation is required to be taken as a result. The priority setting is generally for each element of the fixed unit (the priority for which the element value is not null holds), the priority is lowered in the order of element 1> element 2> element 3> … … in the order of rule update time, and when the saturation is the same, the latest rule output data is taken in the order of priority as a result. Saturation degree: when all the elements to be matched and all the elements of the regular branch accord with the matching conditions (the elements of the regular branch are null for representing the matching of any value), the number of the elements of the regular branch which are not null is the saturation. As shown in table 2, the elements of the branch to be matched are matched with the rule branches 1 to 4, respectively, it is seen that the saturation degrees of the rule branches 1 to 4 are 6, 6 and 5, respectively, the rule branch 4 is excluded first, the rule branches 1 to 3 are sorted according to the non-empty priority of each element of the fixed unit (the priority is: element 1> element 2> element 3 … …), and the business rule matching result is rule branch 2> rule branch 3> rule branch 1, so the rule branch 2 is the final matching branch. If no matching result exists, the rule result is finally returned to be null. Of course, the situation that the matching saturation, the priority and the updating time of a plurality of branches are the same also occurs, and at this time, one rule branch with the same matching saturation can be randomly selected as a matched rule branch, or the final result is determined through service manual intervention.
In the present embodiment, the rule engine is used in financial market management, and fig. 9 is an example of an actual application of the rule engine. The rule engine is practically applied in financial market management, mainly used for matching and checking various rules in the process of embedding business logic processing, and the like, and can refer to fig. 9.
And (3) rule output conversion of the business rules in visual display, and the business rule customization display process in the figure 10. The format of the rule output result can be customized and supports a text format and a url format. The rule output data is stored in the database, the output format of the rule data is processed differently aiming at different types of business rules, the processing type is also defined in the database configuration table, the configuration management can be realized, and the url format result can be new page jump or a prompt box and the like.
The invention overcomes the defect of repeated coding of complex scenes of the financial market, solves the situation of managing multi-service scenes of the financial market by quickly generating the rule output value, separates the service process from the system code, and can effectively improve the flexibility and the adaptability of the project so as to meet the requirements of quick development and efficiency improvement of the financial market service and improve the satisfaction degree of the customer experience.
Fig. 11 is a schematic structural diagram of a device for generating a business rule output value according to an embodiment of the present invention, where the device includes:
a service element module 10, configured to extract a service element from the obtained service data, and use the service element as an element to be matched to form an element set to be matched;
and the rule matching module 20 is configured to match the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determine a rule output result according to the matched rule branch.
As an embodiment of the present invention, as shown in fig. 12, the service element module 10 includes:
the element extraction unit is used for acquiring service data from a service system and extracting service elements from the service data;
and the element combination unit is used for taking the service elements as the elements to be matched to form an element set to be matched, wherein the element set to be matched is consistent with a preset service rule structure.
As an embodiment of the present invention, the apparatus further comprises: the business rule module is used for dividing business elements corresponding to a business scene into fixed business elements and dynamic business elements and determining corresponding element output results according to the fixed business elements and the dynamic business elements; generating a plurality of rule branches according to the fixed business elements, the dynamic business elements and the element output results by using a business rule language; and combining the multiple rule branches to obtain a preset service rule.
As an embodiment of the present invention, as shown in fig. 13, the rule matching module 20 includes:
the matching saturation unit is used for matching each element to be matched in the element set to be matched with each element of all rule branches in a preset service rule to obtain the matching saturation of each service rule branch;
and the output result unit is used for determining the matched rule branch according to the matching saturation and taking the output element result of the matched rule branch as a rule output result.
Based on the same application concept as the method for generating the business rule output value, the invention also provides a device for generating the business rule output value. Because the principle of solving the problem of the device for generating the service rule output value is similar to the method for generating the service rule output value, the implementation of the device for generating the service rule output value can refer to the implementation of the method for generating the service rule output value, and repeated parts are not described again.
The invention overcomes the defect of repeated coding of complex scenes of the financial market, solves the situation of managing multi-service scenes of the financial market by quickly generating the rule output value, separates the service process from the system code, and can effectively improve the flexibility and the adaptability of the project so as to meet the requirements of quick development and efficiency improvement of the financial market service and improve the satisfaction degree of the customer experience.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method when executing the program.
The present invention also provides a computer-readable storage medium storing a computer program for executing the above method.
As shown in fig. 14, the electronic device 600 may further include: communication module 110, input unit 120, audio processing unit 130, display 160, power supply 170. It is noted that the electronic device 600 does not necessarily include all of the components shown in fig. 14; furthermore, the electronic device 600 may also comprise components not shown in fig. 14, which may be referred to in the prior art.
As shown in fig. 14, the central processor 100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, the central processor 100 receiving input and controlling the operation of the various components of the electronic device 600.
The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 100 may execute the program stored in the memory 140 to realize information storage or processing, etc.
The input unit 120 provides input to the cpu 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display an object to be displayed, such as an image or a character. The display may be, for example, an LCD display, but is not limited thereto.
The memory 140 may be a solid state memory such as Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 140 may also be some other type of device. Memory 140 includes buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application/function storage section 142, and the application/function storage section 142 is used to store application programs and function programs or a flow for executing the operation of the electronic device 600 by the central processing unit 100.
The memory 140 may also include a data store 143, the data store 143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage portion 144 of the memory 140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging application, address book application, etc.).
The communication module 110 is a transmitter/receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter/receiver) 110 is coupled to the central processor 100 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132 to implement general telecommunications functions. Audio processor 130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processor 130 is also coupled to the central processor 100, so that recording on the local can be enabled through a microphone 132, and so that sound stored on the local can be played through a speaker 131.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for generating a business rule output value, the method comprising:
extracting service elements from the acquired service data, and using the service elements as elements to be matched to form an element set to be matched;
and matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch.
2. The method according to claim 1, wherein the extracting the service elements from the obtained service data, and the forming the service elements as the elements to be matched into the element set to be matched comprises:
acquiring service data from a service system, and extracting service elements from the service data;
and taking the service elements as the elements to be matched to form an element set to be matched, wherein the element set to be matched is consistent with a preset service rule structure.
3. The method of claim 1, wherein the preset business rule is set by:
dividing service elements corresponding to a service scene into fixed service elements and dynamic service elements, and determining corresponding element output results according to the fixed service elements and the dynamic service elements;
generating a group of rule branches according to the fixed business elements, the dynamic business elements and the element output results by using a business rule language;
and combining the rule branches to obtain a preset service rule.
4. The method according to claim 3, wherein the matching the element set to be matched with each rule branch in a preset business rule to obtain a matched rule branch, and the determining a rule output result according to the matched rule branch comprises:
matching each element to be matched in the element set to be matched with each element of all rule branches in a preset service rule to obtain the matching saturation of each service rule branch;
and determining a matched rule branch according to the matching saturation, and taking an output element result of the matched rule branch as a rule output result.
5. An apparatus for generating a business rule output value, the apparatus comprising:
the service element module is used for extracting service elements from the acquired service data and forming an element set to be matched by using the service elements as the elements to be matched;
and the rule matching module is used for matching the element set to be matched with each rule branch in a preset service rule to obtain a matched rule branch, and determining a rule output result according to the matched rule branch.
6. The apparatus of claim 5, wherein the service element module comprises:
the element extraction unit is used for acquiring service data from a service system and extracting service elements from the service data;
and the element combination unit is used for taking the service elements as the elements to be matched to form an element set to be matched, wherein the element set to be matched is consistent with a preset service rule structure.
7. The apparatus of claim 5, further comprising: the business rule module is used for dividing business elements corresponding to a business scene into fixed business elements and dynamic business elements and determining corresponding element output results according to the fixed business elements and the dynamic business elements; generating a group of rule branches according to the fixed business elements, the dynamic business elements and the element output results by using a business rule language; and combining the rule branches to obtain a preset service rule.
8. The apparatus of claim 7, wherein the rule matching module comprises:
the matching saturation unit is used for matching each element to be matched in the element set to be matched with each element of all rule branches in a preset service rule to obtain the matching saturation of each service rule branch;
and the output result unit is used for determining the matched rule branch according to the matching saturation and taking the output element result of the matched rule branch as a rule output result.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 4.
CN202011328714.7A 2020-11-24 2020-11-24 Method and device for generating business rule output value Active CN112308570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011328714.7A CN112308570B (en) 2020-11-24 2020-11-24 Method and device for generating business rule output value

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011328714.7A CN112308570B (en) 2020-11-24 2020-11-24 Method and device for generating business rule output value

Publications (2)

Publication Number Publication Date
CN112308570A true CN112308570A (en) 2021-02-02
CN112308570B CN112308570B (en) 2023-12-19

Family

ID=74335648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011328714.7A Active CN112308570B (en) 2020-11-24 2020-11-24 Method and device for generating business rule output value

Country Status (1)

Country Link
CN (1) CN112308570B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377823A (en) * 2021-06-28 2021-09-10 中国农业银行股份有限公司 Value data processing method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108319547A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 Method for generating test case, device and system
CN109086031A (en) * 2018-06-28 2018-12-25 阿里巴巴集团控股有限公司 A kind of operational decision making method and apparatus of rule-based engine

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108319547A (en) * 2017-01-17 2018-07-24 阿里巴巴集团控股有限公司 Method for generating test case, device and system
CN109086031A (en) * 2018-06-28 2018-12-25 阿里巴巴集团控股有限公司 A kind of operational decision making method and apparatus of rule-based engine

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377823A (en) * 2021-06-28 2021-09-10 中国农业银行股份有限公司 Value data processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112308570B (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN111783432A (en) Generation method and device of credit certificate examination key point list
CN112799943B (en) Service system automatic test method and device
CN111695326B (en) XBRL report checking method and device
CN111752594A (en) Data processing method based on business module and related equipment
CN112925520A (en) Method and device for building visual page and computer equipment
CN110072140A (en) A kind of video information reminding method, device, equipment and storage medium
CN112784112A (en) Message checking method and device
CN111222869A (en) Transaction data processing method, device, computer equipment and medium
CN111798118B (en) Enterprise operation risk monitoring method and device
CN111353891A (en) Auxiliary method and device for identifying suspicious groups in fund transaction data
CN112579773A (en) Risk event grading method and device
CN112308570A (en) Method and device for generating business rule output value
CN112734565B (en) Fluidity coverage prediction method and device
CN112052391B (en) Data pushing method, device and system
CN111931852B (en) Target pricing method and device
CN113095203A (en) Client signature detection method and device in double-record data quality inspection
CN113159923A (en) Risk screening method and device
CN110347657B (en) Data generation method, device, electronic equipment and storage medium
CN111144905B (en) Questionnaire configuration method, system, computer device and computer readable storage medium
CN112800063A (en) Automatic label passing method and device based on data structure
CN115965456A (en) Data change analysis method and device
CN113515447B (en) Automatic testing method and device for system
CN113345174B (en) Interactive simulation method and device for teller cash recycling machine and terminal platform
CN111598539B (en) CICS online program service processing method and system based on service modeling
CN112365343B (en) Banking service system and method based on mobile robot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant