Methods, devices, electronic equipment, and storage media for generating multiple versions of business rules
By generating LATEST baseline versions and release packages of business rules within the bank, the problem of inconsistent business rule logic caused by differences in regional policies and regulations was solved, achieving a unique mapping and efficient management of business rules.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2026-04-03
AI Technical Summary
Banks have complex internal business rules, and the logic of business rules can be inconsistent due to differences in regional policies and regulations in the same business scenario, making management difficult.
By creating business rule resources in the business rule directory, a LATEST baseline version is generated, and release packages are generated based on different rule logics. Multiple business rule versions are generated using preset version release methods, thus achieving a unique mapping between business scenarios and business rules.
It reduces the complexity of business system management, simplifies version management of business rules, and improves the management efficiency of business systems.
Smart Images

Figure CN117171234B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for generating multiple versions of business rules. Background Technology
[0002] Banks have complex internal business rules. In the same business scenario, the specific logic of the business rules may be different due to differences in local policies and regulations or other reasons. The business system needs to manage a large number of business rules with the same business meaning but not completely consistent in specific logic, which is very difficult to manage. Summary of the Invention
[0003] The main purpose of this application is to provide a method, device, electronic device and storage medium for generating multiple versions of business rules, which aims to reduce the difficulty of business system management by making business scenarios uniquely mapped to business rules.
[0004] To achieve the above objectives, this application provides a method for generating multiple versions of business rules, comprising the following steps:
[0005] Create business rule resources in the business rules directory and generate the LATEST baseline version of the business rule resources;
[0006] Based on the different rule logics of the business rules, a release package is generated, wherein the release package includes multiple rule set files, and the multiple rule set files correspond to different rule logics of the business rules respectively;
[0007] Based on a preset version release method, multiple versions of business rules are generated using the release package and the LATEST baseline version of the business rule resources.
[0008] Optionally, the step of creating business rule resources in the business rule directory and generating a LATEST baseline version of the business rule resources includes:
[0009] Based on the conditional elements of the business rules, create at least one input data variable and at least one data constant in the business rules directory, and generate the LATEST baseline version of the data variable and the LATEST baseline version of the data constant.
[0010] Based on the judgment results of the business rules, create an API service under the business rules directory and generate the API service LATEST baseline version.
[0011] Optionally, the version release method is to release a new version. The step of generating multiple versions of business rules based on a preset version release method, using the release package and the LATEST baseline version of the business rule resources, includes:
[0012] Generate a historical version number based on the current timestamp;
[0013] Update the LATEST baseline version of the business rule resources and the version number of the release package to the historical version number;
[0014] Insert the updated LATEST base version and release package of the business rule resource into the database to generate multiple versions of the business rule.
[0015] Optionally, the version release method is to overwrite the old version. The step of generating multiple versions of business rules based on the preset version release method, using the release package and the LATEST baseline version of the business rule resources, includes:
[0016] Generate a historical version number based on the current timestamp;
[0017] Update the version number of the LATEST baseline version of the business rule resource to the historical version number;
[0018] Insert the updated LATEST base version of the business rule resource and the release package with the unupdated version number into the database to generate multiple versions of the business rule.
[0019] Optionally, in the rule set file, the conditions in the business rules are arranged in a tree diagram root node distribution according to priority from high to low.
[0020] Optionally, before the step of creating a business rule resource in the business rule directory and generating a LATEST baseline version of the business rule resource, the method further includes:
[0021] Create a spatial directory in the business system, and create a decision directory under the spatial directory, wherein the names of the spatial directory and the decision directory are unique in the business system;
[0022] The steps of creating business rule resources in the business rule directory and generating a LATEST baseline version of the business rule resources include:
[0023] Create business rule resources under the decision directory and generate the LATEST baseline version of the business rule resources.
[0024] Optionally, the method for generating multiple versions of business rules further includes the following steps:
[0025] When new rule logic appears in the business rules, the existing rule set file in the release package is selected for corresponding modification;
[0026] Based on the preset version release method, a new version of the business rules is generated by using the modified release package and the LATEST baseline version of the business rule resources.
[0027] Furthermore, to achieve the above objectives, this application also provides a business rule multi-version generation system, including:
[0028] The WEB module is used to create business rule resources in the business rule directory and generate the LATEST baseline version of the business rule resources.
[0029] The Core module is used to generate a release package based on different rule logics of the business rules. The release package includes multiple rule set files, each corresponding to a different rule logic of the business rules.
[0030] The WEB module is also used to generate multiple versions of business rules based on a preset version release method, using the release package and the LATEST baseline version of the business rule resources.
[0031] In addition, to achieve the above objectives, this application also provides an electronic device, the device comprising: a memory, a processor, and a business rule multi-version generation program stored on the memory and executable on the processor, the business rule multi-version generation program being configured to implement the steps of the business rule multi-version generation method as described above.
[0032] In addition, to achieve the above objectives, this application also provides a storage medium storing a business rule multi-version generation program, which, when executed by a processor, implements the steps of the business rule multi-version generation method as described above.
[0033] This application discloses a method, apparatus, electronic device, and storage medium for generating multiple versions of business rules. Compared to existing technologies where business systems need to manage a large number of business rules with the same meaning but different specific logics, resulting in high management difficulty, this application creates business rule resources in a business rule directory and generates a LATEST baseline version of the business rule resources. Based on the different rule logics of the business rules, a release package is generated, wherein the release package includes multiple rule set files, each corresponding to a different rule logic of the business rule. Based on a preset version release method, multiple versions of the business rules are generated using the release package and the LATEST baseline version of the business rule resources. In other words, the different rule logics of the business rules in this application correspond to different multiple rule set files, all within the same release package. This enables the same business rule to correspond to different rule logics, ensuring a unique mapping between business scenarios and business rules, thus facilitating business system management. Attached Figure Description
[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0035] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart illustrating the first embodiment of the method for generating multiple versions of business rules in this application;
[0037] Figure 2 Module interaction diagrams for generating multiple versions of the business rules for this application system;
[0038] Figure 3 This is a diagram illustrating the generation of a new version of the business rules based on the release of this application;
[0039] Figure 4 This is a flowchart illustrating the second embodiment of the method for generating multiple versions of business rules in this application;
[0040] Figure 5 This application is based on a business rule version that covers older versions, and the diagram illustrates this.
[0041] Figure 6 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiments of this application.
[0042] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0043] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0044] This application provides a method for generating multiple versions of business rules, such as... Figure 1 As shown, Figure 1 This is a flowchart illustrating the first embodiment of the method for generating multiple versions of business rules in this application.
[0045] In this embodiment, the method for generating multiple versions of business rules includes the following steps:
[0046] Step S10: Create business rule resources in the business rule directory and generate the LATEST baseline version of the business rule resources;
[0047] Step S20: Generate a release package based on the different rule logics of the business rules, wherein the release package includes multiple rule set files, and the multiple rule set files correspond to different rule logics of the business rules respectively;
[0048] Step S30: Based on a preset version release method, generate multiple versions of the business rules using the release package and the LATEST baseline version of the business rule resources.
[0049] It should be noted that the aforementioned method for generating multiple versions of business rules is applied to a system for generating multiple versions of business rules. This system includes a WEB module, a Bus module, and a Core module. The interaction relationships between these modules and users are as follows: Figure 2 As shown in the diagram. The Web module serves as the front-end, providing users with resources related to business rules and enabling visual configuration of those rules; the Bus module acts as the back-end, responsible for storing information about these resources; and the Core module, as the core processing module, is responsible for parsing visual configuration messages and generating Drools rules.
[0050] The WEB module has the following functions:
[0051] 1) Space Management
[0052] The space directory is the top-level directory for managing resources related to business rules. Various business systems can create their own resource management directory by creating a new space, effectively managing the resources under their name. The space directory name is unique across the entire platform; different business systems cannot create the same space directory. After a new space directory is added, it is stored in the space information table of the MySQL database in the background.
[0053] 2) Decision Management
[0054] The decision directory is a subdirectory for managing resources related to business rules. Each decision directory belongs to a spatial directory. Resources related to business rules are directly managed within the decision directory. After creating a spatial directory, various business systems can categorize their business rules according to their own system requirements and create corresponding decision directories. Decision directory names are unique across the entire platform; different business systems cannot create the same decision directory. New decision directories are stored in the decision information table of the backend MySQL database.
[0055] 3) Data Variable Management
[0056] Fact Object Management provides data variable management functionality within the decision directory. Business systems, after summarizing the input and output data of business rules and designing corresponding data entities, can add them in the data variable management section for subsequent visual configuration of business rules. Data variables only need to be unique within the decision directory; different business systems can create data variables with the same name in their respective decision directories without conflicting or overwriting each other. Adding a data variable requires filling in the entity class name (Java class name), entity name, and field information. Field information includes the Java field name, field description, and field type. Field types are fixed to Java-specific data types, including String, Double, Date, Boolean, BigDecimal, and List. <string>List of numbers <double>Large number set List <bigdecimal>There are a total of 8 types. After adding a new data variable, it is stored in the background MySQL database data variable information table.
[0057] 4) Data constant management
[0058] Many internal bank rules involve the use of various codes, such as common country and region names and codes, administrative division codes of the People's Republic of China, national economic industry classifications and codes used for corporate clients, and occupational classifications and codes used for individual clients. For this type of information, a data constant management function is provided in the decision directory. Business systems can enter various codes as constants for subsequent visual configuration of business rules. Consistent with data variable control, data constants only need to be unique within the decision directory. Adding a new data constant requires filling in the constant name, constant description, constant value, and value description. After addition, the data constant is stored in the data constant information table in the backend MySQL database.
[0059] 5) API service
[0060] Drools supports custom functions and can automatically generate call functions, enabling visual configuration of API service calls within the RHS section of the rule body. To leverage this feature, API service functionality is provided in the decision directory. Business systems can register the API interfaces they need to call for subsequent visual configuration of business rules. Adding a new API service requires filling in the service name, HTTP request address, request headers, URL parameters, body parameters, and API return template. The request headers, URL parameters, body parameters, and API return template only require formatting and default values; all can be customized in subsequent visual configuration.
[0061] Drools is an open-source rule engine based on the Java language that can free complex and ever-changing business rules from hard coding and store them as rule scripts in files or specific storage media.
[0062] 6) Rule set
[0063] The rule set file, also known as the .drl file, provides management functions for business rules. Through the rule design function of the rule set, you can enter the rule visual configuration page and perform maintenance operations on business rules.
[0064] The rule design provides functions such as saving settings, viewing source files, quick testing, associating entities, associating constants, and associating APIs. The specific rule body editing provides functions such as advanced Drools attribute settings, tree-like extended configuration of LHS conditions, and list-like extended configuration of RHS results.
[0065] The Bus module has the following functions:
[0066] 1) Space Management
[0067] It provides a space management interface and is responsible for storing newly added space directories in the space information table of the MySQL database.
[0068] 2) Decision Management
[0069] It provides a decision management interface and is responsible for storing newly added decision directories and their upper-level spatial directories into the decision information table of the MySQL database.
[0070] 3) Data Variable Management
[0071] It provides a data variable interface, which is responsible for calling the Core module to generate Java class definition information based on the decision directory and data variable information sent by the Web module, and storing it in the MySQL database data variable information table.
[0072] 4) Data constant management
[0073] It provides a data constant interface, which is responsible for storing newly added constants and their corresponding decision directory information into the MySQL database data constant information table.
[0074] 5) API service
[0075] Provides API interfaces and is responsible for storing newly added APIs and their corresponding decision directory information in the MySQL database API information table.
[0076] 6) Rule set
[0077] It provides a rule set interface, responsible for storing newly added rule sets and their corresponding decision directory information in the MySQL database rule set information table; storing the association relationships between rule sets and data variables, data constants, and API services in the MySQL database rule set resource dependency table; and calling the Core module to generate drl script definition information.
[0078] The Core module has the following functions:
[0079] 1) Generate Java class definition information
[0080] A specific data structure is defined to represent data variable information. The Web module constructs field information based on this data structure and sends it up. The Bus module forwards the request. The Core module parses and generates Java class definition information and returns it to the Bus module for storage.
[0081] 2) Generate drl rule script file information
[0082] A specific data structure is defined to represent the information generated by the drl rule script. The Web module constructs field information based on this data structure and sends it up. The Bus module forwards the request. The Core module parses and generates the drl rule script file information and returns it to the Bus module for storage.
[0083] It should be noted that in this embodiment, different rule logics of business rules correspond to different rule set files, and multiple rule set files are all in the same release package, so that the same business rule corresponds to different rule logics, making the business scenario and business rule uniquely mapped, which facilitates business system management.
[0084] The specific steps are as follows:
[0085] Step S10: Create business rule resources in the business rule directory and generate the LATEST baseline version of the business rule resources.
[0086] As an example, the steps for creating a business rule resource in the business rules directory and generating a LATEST baseline version of the business rule resource include:
[0087] Based on the conditional elements of the business rules, create at least one input data variable and at least one data constant in the business rules directory, and generate the LATEST baseline version of the data variable and the LATEST baseline version of the data constant.
[0088] Based on the judgment results of the business rules, create an API service under the business rules directory and generate the API service LATEST baseline version.
[0089] For example, if the business scenario involves an access check before a credit card can be issued, the rule logic for this business in China would be as follows:
[0090] 1. If the branch supports fast account opening, you will be granted direct access;
[0091] 2. If the client is a Chinese citizen and meets any of the following conditions, the application will be successfully approved;
[0092] 2.1. Occupation: Teacher or Civil Servant;
[0093] 2.2. Individuals who are self-employed and have a monthly income exceeding 25,000;
[0094] The logic behind business rules in the United States is as follows:
[0095] 1. If the branch supports fast account opening, you will be granted direct access;
[0096] 2. If the client is a U.S. citizen and meets any of the following conditions, admission will be successful;
[0097] 2.1. Occupation: Teacher, Civil Servant, or Firefighter;
[0098] 2.2. Individuals who are self-employed and have a monthly income exceeding 10,000.
[0099] Based on the above rules and logic, input data variables can include: Customer information, with new fields such as name, gender, nationality, document type, document number, document expiration date, occupation, monthly income, address, and mobile phone number. These types of input data variables can be named "Customer". Input data variables can also include: Branch information, with new fields such as branch name, branch number, and whether expedited account opening is accepted. These types of input data variables can be named "Organization".
[0100] Based on the above rule logic, after the rule judgment is passed, the admission result needs to be set to 0 (pass). Therefore, output data variables can include: admission check result, newly added field admission result, and registration return information. The above type of output data variable can be named CheckResult.
[0101] Based on the above rule logic, such as "If the customer's nationality is Chinese and meets any of the following conditions", and "If the customer's nationality is American and meets any of the following conditions", it can be seen that country code information is used. Therefore, data constants can include: country and region. The above type of data constant can be named Country.
[0102] Based on the above rule logic, "occupation is teacher or civil servant" and "occupation is self-employed with a monthly income exceeding 25,000" indicate that occupational code information is used. Therefore, data constants can include occupation. Data constants of this type can be named "Occupation".
[0103] As an example, before creating a business rule resource in the business rules directory and generating a LATEST baseline version of the business rule resource, the following steps are also included:
[0104] Create a spatial directory in the business system, and create a decision directory under the spatial directory, wherein the names of the spatial directory and the decision directory are unique in the business system;
[0105] The steps of creating business rule resources in the business rule directory and generating a LATEST baseline version of the business rule resources include:
[0106] Create business rule resources under the decision directory and generate the LATEST baseline version of the business rule resources.
[0107] For example, when a user logs into the Web module, they create a space directory named "myspace," ensuring it remains unique across the entire system. Within this "myspace" directory, a decision-making directory named "myproject" is created, also ensuring it remains unique across the entire system.
[0108] Step S20: Generate a release package based on the different rule logics of the business rules, wherein the release package includes multiple rule set files, and the multiple rule set files correspond to different rule logics of the business rules respectively.
[0109] For example, the rule set file includes a function to associate entity objects, which can be used to associate data variables Customer, Organization, and CheckResult.
[0110] For example, the rule set file includes a function to associate constants, which can be used to associate data constants such as Country and Occupation.
[0111] As an example, in the rule set file, the conditions in the business rules are arranged in a tree-like root node distribution according to their priority from high to low.
[0112] For example, according to the rule description, the conditions in the business rules need to be divided into the following four levels according to their priority from high to low:
[0113] First level: Occupation is self-employed, monthly income exceeds 25,000, and the relationship between the conditions is AND;
[0114] The second level: the occupation is teacher or civil servant, and the relationship with the result of the first level is OR;
[0115] Third layer: The customer's nationality is Chinese, and the relationship with the result of the second layer is AND;
[0116] Fourth layer: The branch where it is located supports fast account opening, and its relationship with the result of the third layer is OR.
[0117] LHS conditions are configured in ascending order of priority.
[0118] a. Based on the lowest priority condition relationship, set the root node A of the LHS condition tree diagram as a relationship node with the attribute "or".
[0119] b. Add a condition to node A, configure the fourth-level simple condition "the branch supports fast account opening", select whether the data variable Organization accepts fast account opening on the left side of the condition expression, select == equals in the middle operator, select direct input value on the right side, and input the boolean value (true).
[0120] c. Add a group to node A, create a new group node B, and set its attribute to AND.
[0121] d. Add a condition to node B, configure the third-level simple condition "customer nationality is China", select the nationality field of the data variable Customer on the left side of the condition expression, select equal to == in the middle operator, and select the constant value of China of the data constant Country on the right side.
[0122] e. Add a group to node B, create a new group node C, and set its attribute to "or".
[0123] f. Add a condition to node C, configuring the second-level simple condition "occupation is teacher or civil servant". The left side of the condition expression selects the occupation field of the data variable Customer, the middle operator selects the memberOf set, and the right side selects the constant value of the data constant Occupation: teacher and civil servant.
[0124] g. Add a group to node C, create a new group node D, and set its attribute to AND.
[0125] h. Add conditions to node D, configure the first-level simple condition "Occupation is self-employed". Select the occupation field of the data variable Customer on the left side of the condition expression, select equal to == in the middle operator, and select the constant value of the data constant Occupation as self-employed on the right side.
[0126] i. Add a condition to node D, configure the first-level simple condition "monthly income exceeds 25000", select the monthly income field of the data variable Customer on the left side of the condition expression, select greater than or equal to >= in the middle operator, select direct input value on the left side, and enter 25000.
[0127] Business rule RHS result configuration. According to the business scenario description, if the rule judgment is successful, the admission result needs to be set to 0 - passed.
[0128] It should be noted that using a tree diagram for condition configuration allows for configuring the priority of conditional expressions from low to high, providing good support for complex conditions without the need for manual conversion and rewriting.
[0129] Step S30: Based on a preset version release method, generate multiple versions of the business rules using the release package and the LATEST baseline version of the business rule resources.
[0130] As an example, the version release method is to release a new version. The step of generating multiple versions of business rules based on the preset version release method, using the release package and the LATEST baseline version of the business rule resources, includes:
[0131] Generate a historical version number based on the current timestamp;
[0132] Update the LATEST baseline version of the business rule resources and the version number of the release package to the historical version number;
[0133] Insert the updated LATEST base version and release package of the business rule resource into the database to generate multiple versions of the business rule.
[0134] For example, such as Figure 4 As shown, selecting to release a new version generates a historical version that saves the initial logic of business rules within China. After successful release, the release package and related resources will generate a historical version with the same version number v20230406084228. This historical version is identical to the current LATEST version and is not editable. The business system can use the release package ID and version number v20230406084228 to check credit card issuance access within China.
[0135] Furthermore, such as Figure 4 As shown, based on the previous embodiment, the method for generating multiple versions of business rules further includes the following steps:
[0136] a1: When new rule logic appears in the business rules, the existing rule set file in the release package is selected for corresponding modification;
[0137] a2: Based on the preset version release method, a new version of the business rules is generated by using the modified release package and the LATEST baseline version of the business rule resources.
[0138] It should be noted that in this embodiment, when new requirements are encountered, secondary development can be carried out directly on the baseline version of the business rules, reusing existing rule set files, thereby improving development efficiency.
[0139] For example, according to the rule description, the conditions in the business rules need to be divided into the following four levels according to their priority from high to low:
[0140] First level: Occupation is self-employed, monthly income exceeds 10,000, and the relationship between the conditions is AND;
[0141] The second layer: the occupation is teacher, civil servant or firefighter, and the relationship with the result of the first layer is OR;
[0142] Third layer: The client's nationality is the United States, and the relationship with the result of the second layer is AND;
[0143] Fourth layer: The branch where it is located supports fast account opening, and its relationship with the result of the third layer is OR.
[0144] Therefore, the occupational information in the conditions also includes consumer; modify the data constant Occupation to add the constant value firefighter. Reuse the existing rule set file for logical configuration and directly make the following modifications:
[0145] a. Modify the third-level simple condition of node B to "customer nationality is United States", and select the constant value of the data constant Country on the right side of the condition expression as the United States.
[0146] b. Modify the second-level simple condition of node C to "occupation is teacher, civil servant, or firefighter". The right side of the condition expression should select the constant values of the data constant Occupation: teacher, civil servant, and firefighter.
[0147] c. Modify the first-level simple condition of node D, "monthly income exceeds 25000", to "monthly income exceeds 10000". Select "direct input value" on the left side of the condition expression and change it to 10000.
[0148] Finally, the version release function is triggered, selecting to release a new version. This generates a historical version to save the initial logic of the business rules within the United States. Upon successful release, the release package and related resources all generate a historical version with the same version number v20230406085516. This historical version is identical to the current LATEST version and is not editable. The business system can use the release package ID and version number v20230406085516 to check credit card activation approval within the United States.
[0149] Furthermore, the version release method is to overwrite the old version. The step of generating multiple versions of business rules based on the preset version release method, using the release package and the LATEST baseline version of the business rule resources, includes:
[0150] Generate a historical version number based on the current timestamp;
[0151] Update the version number of the LATEST baseline version of the business rule resource to the historical version number;
[0152] Insert the updated LATEST base version of the business rule resource and the release package with the unupdated version number into the database to generate multiple versions of the business rule.
[0153] For example, to reuse existing rule set files for logical configuration, the following modifications can be made directly:
[0154] a. Modify the third-level simple condition of node B to "customer nationality is China", and select the constant value of the data constant Country on the right side of the condition expression as China.
[0155] b. Modify the second-level simple condition of node C to "Occupation is teacher or civil servant". The right side of the condition expression should select the constant value of the data constant Occupation: teacher or civil servant.
[0156] c. Modify the first-level simple condition of node D, "monthly income exceeds 10,000", to "monthly income exceeds 35,000". Select "direct input value" on the left side of the condition expression and change it to 35,000.
[0157] Triggering version release functionality, such as Figure 5 As shown, selecting "Overwrite Old Version" generates a historical version that saves the latest logic of business rules within China. After successful release, all resources related to the release package generate a historical version with the same version number v20230406100658. This historical version is identical to the current LATEST version and is uneditable. The release package version v20230406084228 is de-associated with its original relationship and re-associated with the v20230406100658 version of the relevant resources. The business system does not need to modify its code; it still uses the release package ID and version number v20230406084228 to perform credit card issuance access checks within China.
[0158] Furthermore, to achieve the above objectives, this application also provides a business rule multi-version generation system, including:
[0159] The WEB module is used to create business rule resources in the business rule directory and generate the LATEST baseline version of the business rule resources.
[0160] The Core module is used to generate a release package based on different rule logics of the business rules. The release package includes multiple rule set files, each corresponding to a different rule logic of the business rules.
[0161] The WEB module is also used to generate multiple versions of business rules based on a preset version release method, using the release package and the LATEST baseline version of the business rule resources.
[0162] Optionally, the WEB module is specifically used for:
[0163] Based on the conditional elements of the business rules, create at least one input data variable and at least one data constant in the business rules directory, and generate the LATEST baseline version of the data variable and the LATEST baseline version of the data constant.
[0164] Based on the judgment results of the business rules, create an API service under the business rules directory and generate the API service LATEST baseline version.
[0165] Optionally, the version release method is to release a new version, and the WEB module is further specifically used for:
[0166] Generate a historical version number based on the current timestamp;
[0167] Update the LATEST baseline version of the business rule resources and the version number of the release package to the historical version number;
[0168] Insert the updated LATEST base version and release package of the business rule resource into the database to generate multiple versions of the business rule.
[0169] Optionally, the version release method is to overwrite the old version, and the WEB module is also specifically used for:
[0170] Generate a historical version number based on the current timestamp;
[0171] Update the version number of the LATEST baseline version of the business rule resource to the historical version number;
[0172] Insert the updated LATEST base version of the business rule resource and the release package with the unupdated version number into the database to generate multiple versions of the business rule.
[0173] Optionally, the WEB module is further used for:
[0174] Create a spatial directory in the business system, and create a decision directory under the spatial directory, wherein the names of the spatial directory and the decision directory are unique in the business system;
[0175] The steps of creating business rule resources in the business rule directory and generating a LATEST baseline version of the business rule resources include:
[0176] Create business rule resources under the decision directory and generate the LATEST baseline version of the business rule resources.
[0177] Optionally, in the rule set file, the conditions in the business rules are arranged in a tree diagram root node distribution according to priority from high to low.
[0178] Optionally, the WEB module is further used for:
[0179] When new rule logic appears in the business rules, the existing rule set file in the release package is selected for corresponding modification;
[0180] Based on the preset version release method, a new version of the business rules is generated by using the modified release package and the LATEST baseline version of the business rule resources.
[0181] The implementation principle and beneficial effects of the business rule multi-version generation system shown in this application embodiment can be found in the implementation principle and beneficial effects of the business rule multi-version generation method shown in any of the above embodiments, and will not be repeated here.
[0182] Reference Figure 6 , Figure 6 This is a schematic diagram of the electronic device structure of the hardware operating environment involved in the embodiments of this application.
[0183] The electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0184] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0185] like Figure 6 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and a component communication program.
[0186] exist Figure 6 In the electronic device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of this application can be set in the electronic device, and the electronic device calls the component communication program stored in the memory 1005 through the processor 1001 and executes the business rule multi-version generation method provided in the above embodiment of the business rule multi-version generation method.
[0187] This application embodiment also provides a storage medium storing a business rule multi-version generation program, which, when executed by a processor, implements the steps of the business rule multi-version generation method described above.
[0188] The specific implementation of the storage medium in this application is basically the same as the embodiments of the above-mentioned multi-version generation method for business rules, and will not be repeated here.
[0189] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0190] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0191] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0192] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.< / bigdecimal> < / double> < / string>
Claims
1. A method for generating multiple versions of business rules, characterized in that, The method for generating multiple versions of business rules includes the following steps: Based on the conditional elements of the business rules, create at least one input data variable and at least one data constant in the business rules directory, and generate the LATEST baseline version of the data variable and the LATEST baseline version of the data constant. Based on the judgment result of the business rules, create an API service under the business rules directory and generate the API service LATEST baseline version; Based on the different rule logics of the business rules, a release package is generated, wherein the release package includes multiple rule set files, and the multiple rule set files correspond to different rule logics of the business rules respectively; Based on a preset version release method, multiple versions of business rules are generated using the release package and the LATEST baseline version of the business rule resources.
2. The method for generating multiple versions of business rules as described in claim 1, characterized in that, The version release method is to release a new version. The step of generating multiple versions of business rules based on the preset version release method, using the release package and the LATEST baseline version of the business rule resources, includes: Generate a historical version number based on the current timestamp; Update the LATEST baseline version of the business rule resources and the version number of the release package to the historical version number; Insert the updated LATEST base version and release package of the business rule resource into the database to generate multiple versions of the business rule.
3. The method for generating multiple versions of business rules as described in claim 1, characterized in that, The version release method is to overwrite the old version. The step of generating multiple versions of business rules based on the preset version release method, using the release package and the LATEST baseline version of the business rule resources, includes: Generate a historical version number based on the current timestamp; Update the version number of the LATEST baseline version of the business rule resource to the historical version number; Insert the updated LATEST base version of the business rule resource and the release package with the unupdated version number into the database to generate multiple versions of the business rule.
4. The method for generating multiple versions of business rules as described in claim 1, characterized in that, In the rule set file, the conditions in the business rules are arranged in a tree-like root node distribution according to their priority from high to low.
5. The method for generating multiple versions of business rules as described in claim 1, characterized in that, Before the step of creating business rule resources in the business rule directory and generating the LATEST baseline version of the business rule resources, the method further includes: Create a spatial directory in the business system, and create a decision directory under the spatial directory, wherein the names of the spatial directory and the decision directory are unique in the business system; The steps of creating business rule resources in the business rule directory and generating a LATEST baseline version of the business rule resources include: Create business rule resources under the decision directory and generate the LATEST baseline version of the business rule resources.
6. The method for generating multiple versions of business rules as described in claim 1, characterized in that, The method for generating multiple versions of business rules also includes the following steps: When new rule logic appears in the business rules, the existing rule set file in the release package is selected for corresponding modification; Based on the preset version release method, a new version of the business rules is generated by using the modified release package and the LATEST baseline version of the business rule resources.
7. A business rule multi-version generation system, characterized in that, include: The WEB module is used for: Based on the conditional elements of the business rules, create at least one input data variable and at least one data constant in the business rules directory, and generate the LATEST baseline version of the data variable and the LATEST baseline version of the data constant. Based on the judgment result of the business rules, create an API service under the business rules directory and generate the API service LATEST baseline version; The Core module is used to generate a release package based on different rule logics of the business rules. The release package includes multiple rule set files, each corresponding to a different rule logic of the business rules. The WEB module is also used to generate multiple versions of business rules based on a preset version release method, using the release package and the LATEST baseline version of the business rule resources.
8. An electronic device, characterized in that, The device includes: a memory, a processor, and a business rule multi-version generation program stored in the memory and executable on the processor, the business rule multi-version generation program being configured to implement the steps of the business rule multi-version generation method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a business rule multi-version generation program, which, when executed by a processor, implements the steps of the business rule multi-version generation method as described in any one of claims 1 to 6.