CN112150091A - Method and device for processing business rules - Google Patents

Method and device for processing business rules Download PDF

Info

Publication number
CN112150091A
CN112150091A CN201910576569.5A CN201910576569A CN112150091A CN 112150091 A CN112150091 A CN 112150091A CN 201910576569 A CN201910576569 A CN 201910576569A CN 112150091 A CN112150091 A CN 112150091A
Authority
CN
China
Prior art keywords
node
expression
factor expression
factor
tree
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.)
Pending
Application number
CN201910576569.5A
Other languages
Chinese (zh)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910576569.5A priority Critical patent/CN112150091A/en
Publication of CN112150091A publication Critical patent/CN112150091A/en
Pending legal-status Critical Current

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
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • General Engineering & Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method and a device for processing a business rule. The method comprises the following steps: obtaining input parameters, the input parameters including: factor path and scene identification; determining a first factor expression corresponding to the factor path from a factor expression set corresponding to the business object; determining a second factor expression corresponding to the scene identifier from the factor expression set; determining a third factor expression according to the first factor expression and the second factor expression; and obtaining the value of the third factor expression, wherein the value of the third factor expression is used for expressing the execution result of the executable business rule. In the application, the corresponding business rules are obtained by combining the current scene according to the changed part of the business object, so that different business rules can be displayed on the same page according to the contents of different commodities, the flexible binding of the business rules and the page elements is further realized, and the accurate execution of the business rules is realized.

Description

