Supply Chain Design System Based on Rule Engine
Through the supply chain design system based on the rule engine, the business rules are liberated from hard coding, the dynamic adjustment and online validation of the business rules are realized, the problem of high maintenance costs caused by changes in business logic in the existing technology is solved, and the system maintenance is simplified. and development process.
Patent Information
- Application Number
- CN202311621576.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-11-30
AI Technical Summary
In the existing technology, business logic code is difficult to adapt to changes in external business logic, resulting in high maintenance and customization costs. Especially for non-programmers, system maintenance and development costs are high.
Adopting a supply chain design system based on a rule engine, the rule designer receives input data, establishes business rules and sets constraints. The rule generator writes the rules into scripts and stores them in the database. The rule logic generator is based on business scenarios and standardization. Rules set processing logic, and are verified and applied through the simulation interaction platform to realize dynamic adjustment of business rules.
It can take effect immediately in the online environment without modifying the project code, which reduces system maintenance and development costs, improves system delivery efficiency and reduces delivery costs, and supports business personnel to directly define and maintain business logic.
Smart Images

Figure CN117931134B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of supply chain system design, and in particular to a supply chain design system based on a rule engine. Background Art
[0002] There are often a lot of business logic codes in the application system to complete the judgment and processing of the corresponding business logic. This method of directly using source code to define business logic is difficult to adapt to changes in external business logic. When changing, updating and adjusting business modules, the corresponding maintenance and customization costs are also very high for people who do not understand programming. Summary of the invention
[0003] In view of this, in order to solve the problems in the prior art, the present invention provides a supply chain design system based on a rule engine.
[0004] Its main technical solutions are as follows:
[0005] Supply chain design system based on rule engine, including:
[0006] A rule designer is provided, input data is received in the rule designer, business rules are established according to the received input data, and constraint conditions are set for the established business rules by the rule designer;
[0007] A rule generator, connected to the rule designer, is used to write the business rules that set the constraint conditions into the rule script, and store the rule script in the database;
[0008] A rule logic generator is connected to the rule generator and is used to set the rule processing logic of different business logics according to business scenarios and standardized rules, and link the rule processing logic into the rule script, and correspondingly apply the database storing the rule script to the corresponding business scenario.
[0009] Furthermore, the rule designer has:
[0010] Rule generation module;
[0011] A receiving unit, used for receiving input data;
[0012] An analysis unit, configured to analyze the type of data and the corresponding business scenario based on the input data,
[0013] The rule configuration unit is used to load the rule storage warehouse and search for standardized business rules in the rule storage warehouse according to the data type and business scenario obtained by the analysis unit. If a corresponding standardized business rule is matched, the standard business rule is used as the business rule of the input data, and a corresponding mapping is established between the input data and the business rule. If a match is found, the process is transferred to the rule generation module.
[0014] The rule generation module loads the rule engine according to the data type and business scenario of the input data, calls the business rule table and natural language rule setting package corresponding to the business scenario and data type in the rule engine, and configures the corresponding business rules with the business rule table and natural language rule setting package;
[0015] The constraint configuration unit is used to configure the constraint conditions of the business rules according to the business scenarios corresponding to the business rules.
[0016] Furthermore, the constraint condition is used to limit the application scope of the business rule.
[0017] Furthermore, the rule script has semantic processing functions set for data types and business scenarios.
[0018] Furthermore, the rule logic generator has:
[0019] The rule logic generation unit loads the function library according to the business scenario and standardized rules to match the corresponding processing function, and sets the rule processing logic of different business logics through the processing function;
[0020] A verification unit is used to link the rule processing logic into the corresponding rule script, load the rule script into the simulation interaction platform through the rule execution engine for simulation interaction verification, store the rule script in the database when there are no errors in the verification, and apply the database to the corresponding business scenario.
[0021] Furthermore, the standardized rules are used to select a matching processing function according to a business scenario.
[0022] Furthermore, the standardization rules include a rule set consisting of a number of standard rules set according to the constraints in the rule script.
[0023] Furthermore, at least one standard rule is matched in the rule set according to the business scenario, and each standard rule corresponds to a fixed processing function.
[0024] Furthermore, when two or more standard rules are matched in the rule set according to the business scenario, the control logic between the standard rules is first set according to the usage requirements of the business scenario, and the logical relationship between the matched processing functions is set through the control logic.
[0025] Furthermore, the simulation interaction platform has the function of performing simulation interaction verification according to a single rule script, and also has the function of performing simulation interaction verification based on multiple rule scripts in an EXCEL form.
[0026] According to different business scenarios, when inputting data, the present application constructs business rules and corresponding constraints for different data types and business scenarios, writes the business rules for setting constraints into the rule script, loads the function library according to the business scenario and standardized rules to match the corresponding processing function, sets the rule processing logic of different business logics through the processing function, and loads the rule script to the simulation interaction platform through the rule execution engine for simulation interaction verification, so as to obtain the rule script that meets the needs of different business scenarios. The complex and changeable business rules can be freed from hard coding and stored in files or specific storage media (such as in a database) in the form of rule scripts, so that changes to business rules can take effect immediately in the online environment without modifying the project code or restarting the server.
[0027] This application can also effectively support business personnel's direct definition and maintenance of business logic through business logic definition, parsing, and execution, and through parsing support for natural language grammar, greatly simplifying system maintenance and development costs, improving system delivery efficiency while reducing delivery costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0029] Figure 1 It is a schematic diagram of the system implementation principle provided by the present invention;
[0030] Figure 2 It is a schematic diagram of the system framework principle provided by the present invention. DETAILED DESCRIPTION
[0031] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0032] Example 1
[0033] Reference Figure 1 to Figure 2, the present application provides a supply chain design system based on a rule engine, including: providing a rule designer, receiving input data in the rule designer, establishing business rules according to the received input data, and setting constraint conditions for the established business rules by the rule designer;
[0034] A rule generator, connected to the rule designer, is used to write the business rules that set the constraint conditions into the rule script, and store the rule script in the database;
[0035] A rule logic generator is connected to the rule generator and is used to set the rule processing logic of different business logics according to business scenarios and standardized rules, and link the rule processing logic into the rule script, and correspondingly apply the database storing the rule script to the corresponding business scenario.
[0036] The rule logic generator has:
[0037] The rule logic generation unit loads the function library according to the business scenario and standardized rules to match the corresponding processing function, and sets the rule processing logic of different business logics through the processing function;
[0038] A verification unit is used to link the rule processing logic into the corresponding rule script, load the rule script into the simulation interaction platform through the rule execution engine for simulation interaction verification, store the rule script in the database when there are no errors in the verification, and apply the database to the corresponding business scenario.
[0039] According to different business scenarios, when inputting data, the present application constructs business rules and corresponding constraints for different data types and business scenarios, writes the business rules for setting constraints into the rule script, loads the function library according to the business scenario and standardized rules to match the corresponding processing function, sets the rule processing logic of different business logics through the processing function, and loads the rule script to the simulation interaction platform through the rule execution engine for simulation interaction verification, so as to obtain the rule script that meets the needs of different business scenarios. The complex and changeable business rules can be freed from hard coding and stored in files or specific storage media (such as in a database) in the form of rule scripts, so that changes to business rules can take effect immediately in the online environment without modifying the project code or restarting the server.
[0040] In the above, the rule designer has:
[0041] Rule generation module;
[0042] A receiving unit, used for receiving input data;
[0043] An analysis unit, configured to analyze the type of data and the corresponding business scenario based on the input data,
[0044] The rule configuration unit is used to load the rule storage warehouse and search for standardized business rules in the rule storage warehouse according to the data type and business scenario obtained by the analysis unit. If a corresponding standardized business rule is matched, the standard business rule is used as the business rule of the input data, and a corresponding mapping is established between the input data and the business rule. If a match is found, the process is transferred to the rule generation module.
[0045] The rule generation module loads the rule engine according to the data type and business scenario of the input data, calls the business rule table and natural language rule setting package corresponding to the business scenario and data type in the rule engine, and configures the corresponding business rules with the business rule table and natural language rule setting package;
[0046] The constraint configuration unit is used to configure the constraint conditions of the business rules according to the business scenarios corresponding to the business rules.
[0047] In the above, the rule engine uses the Drools rule engine or the BMS platform.
[0048] Formulate rule processing logic for different business logics according to business scenarios and standardized rules. For example, common rules: document coding rules; order categories (called by order document type): wave grouping rules, order consolidation rules, warehouse picking rules, share order splitting rules, and transportation mode dispatching rules; dispatch categories (called by waybill or dispatch document type): order issuing rules (bidding docking, appointment queue docking, etc.), order acceptance rules, loading and distributing rules, vehicle dispatching and dispatching rules, etc.
[0049] In the above, the constraint condition is used to limit the application scope of the business rule.
[0050] In the above, the rule script has semantic processing functions set for data types and business scenarios. Therefore, users do not need to understand programming languages, and can describe rules in Chinese according to agreed standard terms, and the rule engine automatically parses the rules in natural language.
[0051] In the above, the standardized rules are used to select matching processing functions according to business scenarios. The standardized rules have a rule set consisting of a number of standard rules set according to the constraints in the rule script. Further, at least one standard rule is matched in the rule set according to the business scenario, and each standard rule corresponds to a fixed processing function. Further, when two or more standard rules are matched in the rule set according to the business scenario, the control logic between the standard rules is first set according to the usage requirements of the business scenario, and the logical relationship between the matched processing functions is set through the control logic. Further, the simulation interaction platform has simulation interaction verification according to a single rule script, and also has simulation interaction verification based on multiple rule scripts based on EXCEL forms.
[0052] The simulation verification is explained through the following specific examples.
[0053] In some embodiments, the fee rules are initialized before the simulation interaction platform is officially put into operation. The business data parsed by the simulation interaction platform message is charged according to the matching fee rules and the billing conditions to generate billing task data. Among them, the fee rule list includes: serial number, operation, status, fee rule code, fee item code, fee item name, billing document business type, fee rule description, creator, creation time, modifier, and modification time. Operations include: view, modify, delete, enable / disable. By experiencing the simulation running status of the above-mentioned units, it can be checked whether there is an error execution.
[0054] In some embodiments, the quotation strategy is initialized before the simulation interaction platform is officially run. The billing task generates billing flow data according to the matching quotation strategy. The corresponding display list includes: serial number, operation, status, cost rule code, cost item code, cost item name, billing document business type, cost rule description, creator, creation time, modifier, modification time. Operations include: view, modify, delete, enable / disable. By experiencing the simulation running status of the above-mentioned units, it can be checked whether there is an error execution.
[0055] According to different business scenarios, when inputting data, the present application constructs business rules and corresponding constraints for different data types and business scenarios, writes the business rules for setting constraints into the rule script, loads the function library according to the business scenario and standardized rules to match the corresponding processing function, sets the rule processing logic of different business logics through the processing function, and loads the rule script to the simulation interaction platform through the rule execution engine for simulation interaction verification, so as to obtain the rule script that meets the needs of different business scenarios. The complex and changeable business rules can be freed from hard coding and stored in files or specific storage media (such as in a database) in the form of rule scripts, so that changes to business rules can take effect immediately in the online environment without modifying the project code or restarting the server.
[0056] This application can also effectively support business personnel's direct definition and maintenance of business logic through business logic definition, parsing, and execution, and through parsing support for natural language grammar, greatly simplifying system maintenance and development costs, improving system delivery efficiency while reducing delivery costs.
[0057] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. Supply chain design system based on rule engine, characterized by: include: A rule designer is provided, input data is received in the rule designer, business rules are established according to the received input data, and constraint conditions are set for the established business rules by the rule designer; A rule generator, connected to the rule designer, is used to write the business rules that set the constraint conditions into the rule script, and store the rule script in the database; A rule logic generator, connected to the rule generator, is used to set the rule processing logic of different business logics according to business scenarios and standardized rules, link the rule processing logic into the rule script, and correspondingly apply the database storing the rule script to the corresponding business scenario; The rule designer has: Rule generation module; A receiving unit, used for receiving input data; An analysis unit, configured to analyze the type of data and the corresponding business scenario based on the input data, The rule configuration unit is used to load the rule storage warehouse and search for standardized business rules in the rule storage warehouse according to the data type and business scenario obtained by the analysis unit. If a corresponding standardized business rule is matched, the standard business rule is used as the business rule of the input data, and a corresponding mapping is established between the input data and the business rule. If no match is found, the rule generation module is transferred to the rule generation module. The rule generation module loads the rule engine according to the data type and business scenario of the input data, calls the business rule table and natural language rule setting package corresponding to the business scenario and data type in the rule engine, and configures the corresponding business rules with the business rule table and natural language rule setting package; A constraint configuration unit, used to configure the constraint conditions of the business rules according to the business scenarios corresponding to the business rules; The rule logic generator has: The rule logic generation unit loads the function library according to the business scenario and standardized rules to match the corresponding processing function, and sets the rule processing logic of different business logics through the processing function; A verification unit is used to link the rule processing logic into the corresponding rule script, load the rule script into the simulation interaction platform through the rule execution engine for simulation interaction verification, store the rule script in the database when there are no errors in the verification, and apply the database to the corresponding business scenario.
2. The supply chain design system based on rule engine according to claim 1, characterized in that: The constraint condition is used to limit the application scope of the business rule.
3. The supply chain design system based on rule engine according to claim 1, characterized in that: The rule script has semantic processing functions set for data types and business scenarios.
4. The supply chain design system based on rule engine according to claim 1, characterized in that: The standardized rules are used to select matching processing functions according to business scenarios.
5. The supply chain design system based on rule engine according to claim 1, characterized in that: The standardized rules include a rule set consisting of a number of standard rules set according to the constraint conditions in the rule script.
6. The supply chain design system based on rule engine according to claim 5, characterized in that: At least one standard rule is matched in the rule set according to the business scenario, and each standard rule corresponds to a fixed processing function.
7. The supply chain design system based on rule engine according to claim 5 or 6, characterized in that: When two or more standard rules are matched in the rule set according to the business scenario, the control logic between the standard rules is first set according to the usage requirements of the business scenario, and the logical relationship between the matched processing functions is set through the control logic.
8. The supply chain design system based on rule engine according to claim 1, characterized in that: The simulation interaction platform has the function of performing simulation interaction verification according to a single rule script, and also has the function of performing simulation interaction verification based on multiple rule scripts in an EXCEL form.