Method and device for processing business rules
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a business rule.
Background
In the existing internet application systems, such as a Customer Relationship Management (CRM) system, an Enterprise Resource Planning (ERP) system, and an electronic commerce system in the field of telecommunications operation, these systems are basically internet applications, and it is common that a system service runs on a background server, and a user accesses the system service on the background server through various terminal devices through a network.
Generally, these systems adopt a browser and server architecture (i.e., a B/S (browser/server) architecture) mode, when a user accesses a remote service at a terminal device, the user first needs to open a user page using a browser, then interacts with a background service through an operation page to implement a service function, and for an operation of the user on the terminal device, the system service responds to the operation of the user according to a service rule. When a user operates the page, the elements in the page are linked, and the linkage relationship between the elements is the embodiment of the business rule.
Therefore, the business rules are bound with the page elements, the same page can be used for displaying the contents of different commodities, the requirements of the business data carried by the same page element are different, the business rules and the binding rules of the page elements do not have flexibility for different requirements of the business data, and the accurate execution of the business rules cannot be realized.
Disclosure of Invention
The application provides a method and a device for processing business rules, so that different business rules can be displayed on the same page aiming at the contents of different commodities, the flexible binding of the business rules and page elements is further realized, and the accurate execution of the business rules is realized.
In a first aspect, the present application provides a method for processing a business rule, including: obtaining input parameters, the input parameters including: the system comprises a factor path and a scene identifier, wherein the factor path is used for representing the change of a business object, and the scene identifier is used for representing the current scene; determining a first factor expression corresponding to the factor path from a factor expression set corresponding to the business object, wherein the factor expression set is a set used for expressing a business rule corresponding to the business object; determining a second factor expression corresponding to the scene identification from the factor expression set; determining a third factor expression according to the first factor expression and the second factor expression, wherein the third factor expression is used for expressing an executable business rule corresponding to a business object changed in the current scene; obtaining a value of the third factor expression, wherein the value of the third factor expression is used for representing the execution result of the executable business rule.
In the application, the corresponding business rules are obtained by combining the current scene according to the changed part of the business object, so that different business rules can be displayed on the same page according to the contents of different commodities, the flexible binding of the business rules and the page elements is further realized, and the accurate execution of the business rules is realized.
Based on the first aspect, in some possible embodiments, the method further includes: acquiring attribute information of the service object; determining a fourth factor expression corresponding to the attribute information from the factor expression set; and determining the third factor expression according to the first factor expression, the second factor expression and the fourth factor expression.
In the application, the attribute information of the business object may be user operation, business channel, customer rating, and the like.
Based on the first aspect, in some possible implementations, the determining a first factor expression corresponding to the factor path from a factor expression set corresponding to the business object includes: acquiring a rule index tree constructed by the factor expression set, wherein factors in each factor expression in the factor expression set correspond to each node of the rule index tree; and searching the first factor expression in the rule index tree according to the factor path.
Based on the first aspect, in some possible implementations, the finding the first factor expression in the rule index tree according to the factor path includes: converting the factor expression corresponding to the factor path into a first expression node chain; sequentially obtaining first nodes in the first expression node chain, and judging whether the first nodes have parameters; if the first node has the parameter, searching whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node and the corresponding parameter; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
In the present application, an expression node chain is a data structure inside a rule engine, and is used to describe a factor expression.
Based on the first aspect, in some possible embodiments, the method further includes: if the first node does not have the parameter, searching whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
Based on the first aspect, in some possible embodiments, the method further includes: converting each factor expression in the set of factor expressions into a second chain of expression nodes; traversing the second expression node chain, and sequentially executing the following steps on the ith second node in the second expression node chain, wherein i is a positive integer: judging whether the ith second node has parameters or not; if the ith second node has parameters, searching a corresponding tree node in a pre-established rule index tree model according to the node name of the ith second node and the corresponding parameters; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
Based on the first aspect, in some possible embodiments, the method further includes: if the ith second node does not have the parameter, searching a corresponding tree node in the regular index tree model according to the node name of the ith second node; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
Based on the first aspect, in some possible implementations, the determining, from the factor expression set, a second factor expression corresponding to the scene identifier includes: obtaining a corresponding factor expression configured for the current scene according to the scene identification; and determining the second factor expression in the factor expression set according to the factor expression configured for the current scene.
Based on the first aspect, in some possible implementations, the determining, according to the factor expression configured for the current scenario, the second factor expression in the factor expression set includes: acquiring a rule index tree constructed by the factor expression set, wherein factors in each factor expression in the factor expression set correspond to each node of the rule index tree; and searching the second factor expression in the rule index tree according to the factor expression configured for the current scene.
Based on the first aspect, in some possible implementations, after the obtaining the execution result of the executable business rule, the method further includes: and when the executable service rule is a check rule, assembling the message according to the message template and outputting an execution result.
In a second aspect, an embodiment of the present application provides a device for processing a business rule, including: an interface module for obtaining input parameters, the input parameters including: the system comprises a factor path and a scene identifier, wherein the factor path is used for representing the change of a business object, and the scene identifier is used for representing the current scene; the processing module is used for determining a first factor expression corresponding to the factor path from a factor expression set corresponding to the business object, wherein the factor expression set is a set used for expressing a business rule corresponding to the business object; determining a second factor expression corresponding to the scene identification from the factor expression set; determining a third factor expression according to the first factor expression and the second factor expression, wherein the third factor expression is used for expressing an executable business rule corresponding to a business object changed in the current scene; obtaining a value of the third factor expression, wherein the value of the third factor expression is used for representing the execution result of the executable business rule.
Based on the second aspect, in some possible embodiments, the processing module is further configured to obtain attribute information of the business object; determining a fourth factor expression corresponding to the attribute information from the factor expression set; and determining the third factor expression according to the first factor expression, the second factor expression and the fourth factor expression.
Based on the second aspect, in some possible embodiments, the processing module is configured to obtain a rule index tree constructed by the factor expression set, where a factor in each factor expression in the factor expression set corresponds to each node of the rule index tree; and searching the first factor expression in the rule index tree according to the factor path.
Based on the second aspect, in some possible embodiments, the processing module is configured to convert the factor expression corresponding to the factor path into a first expression node chain; sequentially obtaining first nodes in the first expression node chain, and judging whether the first nodes have parameters; if the first node has the parameter, searching whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node and the corresponding parameter; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
Based on the second aspect, in some possible embodiments, the processing module is further configured to, if the first node does not have a parameter, find whether a corresponding tree node exists in the rule index tree according to a node name of a previous node of the first node; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
Based on the second aspect, under some possible embodiments, the apparatus further includes: a tree construction module, configured to convert each factor expression in the factor expression set into a second expression node chain; traversing the second expression node chain, and sequentially executing the following steps on the ith second node in the second expression node chain, wherein i is a positive integer: judging whether the ith second node has parameters or not; if the ith second node has parameters, searching a corresponding tree node in a pre-established rule index tree model according to the node name of the ith second node and the corresponding parameters; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
Based on the second aspect, in some possible embodiments, the tree construction module is further configured to, if the ith second node does not have a parameter, search a corresponding tree node in the regular index tree model according to a node name of the ith second node; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
Based on the second aspect, in some possible embodiments, the processing module is further configured to obtain, according to the scene identifier, a corresponding factor expression configured for the current scene; and determining the second factor expression in the factor expression set according to the factor expression configured for the current scene.
Based on the second aspect, in some possible embodiments, the processing module is configured to obtain a rule index tree constructed by the factor expression set, where a factor in each factor expression in the factor expression set corresponds to each node of the rule index tree; and searching the second factor expression in the rule index tree according to the factor expression configured for the current scene.
Based on the second aspect, in some possible embodiments, the interface module is further configured to, after the processing module obtains the execution result of the executable business rule, assemble a message according to a message template when the executable business rule is a check rule, and output the execution result.
In a third aspect, the present application provides a user equipment, including a processor, which is coupled to a memory, and is configured to read and execute instructions in the memory to implement the method for processing the business rules according to any one of the above first aspects.
Based on the third aspect, in some possible embodiments, the user equipment further includes a memory.
In a fourth aspect, the present application provides a backend server, including a processor, configured to couple with a memory, read and execute instructions in the memory, so as to implement the method for processing the business rules according to any one of the above first aspects.
Based on the fourth aspect, in some possible embodiments, the background server further includes a memory.
In a fifth aspect, the present application provides a computer-readable storage medium storing instructions for executing the method for processing business rules according to any one of the first aspect.
In a sixth aspect, the present application provides a computer program or a computer program product, which when executed on a computer, causes the computer to implement the business rule processing method of any one of the above first aspects.
It should be understood that the second to sixth aspects of the present application are consistent with the technical solution of the first aspect of the present application, and the beneficial effects obtained by the aspects and the corresponding possible implementation are similar, and are not described again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
FIG. 1 is a schematic structural diagram of a CRM system in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a rules engine in the CRM system of an embodiment of the present application;
FIG. 3 is a schematic diagram of a business rule in an embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for processing business rules in an embodiment of the present application;
FIG. 5 is a diagram of a rule index tree in an embodiment of the present application;
FIG. 6 is a schematic flow chart of constructing a rule index tree in the embodiment of the present application;
FIG. 7 is a flow chart illustrating a search rule index tree according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a business rule processing apparatus in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a user equipment in an embodiment of the present application;
fig. 10 is a schematic structural diagram of a backend server in the embodiment of the present application.
Detailed Description
The embodiments of the present application will be described below with reference to the drawings. In the following description, reference is made to the accompanying drawings which form a part hereof and in which is shown by way of illustration specific aspects of embodiments of the present application or in which specific aspects of embodiments of the present application may be employed. It should be understood that embodiments of the present application may be used in other ways and may include structural or logical changes not depicted in the drawings. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present application is defined by the appended claims. For example, it should be understood that the disclosure in connection with the described methods may equally apply to the corresponding apparatus or system for performing the methods, and vice versa. For example, if one or more particular method steps are described, the corresponding apparatus may comprise one or more units, such as functional units, to perform the described one or more method steps (e.g., a unit performs one or more steps, or multiple units, each of which performs one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the figures. On the other hand, for example, if a particular apparatus is described based on one or more units, such as functional units, the corresponding method may comprise one step to perform the functionality of the one or more units (e.g., one step performs the functionality of the one or more units, or multiple steps, each of which performs the functionality of one or more of the plurality of units), even if such one or more steps are not explicitly described or illustrated in the figures. Further, it is to be understood that features of the various exemplary embodiments and/or aspects described herein may be combined with each other, unless explicitly stated otherwise.
In an embodiment of the present application, a CRM system in the field of telecommunications operation management is provided, fig. 1 is a schematic structural diagram of the CRM system in the embodiment of the present application, and referring to fig. 1, the CRM system 100 may include: the system comprises a user device 101 and background servers 102, wherein a browser is deployed on the user device, an application program (app) is deployed on each background server, and each app has a service published thereon. The CRM system adopts a browser and server architecture (namely B/S (browser/server) architecture) mode, when a user accesses a remote service at a terminal device, the user firstly needs to open a user page by using the browser, then the user page and a background service are interacted through an operation page to complete a service function, and for the operation of the user on the terminal device, the system service responds to the operation of the user according to a service rule. When a user operates the page, the elements in the page are linked, and the linkage relationship between the elements is the embodiment of the business rule. It can be seen that the business rules are bound with the page elements, the same page can be used for displaying the contents of different commodities, the requirements of the business data carried by the same page element are different, the business rules and the binding rules of the page elements do not have flexibility for the different requirements of the business data, and the accurate execution of the business rules cannot be realized.
In order to solve this problem, the embodiment of the present application provides a method for processing a business rule, which may be applied to a processing device in the CRM system, such as the backend server 102 or the user equipment 101 communicating with the backend server. Apps are deployed on the processing devices, and a rule engine can be deployed in the apps. Fig. 2 is a schematic structural diagram of a rule engine in a CRM system in an embodiment of the present application, and referring to fig. 2, the rule engine 20 may include: a factor layer 21 and a rule layer 22, wherein the factor layer 21 is used for calculating the factor expression, and during the execution of the rule, the rule layer 22 may calculate the value of the factor according to the context provided by the rule layer 22, and may include: a rule index tree 221, a rule filter 222, a scene calculator 223, and a rule executor 224.
In practical applications, the rule engine may be one or more processors.
It should be noted that, in the embodiment of the present application, the service rule may be divided into a check rule and a configuration rule, where the check rule is used to check whether a service object meets a condition (condition) of the service rule, and to provide a prompt message; the configuration rule is used for judging whether the business object meets the condition of the business rule or not and executing corresponding actions (such as setting a grey button and adjusting a drop-down box option). Fig. 3 is a schematic diagram of a business rule in the embodiment of the present application, and referring to fig. 3, the business rule may include three parts, which are:
condition: is a business rule condition and is described by a factor expression.
success-action: refers to the action that should be executed when the rule condition is true.
failure-action: when the rule condition is false, the action to be executed is specified.
The semantics represented by the entire business rule are thus: if the condition is true, performing success-action, otherwise, performing failure-action.
For example, when the user selects the format as "all-internet-ready sharing format" on the page through the browser, assuming that the current commodity is packaged by the factor orderiem, "color", "format", "capacity", etc. can all be regarded as attributes, so that the "format" can be described as attribute [ 'mode' ], ("mode" represents "format"), at this time, if the "capacity" is to be grayed out, the "capacity" is
If the option of "6 GB + 64G" is not grayed out and the option of "capacity of" 6GB +128GB "is not grayed out, then the business rules can be set as:
and (2) condition, wherein, order item, attribute [ 'mode' ] ═ full-network universal honorable version.
success-action, namely putting an option with the gray setting capacity of 6GB + 64G; the option of "capacity" of "6 GB +128 GB" is not set with ash.
Of course, the business rules are not limited to include the three parts, and may also be set according to practical applications, and the embodiments of the present application are not specifically limited.
The following describes a method for processing a business rule provided in the embodiment of the present application, with reference to the structure of the rule engine.
Fig. 4 is a schematic flow chart of a method for processing a business rule in an embodiment of the present application, and referring to fig. 4, the method includes:
s401: obtaining an input parameter;
wherein the input parameters include: factor path (path) and scene identification; the factor path is used for representing the change of the business object, the scene identification is used for representing the current scene,
in this embodiment, the input parameters may further include: the checked object is used for characterizing the service object (ower). The checked object carries an attribute field for describing attribute information of the service object, such as user operation, service channel, customer rating, and the like. Of course, the input parameters may also include other parameters, and the embodiment of the present application is not particularly limited.
Here, after the user performs an operation on the page, the rule engine obtains an input parameter corresponding to the user operation input by the page.
S402: determining a first factor expression corresponding to the factor path from a factor expression set corresponding to the business object;
the factor expression set is a set used for expressing business rules corresponding to the business objects;
after the rule engine obtains the input parameters, the rule filter filters the business rules in the factor expression set corresponding to the preset business object, and determines a first factor expression corresponding to the factor path in the input parameters. In practical application, the factor expression set corresponding to the service object may be used to represent all service rules corresponding to the service object, and then the rule filter filters out the service rules corresponding to the factor paths from all service rules corresponding to the service object, that is, the service rules corresponding to the changed portions of the service object.
In some possible embodiments, the factor expression set corresponding to the business object (owner) may be in the form of a rule index tree, which indicates that each rule index tree is organized according to the business object. For example, fig. 5 is a schematic diagram of a rule index tree in the embodiment of the present application, and for the conditions of the three business rules shown in table 1 below, each condition is described by a factor expression, and then the rule index trees corresponding to the three conditions can be referred to as shown in fig. 5. The node name of the rule index tree may be a factor name or a parameter of a factor expression corresponding to the condition of the service rule, and the service rule may be set below a node corresponding to the rule index tree, so that a path of a tree node where the service rule is located is the factor expression of the condition of the service rule.
TABLE 1
[1]orderitem.attribute[‘mode’]All-network-through enjoying edition "
[2]orderitem.attribute[‘mem’]==“4G+64G”
[3]orderitem.relateditem[‘option’]Earphone as one "
It should be noted that the above description is only an example of the rule index tree, and the rule index tree is not limited.
In a specific implementation process, before S402, a process of building a rule index tree may further be included, and accordingly, the rule engine may further include: and a rule index tree building module. Then, fig. 6 is a schematic flowchart of building a rule index tree in the embodiment of the present application, and as shown in fig. 6, the process may include:
step one, a rule index tree building module converts each factor expression in the factor expression set into a second expression node chain (second node chain);
here, the rule index tree building module converts each factor expression in the factor expression set corresponding to the business object into a corresponding second node chain. In this embodiment, the second Node chain is a data structure inside the rule engine, and is used to describe the factor expression.
Step two, the regular index tree building module traverses the second expression node chain, and sequentially executes the following steps on the ith second node in the second expression node chain, wherein i is a positive integer:
then, fig. 6 is a schematic flow chart of constructing a rule index tree in the embodiment of the present application, see fig. 6,
s601: the rule index tree building module judges whether the ith second node has parameters, if so, the step jumps to S602, otherwise, the step jumps to S606;
s602: the rule index tree building module searches a corresponding tree node in a pre-established rule index tree model according to the node name of the ith second node and the corresponding parameter; and if the tree node corresponding to the ith second node is not found, jumping to S603, otherwise, ending the process.
S603: the regular index tree construction module creates a new tree node for the ith second node and adds the new tree node to the child node of the last tree node in the regular index tree model;
s604: the rule index tree building module judges whether the ith second node is the last node in a second expression node chain where the ith second node is located; if the ith second node is the last node in the second expression node chain where the ith second node is located, the process jumps to step S605, otherwise, i is equal to i +1, and the process returns to step S601.
S605: the rule index tree construction module determines the rule index tree model as the rule index tree;
s606: the regular index tree construction module searches a corresponding tree node in the regular index tree model according to the node name of the ith second node; and if the tree node corresponding to the ith second node is not found, the regular index tree building module jumps to S603, otherwise, the process is ended.
In this embodiment of the present application, the rule index tree model may be a blank tree structure preset when the rule index tree is created.
Then, based on the rule index tree, the S402 may include: acquiring a rule index tree constructed by the factor expression set; and searching the first factor expression in the rule index tree according to the factor path.
And the factors in each factor expression in the factor expression set correspond to each node of the rule index tree.
Here, the rule filter first reads a rule index tree corresponding to a pre-stored business object according to the business object, and then performs a lookup in the rule index tree using the factor path to obtain a first factor expression. For example, if the value of the factor path is "order item. attribute [ 'system' ]", the prefix of the factor expression of the business rule condition is searched for the factor expression equivalent to the value of the factor path, as described in the condition [1 ].
In some possible implementation manners, fig. 7 is a schematic flow chart of searching a rule index tree in an embodiment of the present application, and as shown in fig. 7, the step of searching the first factor expression in the rule index tree according to the factor path may include:
s701: the rule filter converts the factor expression corresponding to the factor path into a first expression node chain;
s702: a rule filter sequentially obtains first nodes in the first expression node chain and judges whether the first nodes have parameters or not; if the first node has the parameter, the step goes to S703, otherwise, if the first node does not have the parameter, the step goes to S706.
S703: the rule filter searches whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node and the corresponding parameter; if the corresponding tree node exists, the process jumps to S704, otherwise, the process ends.
S704: a rule filter judges whether the first node is the last node of the first expression node chain or not; if the first node is the last node of the first expression node chain, jumping to S705, otherwise, returning to S702;
s705: and the rule filter determines a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the rule index tree as the first factor expression.
S706: the rule filter searches whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node; and if the corresponding tree node exists, jumping to S704, otherwise, returning to S702.
Therefore, the rule filter filters out the first factor expression corresponding to the factor path. In practical application, the rule filter may also obtain the first factor expression corresponding to the factor path through other manners, for example, searching for a node in the expression set whose node name is consistent with the factor path, so as to obtain the corresponding first factor expression, which is not specifically limited in the embodiment of the present application.
S403: determining a second factor expression corresponding to the scene identification from the factor expression set;
in the embodiment of the present application, the scene is a classification and division of the operation on the business object, for example, a selected color, a selected capacity, a selected format, and the like may be divided into configuration attribute scenes.
The content that can be carried on the scene is: 1. error message: the rule message can be customized according to rule attributes such as rule identification and the like as matching factors. 2. The factor expressions allowed to be executed in the current scenario are described using and or, and only if calculations. Of course, other contents may also be carried on the scene, and the embodiment of the present application is not particularly limited.
In the embodiment of the present application, S403 may include: obtaining a corresponding factor expression configured for the current scene according to the scene identification; and determining the second factor expression in the factor expression set according to the factor expression configured for the current scene.
Here, in order to implement accurate execution of the business rules in different scenarios, different business rules may be configured in advance for different scenarios, and the business rules are described using factor expressions, so as to associate the factor expressions configured for different scenarios with the scenario identifiers. Then, the scene calculator may obtain the factor expression corresponding to the current scene according to the scene identifier, and then screen out a second factor expression satisfying the factor expression corresponding to the current scene from the factor expression set, so that the scene calculator can obtain the executable business rule in the current scene. For example, the factor expressions configured for the current scene are: if # iff is a true and true operator, then the scene calculator may look up a factorial expression that satisfies "OrderItem.
In this embodiment of the present application, since the rule index tree is used to describe each factor expression in the expression set, the scene calculator may screen, according to the rule index tree, a second factor expression that satisfies a factor expression corresponding to a current scene from the factor expression set, and specifically may be: obtaining the rule index tree constructed by the factor expression set in the above embodiment, and then finding the second factor expression in the rule index tree according to the factor expression configured for the current scene.
In practical application, the rule filter may also obtain the second factor expression corresponding to the scene identifier in other manners, which is not specifically limited in the embodiment of the present application.
In some possible implementation processes, since operators such as "and", "or", "not", and/or "if and only" exist in the factor expression configured for the current scene, the scene calculator converts the factor expression configured for the current scene into a fifth expression node chain and an operator group, sorts all the operators in the operator group from high to low according to priority, then traverses the sorted operator groups, sequentially acquires the current operator, and determines whether the current operator is the last operator in the operator group; if the current operator is the last operator in the operator group, calculating a calculation result of the current operator, and obtaining a value of the second factor expression according to the calculation result of the current operator; here, the calculated value of the second factor expression may represent the execution result of the business rule.
In some possible implementations, if the current operator is not the last operator in the operator group, the context calculator may further calculate a calculation result of the current operator and set values of the current operator and associated expressions of the current operator in context; and acquiring a next operator as a current operator, and returning to the step of judging whether the current operator is the last operator in the operator group.
Therefore, the scene calculator filters out the second factor expression corresponding to the scene identification.
It should be noted that, the foregoing S402 and S403 may be executed successively or simultaneously, and the execution order is not specifically limited in this embodiment of the application.
S404: determining a third factor expression according to the first factor expression and the second factor expression;
the third factor expression is used for expressing an executable business rule corresponding to the business object changed in the current scene;
here, after obtaining the first factor expression and the second factor expression, the rule executor performs an and operation on the first factor expression and the second factor expression to obtain an intersection of the first factor expression and the second factor expression, thereby obtaining a third factor expression, that is, an executable business rule corresponding to the business object after being changed in the current scenario.
S405: obtaining a value of the third factor expression;
wherein the value of the third factor expression is used to represent the execution result of the executable business rule.
Here, the rule executor invokes the factor layer to calculate the third factor expression, and obtains an execution result of the executable business rule, thereby implementing accurate execution of the business rule.
Further, after S405, the method may further include: when the executable service rule is a check rule, assembling a message according to the message template and outputting an execution result, namely, after the rule executor executes the check rule, outputting the execution result to a page; when the executable business rule is a configuration rule, the rule executor may execute a corresponding action through S405.
In some possible embodiments, the method may further include: acquiring attribute information of the service object; determining a fourth factor expression corresponding to the attribute information from the factor expression set; and determining the third factor expression according to the first factor expression, the second factor expression and the fourth factor expression.
Here, the rule filter may further obtain attribute information of the service object through S401, and then determine a fourth factor expression corresponding to the attribute information from the expression set by using the attribute information as a filtering condition, and then the rule executor may perform an and operation on the first factor expression, the second factor expression, and the fourth factor expression after obtaining the first factor expression, the second factor expression, and the fourth factor expression, so as to obtain an intersection of the first factor expression, the second factor expression, and the fourth factor expression, thereby obtaining a third factor expression, that is, an executable service rule corresponding to the service object after being changed in the current scenario.
The above method will be described below by way of example.
Assuming that, in the page configuration of the mobile phone commodity, when the standard of the mobile phone is "all-network honor sharing edition", the capacity can only be selected from "6G + 128G", and then it can be realized by the following business rule (denoted as rule _ 1):
condition, orderitem, attribute [ "mode" ] ═ full-network universal honorable version;
success-action, ash-containing capacity of 4G +64G and 6G + 64G;
if there is no data related to the business rule in the system before configuring the business rule, the following configuration may be made:
1. configuring two factors of orderitem (order item) and attribute;
2. configuring scene data, wherein if the scene identifier is prod _ config, the factor expression configured for the scene is: attribute [ ], wherein # iff is a true and true operator;
3. configuring a rule _1, wherein the attribute information of the business object is add, namely, the business object is represented as ordering a commodity;
4. in the code of the written page, general page operation monitoring is embedded, and an application programming interface (api) for realizing the rule engine is called in the monitoring.
Then, when the user selects an order in the goods page, the page enters input parameters into the rules engine, such as factor path: OrderItem. attribute [ "mode" ], scene identification: prod _ config and attribute information: and add.
At this time, in the first step, the rule engine obtains the input parameters: OrderItem. attribute [ "mode" ], prod _ config, and add;
secondly, the rule filter determines a factor expression 1, namely a rule set 1, from a factor expression set corresponding to the business object according to OrderItem.
Secondly, the scene calculator determines a factor expression 2 from the factor expression set according to prod _ config, namely a rule set 2;
thirdly, the rule filter determines a factor expression 3 from the factor expression set according to add, namely the rule set 3;
fourthly, the rule executor performs AND operation on the rule set 1, the rule set 2 and the rule set 3, and the intersection of the rule set 1, the rule set 2 and the rule set 3 is taken to obtain an executable service rule;
and fifthly, executing the executable business rule by the rule executor.
It should be noted that, the second step, the third step, and the fourth step may be executed simultaneously or sequentially, and this is not specifically limited in this embodiment of the present application.
In the embodiment of the application, the corresponding business rules are obtained by combining the current scene according to the changed part of the business object, so that different business rules can be displayed on the same page according to the contents of different commodities, the flexible binding of the business rules and the page elements is further realized, and the accurate execution of the business rules is realized.
Based on the same inventive concept as the method described above, an embodiment of the present application provides a processing apparatus for a business rule, where the processing apparatus for a business rule may be a chip or a system on a chip in a user equipment or a backend server, such as a rule engine in the foregoing embodiment, and may also be a functional module in the user equipment or the backend server for implementing the method described in the foregoing embodiment. For example, fig. 8 is a schematic structural diagram of a processing device for business rules in the embodiment of the present application, and referring to fig. 8, the processing device 800 for business rules may include: an interface module 801, configured to obtain input parameters, where the input parameters include: the system comprises a factor path and a scene identifier, wherein the factor path is used for representing the change of a business object, and the scene identifier is used for representing the current scene; a processing module 802, configured to determine a first factor expression corresponding to the factor path from a factor expression set corresponding to the service object, where the factor expression set is a set used to represent a service rule corresponding to the service object; determining a second factor expression corresponding to the scene identification from the factor expression set; determining a third factor expression according to the first factor expression and the second factor expression, wherein the third factor expression is used for expressing an executable business rule corresponding to a business object changed in the current scene; obtaining a value of the third factor expression, wherein the value of the third factor expression is used for representing the execution result of the executable business rule.
In some possible embodiments, the processing module is further configured to obtain attribute information of the service object; determining a fourth factor expression corresponding to the attribute information from the factor expression set; and determining the third factor expression according to the first factor expression, the second factor expression and the fourth factor expression.
In some possible embodiments, the processing module is configured to obtain a rule index tree constructed by the factor expression set, where a factor in each factor expression in the factor expression set corresponds to each node of the rule index tree; and searching the first factor expression in the rule index tree according to the factor path.
In some possible embodiments, the processing module is configured to convert the factor expression corresponding to the factor path into a first expression node chain; sequentially obtaining first nodes in the first expression node chain, and judging whether the first nodes have parameters; if the first node has the parameter, searching whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node and the corresponding parameter; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
In some possible embodiments, the processing module is further configured to, if the first node does not have a parameter, find whether a corresponding tree node exists in the rule index tree according to a node name of a previous node of the first node; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
In some possible embodiments, the apparatus further comprises: a tree construction module, configured to convert each factor expression in the factor expression set into a second expression node chain; traversing the second expression node chain, and sequentially executing the following steps on the ith second node in the second expression node chain, wherein i is a positive integer: judging whether the ith second node has parameters or not; if the ith second node has parameters, searching a corresponding tree node in a pre-established rule index tree model according to the node name of the ith second node and the corresponding parameters; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
In some possible embodiments, the tree construction module is further configured to, if the ith second node does not have a parameter, search a corresponding tree node in the regular index tree model according to a node name of the ith second node; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
In some possible embodiments, the processing module is further configured to obtain, according to the scene identifier, a corresponding factor expression configured for the current scene; and determining the second factor expression in the factor expression set according to the factor expression configured for the current scene.
In some possible embodiments, the processing module is configured to obtain a rule index tree constructed by the factor expression set, where a factor in each factor expression in the factor expression set corresponds to each node of the rule index tree; and searching the second factor expression in the rule index tree according to the factor expression configured for the current scene.
In some possible embodiments, the interface module is further configured to, after the processing module obtains the execution result of the executable service rule, assemble a message according to a message template when the executable service rule is a check rule, and output the execution result.
It should be noted that the processing module is consistent with the functions implemented by the rule filter, the scene calculator and the rule executor in the above embodiments; the tree building module is consistent with the functions realized by the rule index tree.
In practical applications, the interface module may be a receiving interface, a receiving circuit, a receiver, or the like; the processing module may be one or more processors.
Based on the same inventive concept as the above method, an embodiment of the present application provides a user equipment, fig. 9 is a schematic structural diagram of the user equipment in the embodiment of the present application, and referring to solid lines in fig. 9, a user equipment 900 may include a processor 901, where the processor 901 is configured to couple with a memory, read and execute instructions in the memory, so as to implement the method for processing the service rule as described in the above embodiment.
In some possible embodiments, referring to the dashed line in fig. 9, the user equipment 900 may further include a memory 902 for storing computer-executable instructions and data necessary for the user equipment. When the user equipment is running, the processor executes the computer-executable instructions stored in the memory, so as to enable the communication device to execute the processing method of the business rules according to the embodiment.
Based on the same inventive concept as the method described above, an embodiment of the present application provides a backend server, fig. 10 is a schematic structural diagram of the backend server in the embodiment of the present application, and as shown by a solid line in fig. 10, a backend server 1000 may include a processor 1001, where the processor 1001 is configured to couple with a memory, and read and execute instructions in the memory, so as to implement the method for processing the business rules described in the embodiment described above.
In some possible embodiments, referring to the dashed line in fig. 10, the backend server 1000 may further include a memory 1002 for storing necessary computer-executable instructions and data for the backend server. When the background server is running, the processor executes the computer execution instructions stored in the memory, so as to enable the communication device to execute the processing method of the business rule according to the embodiment.
Based on the same inventive concept as the method, an embodiment of the present application provides a computer-readable storage medium, which stores instructions for executing the processing method of the business rule described in the above embodiment when the instructions are executed on a computer.
Based on the same inventive concept as the above method, the embodiments of the present application provide a computer program or a computer program product, which, when executed on a computer, causes the computer to implement the processing method of business rules described in the above embodiments.
Those of skill in the art will appreciate that the functions described in connection with the various illustrative logical blocks, modules, and algorithm steps described in the disclosure herein may be implemented as hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logical blocks, modules, and steps may be stored on or transmitted over as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. The computer-readable medium may include a computer-readable storage medium, which corresponds to a tangible medium, such as a data storage medium, or any communication medium including a medium that facilitates transfer of a computer program from one place to another (e.g., according to a communication protocol). In this manner, a computer-readable medium may generally correspond to (1) a non-transitory tangible computer-readable storage medium, or (2) a communication medium, such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementing the techniques described herein. The computer program product may include a computer-readable medium.
By way of example, and not limitation, such computer-readable storage media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that the computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but are instead directed to non-transitory tangible storage media. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The instructions may be executed by one or more processors, such as one or more Digital Signal Processors (DSPs), general purpose microprocessors, Application Specific Integrated Circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Thus, the term "processor," as used herein may refer to any of the foregoing structure or any other structure suitable for implementation of the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logical blocks, modules, and steps described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated in a combined codec. Also, the techniques may be fully implemented in one or more circuits or logic elements.
The techniques of this application may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an Integrated Circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of means for performing the disclosed techniques, but do not necessarily require realization by different hardware units. Indeed, as described above, the various units may be combined in a codec hardware unit, in conjunction with suitable software and/or firmware, or provided by an interoperating hardware unit (including one or more processors as described above).
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The above description is only an exemplary embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (20)

1. A method for processing a business rule is characterized by comprising the following steps:
obtaining input parameters, the input parameters including: the system comprises a factor path and a scene identifier, wherein the factor path is used for representing the change of a business object, and the scene identifier is used for representing the current scene;
determining a first factor expression corresponding to the factor path from a factor expression set corresponding to the business object, wherein the factor expression set is a set used for expressing a business rule corresponding to the business object;
determining a second factor expression corresponding to the scene identification from the factor expression set;
determining a third factor expression according to the first factor expression and the second factor expression, wherein the third factor expression is used for expressing an executable business rule corresponding to a business object changed in the current scene;
obtaining a value of the third factor expression, wherein the value of the third factor expression is used for representing the execution result of the executable business rule.
2. The method of claim 1, further comprising:
acquiring attribute information of the service object;
determining a fourth factor expression corresponding to the attribute information from the factor expression set;
and determining the third factor expression according to the first factor expression, the second factor expression and the fourth factor expression.
3. The method according to claim 1 or 2, wherein the determining the first factor expression corresponding to the factor path from the set of factor expressions corresponding to the service object includes:
acquiring a rule index tree constructed by the factor expression set, wherein factors in each factor expression in the factor expression set correspond to each node of the rule index tree;
and searching the first factor expression in the rule index tree according to the factor path.
4. The method of claim 3, wherein said finding said first factorial expression in said regular index tree based on said factorial path comprises:
converting the factor expression corresponding to the factor path into a first expression node chain;
sequentially obtaining first nodes in the first expression node chain, and judging whether the first nodes have parameters;
if the first node has the parameter, searching whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node and the corresponding parameter;
if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain;
and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
5. The method of claim 4, further comprising:
if the first node does not have the parameter, searching whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node;
if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain;
and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
6. The method according to any one of claims 3 to 5, further comprising:
converting each factor expression in the set of factor expressions into a second chain of expression nodes;
traversing the second expression node chain, and sequentially executing the following steps on the ith second node in the second expression node chain, wherein i is a positive integer:
judging whether the ith second node has parameters or not;
if the ith second node has parameters, searching a corresponding tree node in a pre-established rule index tree model according to the node name of the ith second node and the corresponding parameters;
if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model;
judging whether the ith second node is the last node in a second expression node chain where the ith second node is located;
and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
7. The method of claim 6, further comprising:
if the ith second node does not have the parameter, searching a corresponding tree node in the regular index tree model according to the node name of the ith second node;
if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model;
judging whether the ith second node is the last node in a second expression node chain where the ith second node is located;
and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
8. The method according to any one of claims 1 to 7, wherein the determining a second factor expression corresponding to the scene identifier from the set of factor expressions includes:
obtaining a corresponding factor expression configured for the current scene according to the scene identification;
and determining the second factor expression in the factor expression set according to the factor expression configured for the current scene.
9. The method according to claim 8, wherein the determining the second factor expression in the factor expression set according to the factor expression configured for the current scene comprises:
acquiring a rule index tree constructed by the factor expression set, wherein factors in each factor expression in the factor expression set correspond to each node of the rule index tree;
and searching the second factor expression in the rule index tree according to the factor expression configured for the current scene.
10. The method according to any one of claims 1 to 9, wherein after said obtaining the result of the execution of the executable business rule, the method further comprises:
and when the executable service rule is a check rule, assembling the message according to the message template and outputting an execution result.
11. An apparatus for processing business rules, comprising:
an interface module for obtaining input parameters, the input parameters including: the system comprises a factor path and a scene identifier, wherein the factor path is used for representing the change of a business object, and the scene identifier is used for representing the current scene;
the processing module is used for determining a first factor expression corresponding to the factor path from a factor expression set corresponding to the business object, wherein the factor expression set is a set used for expressing a business rule corresponding to the business object; determining a second factor expression corresponding to the scene identification from the factor expression set; determining a third factor expression according to the first factor expression and the second factor expression, wherein the third factor expression is used for expressing an executable business rule corresponding to a business object changed in the current scene; obtaining a value of the third factor expression, wherein the value of the third factor expression is used for representing the execution result of the executable business rule.
12. The apparatus according to claim 11, wherein the processing module is further configured to obtain attribute information of the business object; determining a fourth factor expression corresponding to the attribute information from the factor expression set; and determining the third factor expression according to the first factor expression, the second factor expression and the fourth factor expression.
13. The apparatus according to claim 11 or 12, wherein the processing module is configured to obtain a regular index tree constructed by the factor expression set, wherein a factor in each factor expression in the factor expression set corresponds to each node of the regular index tree; and searching the first factor expression in the rule index tree according to the factor path.
14. The apparatus according to claim 13, wherein the processing module is configured to convert the factor expression corresponding to the factor path into a first expression node chain; sequentially obtaining first nodes in the first expression node chain, and judging whether the first nodes have parameters; if the first node has the parameter, searching whether a corresponding tree node exists in the rule index tree according to the node name of the last node of the first node and the corresponding parameter; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
15. The apparatus of claim 14, wherein the processing module is further configured to, if the first node does not have a parameter, find whether a corresponding tree node exists in the rule index tree according to a node name of a previous node of the first node; if the corresponding tree node exists, judging whether the first node is the last node of the first expression node chain; and if the first node is the last node of the first expression node chain, determining a factor expression corresponding to a subtree which takes the tree node corresponding to the first node as a root node in the regular index tree as the first factor expression.
16. The apparatus of any one of claims 13 to 15, further comprising: a tree construction module, configured to convert each factor expression in the factor expression set into a second expression node chain; traversing the second expression node chain, and sequentially executing the following steps on the ith second node in the second expression node chain, wherein i is a positive integer: judging whether the ith second node has parameters or not; if the ith second node has parameters, searching a corresponding tree node in a pre-established rule index tree model according to the node name of the ith second node and the corresponding parameters; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
17. The apparatus of claim 16, wherein the tree construction module is further configured to search a corresponding tree node in the regular index tree model according to a node name of the ith second node if the ith second node does not have a parameter; if the tree node corresponding to the ith second node is not found, creating a new tree node for the ith second node, and adding the new tree node to the child node of the last tree node in the regular index tree model; judging whether the ith second node is the last node in a second expression node chain where the ith second node is located; and if the ith second node is the last node in the second expression node chain where the ith second node is located, determining the regular index tree model as the regular index tree.
18. The apparatus according to any one of claims 11 to 17, wherein the processing module is further configured to obtain, according to the scene identifier, a corresponding factor expression configured for a current scene; and determining the second factor expression in the factor expression set according to the factor expression configured for the current scene.
19. The apparatus of claim 18, wherein the processing module is configured to obtain a regular index tree constructed by the factor expression set, and wherein factors in each factor expression in the factor expression set correspond to each node of the regular index tree; and searching the second factor expression in the rule index tree according to the factor expression configured for the current scene.
20. The apparatus according to any one of claims 11 to 19, wherein the interface module is further configured to, after the processing module obtains the execution result of the executable business rule, assemble a message according to a message template and output the execution result when the executable business rule is a check rule.
CN201910576569.5A 2019-06-28 2019-06-28 Method and device for processing business rules Pending CN112150091A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910576569.5A CN112150091A (en) 2019-06-28 2019-06-28 Method and device for processing business rules

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910576569.5A CN112150091A (en) 2019-06-28 2019-06-28 Method and device for processing business rules

Publications (1)

Publication Number Publication Date
CN112150091A true CN112150091A (en) 2020-12-29

Family

ID=73869470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910576569.5A Pending CN112150091A (en) 2019-06-28 2019-06-28 Method and device for processing business rules

Country Status (1)

Country Link
CN (1) CN112150091A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380401A (en) * 2021-01-14 2021-02-19 蚂蚁智信(杭州)信息技术有限公司 Service data checking method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050080648A1 (en) * 2003-09-29 2005-04-14 Huelsman David L. Rule processing method, apparatus, and computer-readable medium to generate valid combinations for selection
CN1674519A (en) * 2004-03-24 2005-09-28 华为技术有限公司 Method for realizing communication business payment metering
US20070094199A1 (en) * 2005-08-30 2007-04-26 International Business Machines Corporation System and method for automatically processing dynamic business rules in a content management system
CN104391830A (en) * 2014-10-24 2015-03-04 华迪计算机集团有限公司 Method and device for dynamic layout of bill page
CN107645403A (en) * 2016-07-22 2018-01-30 阿里巴巴集团控股有限公司 Terminal rule engine apparatus, terminal rule operation method
CN108628947A (en) * 2018-04-02 2018-10-09 阿里巴巴集团控股有限公司 A kind of business rule matched processing method, device and processing equipment
CN108984567A (en) * 2017-06-02 2018-12-11 华为技术有限公司 A kind of Service Data Management system and method
CN109190874A (en) * 2018-07-12 2019-01-11 阿里巴巴集团控股有限公司 The implementation method and device of multiple-limb operation flow
CN109598632A (en) * 2018-12-13 2019-04-09 泰康保险集团股份有限公司 Insurance business processing method, device, medium and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050080648A1 (en) * 2003-09-29 2005-04-14 Huelsman David L. Rule processing method, apparatus, and computer-readable medium to generate valid combinations for selection
CN1674519A (en) * 2004-03-24 2005-09-28 华为技术有限公司 Method for realizing communication business payment metering
US20070094199A1 (en) * 2005-08-30 2007-04-26 International Business Machines Corporation System and method for automatically processing dynamic business rules in a content management system
CN104391830A (en) * 2014-10-24 2015-03-04 华迪计算机集团有限公司 Method and device for dynamic layout of bill page
CN107645403A (en) * 2016-07-22 2018-01-30 阿里巴巴集团控股有限公司 Terminal rule engine apparatus, terminal rule operation method
CN108984567A (en) * 2017-06-02 2018-12-11 华为技术有限公司 A kind of Service Data Management system and method
CN108628947A (en) * 2018-04-02 2018-10-09 阿里巴巴集团控股有限公司 A kind of business rule matched processing method, device and processing equipment
CN109190874A (en) * 2018-07-12 2019-01-11 阿里巴巴集团控股有限公司 The implementation method and device of multiple-limb operation flow
CN109598632A (en) * 2018-12-13 2019-04-09 泰康保险集团股份有限公司 Insurance business processing method, device, medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380401A (en) * 2021-01-14 2021-02-19 蚂蚁智信(杭州)信息技术有限公司 Service data checking method and device

Similar Documents

Publication Publication Date Title
EP3072070B1 (en) Callpath finder
CN109241101B (en) Database query optimization method and device and computer equipment
US20180300336A1 (en) Knowledge point structure-based search apparatus
CN112154420B (en) Automatic intelligent cloud service testing tool
CN108008936A (en) A kind of data processing method, device and electronic equipment
CN116601626A (en) Personal knowledge graph construction method and device and related equipment
CN110851343A (en) Test method and device based on decision tree
CN112150091A (en) Method and device for processing business rules
CN108959294B (en) Method and device for accessing search engine
CN112068815B (en) Method and device for processing business rules
CN105245622A (en) Configurable data processing method and system and mobile platform
CN110866031B (en) Database access path optimization method and device, computing equipment and medium
CN116560661A (en) Code optimization method, device, equipment and storage medium
CN113691403B (en) Topology node configuration method, related device and computer program product
CN116010389A (en) Data verification method, device, equipment and storage medium
CN114493799A (en) Method and system for managing special vehicle order data in warehouse and table dividing manner
CN113992664B (en) Cluster communication method, related device and storage medium
JP2023544022A (en) Group type identification methods, devices, computer equipment and computer programs
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN109712011B (en) Community discovery method and device
CN110851126A (en) Method and device for configuring homemade private library on iOS platform
US20230229865A1 (en) Extensible digital assistant interface using natural language processing to respond to user intent
CN112270601B (en) Information transfer method, information transfer device, electronic equipment and readable storage medium
CN106484859A (en) A kind of conjunctive word exhibiting method and device
CN110096504B (en) Streaming event feature matching method and device

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