Rule engine configuration method, routing recommendation method, device, equipment and medium
Patent Information
- Application Number
- CN202611161104.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-16
AI Technical Summary
然而现有技术采用硬编码数值嵌入、嵌套条件判断的通用化策略,导致规则变更响应周期长、代码变更引入质量风险、准入评估过于粗糙、利率优惠规则扩展困难,限制了业务响应速度、系统可维护性与规则扩展灵活性
[0011]This disclosure provides a rule engine configuration method, apparatus, device, and storage medium. In response to a rule configuration request, this application generates a rule configuration file for a target object, containing basic product information, access rules, and calculation rules. The access rules configure access thresholds and deduction weights to implement a multi-condition weighted scoring mechanism. The calculation rules configure rule conditions and corresponding calculation ranges in the form of conditional expression strings to achieve dynamic and flexible calculation. This completely externalizes business rules into a structured configuration file, thoroughly decoupling rule definition from execution logic. Next, by storing the rule configuration file in a configuration directory and calling a configuration loader to parse it into a memory dictionary object with object encoding as the key, it stores the object in the rule registry, establishing a centralized rule index and efficient query mechanism, achieving unified management of multi-object rules. A hot-reloading interface is also provided, triggering a reload when the configuration is updated and replacing the original object with the updated memory dictionary object, enabling rule changes to take effect immediately without service interruption. Finally, in response to the rule execution request, the system queries the currently effective configuration from the rule registry. Based on the rule parameters such as the admission threshold, deduction weight, and conditional expression string, it dynamically calculates rules for the target object data and outputs the rule calculation results used for business strategies. This ensures that the execution layer can dynamically read and flexibly adapt all business values at runtime. Therefore, this application, through a collaborative mechanism of structured configuration file definition, centralized memory registry management, and hot-loading dynamic updates, achieves the technical effects of rule maintenance without modifying the source code, immediate effect of configuration changes, and independent operation by non-technical personnel, significantly improving the flexibility, response efficiency, and maintainability of the rule engine.
Smart Images

Figure CN122924830A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the intersection of financial technology and computer software technology, specifically to the field of rule engine technology, and in particular to rule engine configuration methods, routing recommendation methods, devices, equipment and media. Background Technology
[0002] In the field of intelligent routing and recommendation for corporate financial products, existing technologies mainly employ two methods to manage business rules: hard-coding in source code or configuration in database tables. Hard-coding in source code directly writes admission thresholds, interest rate values, and weight constants into conditional statements in literal form, resulting in independent code modules for each product and a large amount of repetitive structural code. While database table configuration stores some thresholds in the database, the logical relationships between rules, the weight system, and the dynamic calculation of conditional expressions still need to be hard-coded in the source code.
[0003] However, applying existing technologies to enterprise financial product rule management scenarios still faces significant limitations. Financial product business rules are frequently adjusted due to market conditions and regulatory policies, exhibiting characteristics of "high-frequency changes, strong demand for differentiated configurations, and complex expansion conditions." Specifically, admission criteria need to support multi-condition weighted scoring to distinguish between "fully satisfied" and "slightly unsatisfied," and interest rate discounts need to support automatic calculation of multiple conditions. However, existing technologies employ a generalized strategy of hard-coded numerical embedding and nested condition judgments, resulting in long rule change response cycles, quality risks introduced by code changes, overly coarse admission assessments, and difficulties in expanding interest rate discount rules. This limits business response speed, system maintainability, and rule expansion flexibility. Summary of the Invention
[0004] This disclosure provides a rule engine configuration method, a route recommendation method, an apparatus, a device, and a medium.
[0005] According to one aspect of this disclosure, a method for configuring a rules engine is provided, the method comprising: In response to a rule configuration request, a rule configuration file is generated for the target object. The rule configuration file includes basic product information, access rules, and calculation rules. The basic product information configures the object code, the access rules configure the access threshold and deduction weight, and the calculation rules configure the rule conditions and corresponding calculation range in the form of conditional expression strings. The rule configuration file is stored in the configuration directory. The configuration loader is called to parse the rule configuration file in the configuration directory into a memory dictionary object. The object code in the memory dictionary object is extracted. The memory dictionary object is stored in the rule registry with the object code as the key. A hot reloading interface is provided. In response to a rule execution request, the system queries the memory dictionary object corresponding to the target object code from the rule registry as the current effective configuration, performs rule calculations on the target object data based on the rule parameters in the current effective configuration, and outputs the rule calculation results, which are used for business strategies. In response to a configuration update request, the hot-load interface is invoked, and the configuration loader is triggered to reload the rule configuration file in the configuration directory through the hot-load interface, so as to replace the original memory dictionary object in the rule registry with the updated memory dictionary object.
[0006] According to another aspect of this disclosure, a rules engine configuration apparatus is provided, comprising: The configuration file module is used to generate a rule configuration file for the target object in response to a rule configuration request. The rule configuration file includes basic product information, admission rules, and calculation rules. The basic product information configures the object code, the admission rules configure the admission threshold and deduction weight, and the calculation rules configure the rule conditions and corresponding calculation range in the form of conditional expression strings. The configuration loading module is used to store the rule configuration file to the configuration directory, call the configuration loader to parse the rule configuration file in the configuration directory into a memory dictionary object, extract the object code in the memory dictionary object, store the memory dictionary object into the rule registry with the object code as the key, and provide a hot loading interface. The rule execution module is used to respond to a rule execution request, query the memory dictionary object corresponding to the target object code from the rule registry as the current effective configuration, perform rule calculation on the target object data based on the rule parameters in the current effective configuration, and output the rule calculation result, which is used for business strategies. The update module is used to respond to a configuration update request by calling the hot-load interface, which triggers the configuration loader to reload the rule configuration file in the configuration directory, and replaces the original memory dictionary object in the rule registry with the updated memory dictionary object.
[0007] According to a third aspect of this disclosure, a business object routing recommendation method is provided, the method further comprising: Receive user business consultation requests and extract the business demand quota from the natural language description of the user business consultation request to obtain the target business quota; The multidimensional data of the target business object is queried to obtain the target object data, which includes basic attribute information, person in charge information, business status information, credit record information and transaction statistics information; Using the target object data and the target business quota as input, the rule engine configuration method described above is used to obtain the rule calculation results for each object; Based on the target business quota and the rule calculation results of each object, a multi-dimensional comprehensive scoring and ranking is performed to obtain a recommended object sequence; The large language model is invoked to generate recommendation reason text based on the recommended object sequence, and the recommended object sequence, the rating details of each object, and the recommendation reason text are returned in the form of structured data.
[0008] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described in any of the above technical solutions.
[0009] According to a fifth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any one of the methods described above.
[0010] According to a sixth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the above technical solutions.
[0011] This disclosure provides a rule engine configuration method, apparatus, device, and storage medium. In response to a rule configuration request, this application generates a rule configuration file for a target object, containing basic product information, access rules, and calculation rules. The access rules configure access thresholds and deduction weights to implement a multi-condition weighted scoring mechanism. The calculation rules configure rule conditions and corresponding calculation ranges in the form of conditional expression strings to achieve dynamic and flexible calculation. This completely externalizes business rules into a structured configuration file, thoroughly decoupling rule definition from execution logic. Next, by storing the rule configuration file in a configuration directory and calling a configuration loader to parse it into a memory dictionary object with object encoding as the key, it stores the object in the rule registry, establishing a centralized rule index and efficient query mechanism, achieving unified management of multi-object rules. A hot-reloading interface is also provided, triggering a reload when the configuration is updated and replacing the original object with the updated memory dictionary object, enabling rule changes to take effect immediately without service interruption. Finally, in response to the rule execution request, the system queries the currently effective configuration from the rule registry. Based on the rule parameters such as the admission threshold, deduction weight, and conditional expression string, it dynamically calculates rules for the target object data and outputs the rule calculation results used for business strategies. This ensures that the execution layer can dynamically read and flexibly adapt all business values at runtime. Therefore, this application, through a collaborative mechanism of structured configuration file definition, centralized memory registry management, and hot-loading dynamic updates, achieves the technical effects of rule maintenance without modifying the source code, immediate effect of configuration changes, and independent operation by non-technical personnel, significantly improving the flexibility, response efficiency, and maintainability of the rule engine.
[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0013] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a schematic diagram of the steps of a rule engine configuration method in one embodiment of this disclosure; Figure 2 This is a schematic diagram of the execution of dynamic weighted scoring of admission rules in one embodiment of this disclosure; Figure 3 This is a schematic diagram of the dynamic calculation process of the interest rate discount condition expression in one embodiment of this disclosure; Figure 4 This is a flowchart illustrating the configuration loader in one embodiment of this disclosure; Figure 5 This is a schematic diagram of the overall process of a business object routing recommendation method in one embodiment of this disclosure; Figure 6 This is a schematic block diagram of the rule engine configuration device in the embodiments of this disclosure; Figure 7 This is a block diagram of an electronic device used to implement the rule engine configuration method of the embodiments of this disclosure. Detailed Implementation
[0014] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0015] This disclosure provides a method for configuring a rules engine; see [link to relevant documentation]. Figure 1 As shown, the method includes: Step S101: In response to the rule configuration request, generate a rule configuration file for the target object. The rule configuration file includes product basic information, admission rules and calculation rules. The product basic information configures the object code, the admission rules configure the admission threshold and deduction weight, and the calculation rules configure the rule conditions and corresponding calculation range in the form of condition expression strings.
[0016] Specifically, by responding to rule configuration requests, a YAML-formatted rule configuration file is generated for the target object, thus externalizing the definition of business rules. The product basic information describes the basic attributes of the target object, and the configured object code serves as a unique identifier for system recognition. Admission rules are used to set admission conditions for the target object, configuring admission thresholds as the judgment benchmark values for each condition, and configuring deduction weights as the points deducted from the initial score when conditions are not met; these two work together to implement a weighted scoring mechanism. Calculation rules are used to dynamically adjust calculation results. Rule conditions are configured in the form of conditional expression strings, that is, storing dynamically parsed and executable logical judgment statements in string form, and configuring the corresponding calculation range as the adjustment value when the condition is met.
[0017] This application uses financial products as an example to illustrate its solution. The specific implementation process includes: First, receiving a rule configuration request, reading the target object's basic product information from the request parameters, extracting the object code, product name, name of the cooperating financial institution, maximum credit limit, benchmark interest rate, maximum loan term, and repayment method list, and generating a product basic information block. Second, reading the target object's access rule parameters, extracting access condition thresholds such as the lower limit of cooperation period, the lower and upper limits of the legal representative's age, the upper limit of the number of credit default records in the past N years, the upper limit of the number of high-consumption restriction records in the past N years, whether private lending disputes are allowed, and a list of allowed enterprise operating status values, as well as the deduction weights corresponding to each access condition threshold and the minimum score required for access, and generating an access rule block. Then, reading the target object's calculation rule parameters, extracting the interest rate discount condition expression string and the corresponding discount amount, and the bonus condition expression string and the corresponding bonus value, and generating a calculation rule block. Finally, combining the product basic information block, access rule block, and calculation rule block to obtain a rule configuration file, thereby enabling business rules to exist independently of the executable code in a structured manner, providing a standardized configuration foundation for subsequent runtime dynamic loading and hot updates.
[0018] Step S102: Store the rule configuration file in the configuration directory, call the configuration loader to parse the rule configuration file in the configuration directory into a memory dictionary object, extract the object code in the memory dictionary object, store the memory dictionary object into the rule registry with the object code as the key, and provide a hot reloading interface.
[0019] Specifically, persistent management and centralized maintenance of rule data are achieved by storing rule configuration files in a configuration directory. The configuration directory is a specified file storage path within the system, used to centrally store all rule configuration files for unified management. The configuration loader is a functional module responsible for reading, parsing, and instantiating configuration files. It scans the rule configuration files in the configuration directory, parsing them into in-memory dictionary objects—data structures stored in memory as key-value pairs for efficient runtime access and dynamic retrieval. After parsing, the object code in the in-memory dictionary object is extracted as a unique identifier. Using this object code as the key, the corresponding in-memory dictionary object is stored in the rule registry, establishing a mapping index table between object codes and rule configurations, supporting fast querying and retrieval based on object codes. Simultaneously, a hot-reload interface is provided—a trigger interface for external calls—to reload the rule configuration files in the configuration directory when rule configurations are updated. The updated in-memory dictionary objects replace the original objects in the rule registry, enabling immediate effect of rule changes without requiring a service restart.
[0020] The specific implementation process of this scheme includes: First, storing the generated rule configuration files in a specified format to the configuration directory to ensure that the files can be recognized and read by the configuration loader. Second, calling the configuration loader, receiving the configuration directory path as an initialization parameter, and scanning all rule configuration files in the directory that meet the suffix requirements. Then, reading each rule configuration file one by one, parsing its content into memory dictionary objects, and extracting the object encoding field from each memory dictionary object. Next, using the object encoding as the key, storing the parsed memory dictionary objects into the rule registry to establish a complete rule index structure. Finally, after initialization, recording the loading log and providing a hot-reloading interface, allowing the configuration loader to re-execute the above scanning, parsing, and storage process during system operation by calling this interface, atomically replacing the original memory dictionary objects in the rule registry with the updated memory dictionary objects, and the replacement process does not interrupt concurrent requests being processed.
[0021] Step S103: In response to the rule execution request, query the memory dictionary object corresponding to the target object code from the rule registry as the current effective configuration, perform rule calculation on the target object data based on the rule parameters in the current effective configuration, and output the rule calculation result. The rule calculation result is used for business strategies.
[0022] Specifically, the rule calculation process is triggered in response to rule execution requests, enabling dynamic execution and real-time evaluation of business rules. The rule execution request is a call request initiated by an external system or user, carrying the target object code and target object data. The rule registry is an in-memory index structure built by the configuration loader, storing corresponding in-memory dictionary objects with object codes as keys, supporting fast lookups. The in-memory dictionary object corresponding to the target object code is retrieved from the rule registry and used as the currently effective configuration, i.e., the set of effective rule parameters upon which this rule calculation is based. Subsequently, rule calculations are performed on the target object data based on the rule parameters in the currently effective configuration. Rule parameters include the admission threshold, deduction weight, conditional expression string, and calculation range. The target object data is the actual attribute values of the object to be evaluated. During calculation, each rule parameter is read sequentially, the target object data is compared with the admission threshold to perform a weighted score, the conditional expression string is dynamically evaluated to adjust the range, and finally, the rule calculation result is output, i.e., structured data containing the score result, adjustment result, and final score. This rule calculation result is used for business strategies, i.e., as the basis for subsequent business decisions, such as admission determination, priority ranking, or parameter pricing.
[0023] The specific implementation process of this scheme includes: First, receiving a rule execution request and extracting the target object code and target object data from the request parameters. The target object data includes basic enterprise information, responsible person information, operating status information, credit record information, and transaction statistics. Second, using the target object code as the query key, retrieving the corresponding memory dictionary object from the rule registry and loading it as the currently effective configuration. Then, reading the admission rule block from the currently effective configuration, extracting the admission threshold and deduction weight for each admission condition, initializing the score to full, and comparing the actual parameter values in the target object data with the admission thresholds. If the condition is not met, deducting the corresponding weight and recording the reason for rejection, and obtaining the score result after traversing all admission conditions. Next, reading the calculation rule block from the currently effective configuration, extracting the condition expression string and the corresponding calculation range, constructing a restricted execution context that only injects predefined variables, and dynamically evaluating each condition expression string. If the condition is met, accumulating the calculation range to the baseline parameter to obtain the adjustment result. Finally, fusing the score result and the adjustment result, outputting the rule calculation result containing the admission judgment, final score, and parameter adjustment value for subsequent decision processing by the business strategy module.
[0024] In step S104, in response to the configuration update request, the hot reload interface is called to trigger the configuration loader to reload the rule configuration file in the configuration directory, and replace the original memory dictionary pair in the rule registry with the updated memory dictionary object.
[0025] Specifically, by responding to configuration update requests to trigger dynamic updates of rule configurations, business rules achieve immediate effectiveness and zero-downtime maintenance. The configuration update request is an update trigger request initiated by business personnel to the system after modifying the rule configuration file, used to notify the system that the rule content has changed. The hot-reload interface is a call interface provided by the system to receive configuration update requests and initiate a reload process, enabling configuration updates to take effect without restarting the service. After calling the hot-reload interface, the configuration loader is triggered to rescan the configuration directory, read the updated rule configuration files in the directory, and re-parse them into updated in-memory dictionary objects, i.e., in-memory data structures reflecting the latest rule content. Subsequently, the updated in-memory dictionary objects replace the original in-memory dictionary objects in the rule registry, updating the mapping relationship between object encoding and rule configuration, allowing subsequent rule execution requests to directly read the updated rule parameters.
[0026] The specific implementation process of this solution includes: First, business personnel modify the rule configuration files in the configuration directory and then send a configuration update request to the system. Second, the system receives the configuration update request, calls the hot-reload interface, and sends a reload instruction to the configuration loader through this interface. Then, after receiving the instruction, the configuration loader clears all memory dictionary objects in the current rule registry, resulting in an empty registry. Next, it rescans the configuration directory, enumerates all rule configuration files, parses each rule configuration file into an updated memory dictionary object, and extracts the object code from each updated memory dictionary object. Then, using the object code as the key, it stores each updated memory dictionary object into the empty registry, resulting in the updated rule registry. Finally, the updated rule registry is atomically replaced with the currently effective rule registry, so that the updated memory dictionary objects take effect immediately for subsequent rule execution requests, and the entire replacement process is completed within a single function call without interrupting concurrent requests being processed.
[0027] This disclosure provides a rule engine configuration method, apparatus, device, and storage medium. In response to a rule configuration request, this application generates a rule configuration file for a target object, containing basic product information, access rules, and calculation rules. The access rules configure access thresholds and deduction weights to implement a multi-condition weighted scoring mechanism. The calculation rules configure rule conditions and corresponding calculation ranges in the form of conditional expression strings to achieve dynamic and flexible calculation. This completely externalizes business rules into a structured configuration file, thoroughly decoupling rule definition from execution logic. Next, by storing the rule configuration file in a configuration directory and calling a configuration loader to parse it into a memory dictionary object with object encoding as the key, it stores the object in the rule registry, establishing a centralized rule index and efficient query mechanism, achieving unified management of multi-object rules. A hot-reloading interface is also provided, triggering a reload when the configuration is updated and replacing the original object with the updated memory dictionary object, enabling rule changes to take effect immediately without service interruption. Finally, in response to the rule execution request, the system queries the currently effective configuration from the rule registry. Based on the rule parameters such as the admission threshold, deduction weight, and conditional expression string, it dynamically calculates rules for the target object data and outputs the rule calculation results used for business strategies. This ensures that the execution layer can dynamically read and flexibly adapt all business values at runtime. Therefore, this application, through a collaborative mechanism of structured configuration file definition, centralized memory registry management, and hot-loading dynamic updates, achieves the technical effects of rule maintenance without modifying the source code, immediate effect of configuration changes, and independent operation by non-technical personnel, significantly improving the flexibility, response efficiency, and maintainability of the rule engine.
[0028] In some optional embodiments, in response to a rule configuration request, a rule configuration file is generated for the target object, including: Read the target object's basic product information, extract the object code, product name, name of cooperating financial institution, maximum credit limit, benchmark interest rate, longest loan term and repayment method list, and generate a product basic information block; Read the admission rule parameters of the target object, extract the admission condition threshold, the deduction weight corresponding to the admission condition threshold, and the admission pass score line, and generate an admission rule block; Read the calculation rule parameters of the target object, extract the condition expression string and the corresponding calculation range of the condition expression string, and generate a calculation rule block; Combine the product basic information block, the access rule block, and the calculation rule block to obtain the rule configuration file.
[0029] Specifically, by reading and organizing the multi-dimensional parameters of the target object into blocks, a structured rule configuration file is generated to achieve standardized definition and modular configuration of business rules. The product basic information block describes the static attributes of the financial product, including the object code as a unique system identifier, the product name for business display, the name of the cooperating financial institution indicating the source of funds, the maximum credit limit limiting the maximum loanable amount, the benchmark interest rate as the initial benchmark value for interest rate calculation, the maximum loan term constraining the financing cycle, and a repayment method list enumerating the available repayment modes. The admission rule block sets the evaluation criteria for enterprise admission, including admission condition thresholds as the judgment benchmark values for each condition, deduction weights as the points deducted from the initial score when conditions are not met, and the admission passing score line as the minimum score line for determining eligibility for admission; these three elements work together to achieve a weighted scoring mechanism. The calculation rule block dynamically adjusts the calculation results, including conditional expression strings (logical judgment statements stored in string form that can be dynamically parsed and executed) and calculation ranges as adjustment values when conditions are met.
[0030] The specific implementation process of this solution includes: First, reading the target object's basic product information, extracting the object code, product name, name of the cooperating financial institution, maximum credit limit, benchmark interest rate, longest loan term, and repayment method list from the business system or configuration interface, and organizing them into a basic product information block by field. Second, reading the target object's admission rule parameters, extracting the threshold values for each admission condition from the rule design interface or database, such as the lower limit for cooperation period, the lower and upper limits for the responsible person's age, the upper limit for the number of credit records in the past N years, and the deduction weights corresponding to each admission condition threshold and the minimum score required for admission, and organizing them into an admission rule block by condition items. Then, reading the target object's calculation rule parameters, extracting the interest rate discount condition expression string and the corresponding discount amount, and the bonus condition expression string and the corresponding bonus value from the rule design interface, and organizing them into a calculation rule block by expression items. Finally, combining the basic product information block, admission rule block, and calculation rule block according to a preset structure, serializing them into a rule configuration file, so that the business rules exist independently of the executable code in a modular and structured manner, providing a standardized configuration foundation for the subsequent parsing and hot loading of the configuration loader.
[0031] In this way, by reading the basic product information of the target object and extracting the object code, product name, name of the cooperating financial institution, maximum credit limit, benchmark interest rate, maximum loan term, and repayment method list to generate a product basic information block, the static attributes of financial products are centrally defined in a structured manner, facilitating the system's unified identification and management of different product instances. By reading the admission rule parameters and extracting the admission condition threshold, deduction weight, and admission scoring line to generate an admission rule block, the judgment criteria and importance of each admission condition are quantified into configurable parameters, achieving a refined evaluation upgrade from binary judgment to weighted scoring. By reading the calculation rule parameters and extracting the condition expression string and calculation range to generate a calculation rule block, the dynamic calculation logic is stored in a parsable string format, supporting flexible configuration and dynamic execution at runtime for arbitrarily complex conditions. Finally, by combining the three into a rule configuration file, the product attributes, admission evaluation, and dynamic calculation are layered, decoupled, and modularly organized. As can be seen, this solution, through the segmented and structured definition of product basic information blocks, access rule blocks, and calculation rule blocks, enables business personnel to complete product parameter adjustments, access standard changes, and calculation rule expansions simply by editing configuration files, without having to touch the execution code. This significantly reduces the technical threshold and response cycle for rule maintenance, while ensuring that each module does not interfere with each other during independent iteration, thus improving the system's maintainability and business adaptability.
[0032] In some optional embodiments, rule calculations are performed on the target object data based on the rule parameters in the currently effective configuration, and the rule calculation results are output, including: Based on the admission threshold, deduction weight and admission pass score line in the current effective configuration, the admission score is calculated on the target object data to obtain the admission result and the score result. Based on the conditional expression string and corresponding calculation range in the current effective configuration, the target object data is dynamically evaluated to obtain the parameter adjustment result; Based on the scoring condition expression string and the corresponding scoring value in the current effective configuration, the target object data is scored, and the scoring value is accumulated into the scoring result to obtain the final scoring result. The admission results, parameter adjustment results, and final score results are output as the rule calculation results.
[0033] Specifically, rule execution is achieved through three progressively layered calculations, organically combining admission assessment, parameter adjustment, and quality incentives. The admission score calculation is a weighted evaluation of target data based on admission thresholds, deduction weights, and admission passing score lines. The admission threshold is the benchmark value for each condition, the deduction weight is the score deducted when a condition is not met, and the admission passing score line is the minimum passing score. These three elements work together to upgrade from binary judgment to refined scoring. The dynamic evaluation calculation is a real-time parsing and calculation of target data based on conditional expression strings and calculation ranges. The conditional expression string is an executable logical judgment statement stored as a string, and the calculation range is the adjustment value when the condition is met. These two elements work together to dynamically adjust parameters. The bonus calculation is a quality incentive evaluation of target data based on bonus conditional expression strings and bonus values. The bonus conditional expression string is an executable logical statement for judging quality attributes, and the bonus value is the additional reward score when the condition is met. These two elements work together to achieve positive correction of the score.
[0034] The specific implementation process of this scheme includes: First, reading the admission rule block from the currently effective configuration, extracting the admission threshold, deduction weight, and admission pass score line for each admission condition, initializing the score to full marks, comparing the actual parameter values in the target object data with the admission thresholds sequentially, deducting the corresponding weights and recording the rejection reasons when the conditions are not met, and after traversing all admission conditions, determining whether the current score is not lower than the admission pass score line and whether the rejection reason list is empty, and outputting the admission result and score result. Second, reading the interest rate discount rule from the calculation rule block from the currently effective configuration, extracting the condition expression string and the corresponding calculation range, constructing a restricted execution context that only injects predefined variables, dynamically evaluating each condition expression string sequentially, accumulating the calculation range to the benchmark interest rate when the conditions are met, and constraining the final result with the interest rate lower limit protection value, and outputting the parameter adjustment result. Then, reading the bonus rule from the calculation rule block from the currently effective configuration, extracting the bonus condition expression string and the corresponding bonus value, reusing the above restricted execution context to dynamically evaluate sequentially, accumulating the bonus value to the score result when the conditions are met, and obtaining the final score result. Finally, the admission results, parameter adjustment results, and final score results are combined and output as rule calculation results for use by the business strategy module.
[0035] In this way, by calculating the admission score for target object data based on the admission threshold, deduction weight, and admission scoring line in the current effective configuration, the binary judgment of a single condition is upgraded to a multi-condition weighted quantitative evaluation. This allows the admission results to distinguish between three states: "fully satisfied," "partially satisfied," and "not satisfied," making the scoring results closer to actual business needs. Dynamic evaluation based on conditional expression strings and their corresponding calculation ranges allows parameter adjustment logic to be dynamically executed at runtime in parsable string form. Adding or modifying adjustment conditions only requires editing the configuration file without modifying the source code, significantly improving the flexibility and scalability of parameter pricing. By calculating and accumulating bonus points based on bonus conditional expression strings and their corresponding bonus values, high-performing objects receive additional positive incentives on top of the admission score, realizing a two-layer scoring mechanism of "basic assessment + high-performing incentives," distinguishing between ordinary qualified objects and high-performing objects. Finally, by outputting the admission results, parameter adjustment results, and final scoring results as rule calculation results, the business strategy module can simultaneously obtain three types of decision-making basis: admission judgment, parameter pricing, and comprehensive scoring, supporting multi-dimensional business strategy formulation. As can be seen, this solution achieves the technical effects of refined evaluation, dynamic pricing, and differentiated incentives through a three-layer progressive rule execution architecture of admission scoring, dynamic evaluation, and bonus calculation. It effectively overcomes the shortcomings of traditional hard-coded solutions, such as coarse evaluation, difficulty in expansion, and inability to distinguish between superior and inferior objects, and significantly improves the business adaptability and decision support capabilities of the rule engine.
[0036] In some optional embodiments, based on the admission threshold, deduction weight, and admission pass score line in the currently effective configuration, an admission score is calculated on the target object data to obtain the admission result and the score result, including: Read the admission pass score line from the currently active configuration to obtain the initial score value; Read the admission threshold and corresponding deduction weight of each admission condition from the currently effective configuration, and then obtain the actual parameter values corresponding to each admission condition from the target object data in sequence. The actual parameter value is compared with the corresponding admission threshold. If the actual parameter value does not meet the admission threshold, the corresponding deduction weight is deducted from the initial score value, and the description information of the failure to meet the admission condition is added to the rejection reason list to obtain the current score value and the updated rejection reason list. After traversing all admission criteria, determine whether the current score is not lower than the admission passing score threshold and whether the rejection reason list is empty. If so, output the admission passed score and the current score as the scoring result; otherwise, output the admission failed score, the current score, and the rejection reason list as the scoring result.
[0037] Specifically, the admission score calculation is achieved through a condition-by-condition comparison and weighted deduction mechanism, upgrading the admission assessment from a simple binary judgment to a refined quantitative assessment. The admission score line serves as the minimum score required for admission, acting as a benchmark for the score calculation. The admission threshold is the benchmark value for each admission condition, used for comparison with actual parameter values. The deduction weight is the score deducted from the initial score when a condition is not met, reflecting the relative importance of each condition. The actual parameter values are the specific attribute values of the object to be evaluated in the target object data. The rejection reason list records the specific descriptive information of not meeting the admission conditions, serving as the basis for admission rejection.
[0038] The specific implementation process of this scheme includes: First, reading the admission pass score line from the currently effective configuration and using it as the initial score value for score calculation, i.e., the full score benchmark. Second, reading the admission threshold and corresponding deduction weight for each admission condition from the currently effective configuration, and simultaneously obtaining the actual parameter values corresponding to each admission condition from the target object data, such as the length of cooperation, the age of the person in charge, and the number of records of dishonesty. Then, comparing each actual parameter value with the corresponding admission threshold one by one. If the actual parameter value does not meet the admission threshold, the deduction weight corresponding to the admission condition is deducted from the initial score value, and the description information of the non-compliance of the admission condition is added to the rejection reason list, such as "the length of cooperation is less than 2 years" or "the number of records of dishonesty in the past 2 years is greater than 0", to obtain the current score value and the updated rejection reason list. Next, traversing all admission conditions, repeating the above comparison, deduction and recording process, until all admission conditions have been processed. Finally, it checks whether the current score is not lower than the admission passing score threshold and whether the rejection reason list is empty. If both conditions are met, the system outputs "admission passed" and the current score as the scoring result. If neither condition is met, the system outputs "admission failed," the current score, and the rejection reason list as the scoring result, allowing the business strategy module to obtain both the score value and the specific reasons for failure.
[0039] For a better understanding of this scheme, see [link / reference]. Figure 2 , Figure 2 This is a flowchart illustrating the execution of dynamic weighted scoring of admission rules in one embodiment of this disclosure. The flowchart shows the entire process from data input to admission determination as follows: In the data input stage, the currently effective configuration includes: enterprise comprehensive data (enterprise_data), which includes basic enterprise information, responsible person information, operating status information, credit record information, and transaction statistics information. The product configuration dictionary (config), an in-memory dictionary object parsed from the YAML configuration file, stores all business rule parameters for the product. Next, the initial scoring stage begins, where the system initializes the current score to 100 points, serving as the starting point for weighted scoring calculation. Then comes the rule-by-rule dynamic checking stage, where the system enters a rule-by-rule dynamic checking phase. The core feature of this phase is that all thresholds and weights are dynamically read from the configuration dictionary, and the execution code itself does not contain any business numerical literals. The specific checking steps are as follows: Read thresholds and weights from the config: Dynamically extract the admission thresholds and corresponding deduction weights from the configuration dictionary, such as the minimum cooperation period (cooperation_years_min), the cooperation period weight (cooperation_years_weight), the minimum / maximum age of the person in charge (legal_age_min / max), and the weight of dishonesty records (dishonesty_weight).
[0040] Obtain the actual enterprise values from enterprise_data: Acquire the actual parameter values corresponding to the access conditions from the comprehensive enterprise data, such as the actual cooperation years, the actual age of the person in charge, the number of dishonesty records in the recent N years, etc.
[0041] Comparison and point deduction: Compare the actual values with the access thresholds. If an actual value is less than the threshold, deduct the corresponding weight score from the current rating, and record the reason for failure. For example, if the actual cooperation years is 1 year, which is lower than the threshold of 2 years, 30 points will be deducted from the rating, and the failure reason "insufficient cooperation years" will be recorded at the same time.
[0042] This process traverses all access conditions in sequence until all conditions are checked.
[0043] Next, enter the bonus point rule execution phase. After the dynamic check of each rule is completed, the system executes the bonus point rule (expression), dynamically evaluates the comprehensive enterprise data based on the bonus point condition expression string, and accumulates the corresponding bonus point value to the current rating when the condition is satisfied, so as to realize positive incentives for high-quality enterprises.
[0044] In the pass score judgment phase, the system reads pass_score (pass score line) from the configuration dictionary, and this value also comes from the configuration file instead of being hard-coded. Then, the system judges whether the current rating is greater than or equal to the pass score line: If the rating ≥ pass_score: it is determined that the access is passed, and the enterprise meets the access conditions of the product. If the rating < pass_score: it is determined that the access is not passed, and the enterprise fails to meet the access standard of the product.
[0045] This flowchart presents the complete chain of "data input → initial rating → dynamic check item by item (read threshold / actual value / compare and deduct points) → bonus point rule execution → read pass score line → judge pass or fail". Its core innovation lies in that all thresholds, weights and pass score lines are dynamically read from the YAML configuration file, and the execution code does not contain any business value literals, so that the threshold adjustment, weight modification and pass score line change of the access conditions can be completed only by editing the configuration file, without modifying the source code or redeploying the service, which significantly improves the flexibility and response efficiency of rule maintenance.
[0046] In this way, by reading the admission pass score line from the currently effective configuration as the initial score value, a quantitative scoring benchmark is established, providing a unified starting point for admission assessment. By reading the admission threshold and corresponding deduction weights for each admission condition, and comparing them with the actual parameter values obtained from the target object data, independent evaluation and differentiated deductions for multiple conditions are achieved. The weights of each condition can be flexibly configured according to business needs, and different products can set different levels of importance for the same type of condition. By deducting the corresponding deduction weights and adding non-compliance descriptions to the rejection reason list when the actual parameter value does not meet the admission threshold, the scoring process is made transparent and traceable, with each deduction having clear conditions and textual explanations. By traversing all admission conditions and determining whether the current score value is not lower than the admission pass score line and whether the rejection reason list is empty, a dual judgment mechanism of "quantitative scoring + hard rejection" is implemented. This allows for compensation with high scores when some conditions are slightly unmet, while ensuring that key rejection items directly block admission, avoiding blind spots in risk control that may arise from a single score line. Ultimately, by outputting separate lists of approved and scored results or rejected results, along with a list of reasons for rejection, the business strategy module can simultaneously obtain both the score and the specific reasons, supporting differentiated subsequent processing. Therefore, this solution, through a collaborative mechanism of initial scoring, condition-by-condition comparison, weighted deduction, and dual judgment, achieves refined, transparent, and risk-controllable access assessment. It effectively overcomes the shortcomings of traditional Boolean judgment schemes, such as coarse assessments, inability to distinguish the degree of non-compliance, and lack of traceability, significantly improving the scientific rigor and business adaptability of access decisions.
[0047] In some optional embodiments, the target object data is dynamically evaluated based on the conditional expression string and corresponding calculation range in the currently effective configuration to obtain the parameter adjustment result, including: Read the benchmark interest rate from the currently active configuration to obtain the initial calculated value; Extract predefined variable values from the target object data, construct an expression execution context, and inject the predefined variable values into the expression execution context. The predefined variable values include at least one of the following: cooperation period, annual purchase amount, and age of the person in charge. The expression execution context disables access to built-in functions. Read the conditional expression string and its corresponding calculation range from the currently active configuration, traverse each conditional expression string in turn, and dynamically evaluate it using the expression execution context as the namespace; If the evaluation result of the conditional expression string is true, the corresponding calculation range is added to the initial calculation value to obtain the current calculation value; If an exception occurs during the evaluation of the conditional expression string, skip the conditional expression string and continue the traversal; After traversing all conditional expression strings, the calculated lower limit protection value is read from the currently effective configuration. The current calculated value and the calculated lower limit protection value are then compared to obtain the parameter adjustment result.
[0048] Specifically, a restricted execution context is constructed to achieve secure dynamic evaluation of conditional expressions, isolating the execution of calculation rules from the system environment and ensuring operational security. The benchmark interest rate is the initial interest rate value configured in the product's basic information, serving as the starting point for parameter adjustments. Predefined variable values are whitelisted variables extracted from the target object data and allowed to be referenced in the expression, including at least one of the following: cooperation period, annual purchase amount, and the age of the responsible person, ensuring that the expression can only access authorized data. The expression execution context is the namespace environment during conditional expression evaluation. Disabling access to built-in functions prevents the expression from calling dangerous system functions, implementing a security sandbox mechanism. The conditional expression string is an executable logical judgment statement stored as a string, such as "cooperation_years>= 5"; the calculation range is the adjustment value to the initial calculated value when the condition is met, typically a negative value indicating a discount. The lower limit protection value is the minimum constraint value of the parameter adjustment result, preventing excessive discounts from causing the calculation result to fall below the business bottom line.
[0049] The specific implementation process of this scheme includes: First, reading the benchmark interest rate from the currently active configuration and assigning it to the initial calculated value as the benchmark for interest rate calculation. Second, extracting predefined variable values from the target object data, including the cooperation period, annual purchase amount, and the age of the person in charge, constructing an expression execution context, injecting the predefined variable values into this context, and simultaneously setting the built-in function access to an empty dictionary, disabling all system function calls, and retaining only whitelisted variables. Then, reading the conditional expression string and its corresponding calculation range from the currently active configuration, iterating through each conditional expression string sequentially, and dynamically evaluating it using the expression execution context as the namespace, i.e., calling the expression parsing engine to execute string-based logical judgments in a restricted environment. If the evaluation result of the conditional expression string is true, the corresponding calculation range is added to the initial calculated value and updated to the current calculated value. If an exception occurs during the evaluation process, such as a missing variable or a syntax error, the conditional expression string is skipped and the process continues to the next one, avoiding interruption of the overall calculation by a single exception. After traversing all conditional expression strings, the lower limit protection value is read from the currently effective configuration. The larger of the current calculated value and the lower limit protection value is taken as the final result to ensure that the parameter adjustment result is not lower than the preset lower limit. The parameter adjustment result is then obtained and output.
[0050] For a better understanding of the solution in this embodiment, please refer to... Figure 3 , Figure 3This is a flowchart illustrating the dynamic calculation of the interest rate discount condition expression in one embodiment of this disclosure. The entire processing flow from reading the benchmark interest rate to the final interest rate output is as follows: First, the base rate (base_rate) is read from the product configuration dictionary. This value originates from the interest_rate_base field in the product's basic information block and serves as the initial base value for rate calculation. A restricted execution context is constructed, injecting predefined variables into it, including cooperation years, annual purchase amount, and legal age. These variable values are all derived from the company's comprehensive data. Simultaneously, all built-in functions are disabled in this context, meaning built-in function access is set to an empty dictionary. This prevents malicious expressions in the configuration file from performing dangerous operations such as file read / write, network access, or code injection, thus implementing a security sandbox mechanism. Next, the interest_rate_discounts list is traversed. This list, stored in the configuration dictionary, contains multiple interest rate discount rules, each consisting of a conditional expression string and the corresponding discount amount.
[0051] For each interest rate discount rule, perform the following operations: Read condition expression string: Read the condition field from the current rule and get the condition expression stored as a string, such as "cooperation_years>= 5".
[0052] Evaluation in a restricted namespace: Using the restricted execution context constructed above as the namespace, the string expression is dynamically evaluated in an environment where built-in functions are disabled.
[0053] Result determination and processing: If the expression evaluates to true: the discount value of the current rule is added to base_rate to achieve the superposition of discount rates.
[0054] If the expression evaluates to false: skip the current rule and continue to the next one.
[0055] If an exception occurs during the evaluation process: the current rule is skipped and the process continues to the next rule to avoid interrupting the overall calculation due to a single expression error.
[0056] After iterating through all interest rate discount rules, the system executes interest rate floor protection. It reads `rate_floor` (the interest rate floor protection value) from the configuration dictionary and returns the larger of `base_rate` and `rate_floor`, i.e., `return max(base_rate, rate_floor)`. This mechanism ensures that the final interest rate is not lower than the preset business floor in the configuration file, preventing excessive discounts from causing the interest rate to be too low.
[0057] This flowchart presents a complete chain of "reading the benchmark interest rate → constructing a restricted context → traversing the list of preferential rules → reading the expression string → dynamically evaluating the restricted environment → accumulating the preferential rate if true / skipping if false or abnormal → interest rate floor protection → outputting the final interest rate". The core innovation lies in storing the interest rate preferential conditions as string expressions in the configuration file. At runtime, the preferential conditions are dynamically parsed and executed through the restricted execution context. This allows adding or modifying preferential conditions to only require editing the configuration file without modifying the source code. At the same time, the system's operational security is ensured through the security design of disabling built-in functions, and business compliance is ensured through interest rate floor protection. This significantly improves the flexibility, security, and controllability of interest rate pricing rules.
[0058] In this way, by reading the benchmark interest rate from the currently effective configuration as the initial calculation value, a unified benchmark for parameter adjustment is established, making the calculation starting point for different products configurable. By extracting predefined variable values such as cooperation period, annual purchase amount, and responsible person's age from the target object data, and constructing an expression execution context that disables access to built-in functions, the execution environment of conditional expressions is strictly restricted to the range of whitelisted variables. Even if the configuration file is maliciously tampered with, the expression cannot call dangerous system functions, effectively ensuring operational security. By reading the conditional expression string and its corresponding calculation range from the currently effective configuration and iterating through them dynamically, adding or modifying calculation conditions only requires editing the string expression in the configuration file, without modifying the source code or redeploying, significantly improving the flexibility and response efficiency of rule expansion. By accumulating the calculation range to the initial calculation value when the evaluation result is true, multiple preferential conditions are automatically superimposed, with each condition configured, judged, and effective independently, without the need for explicit description of the superposition logic. By skipping the current expression and continuing the iteration when an evaluation error occurs, the system's fault tolerance is enhanced, preventing a single configuration error from causing the overall calculation to be interrupted. Finally, by reading the calculated lower limit protection value and performing a take-the-larger operation with the current calculated value, the system ensures that the parameter adjustment result does not fall below the business baseline, preventing excessive discounts. Therefore, this solution, through a collaborative mechanism of benchmark interest rate initialization, restricted context construction, dynamic evaluation of conditional expressions, anomaly tolerance, and lower limit protection, achieves safe, flexible, automated, and controllable parameter adjustment. It effectively overcomes the shortcomings of traditional hard-coded solutions, such as difficulty in expansion, high maintenance costs, and significant security risks, and significantly improves the dynamic adaptability of calculation rules and system robustness.
[0059] In some optional embodiments, based on the scoring condition expression string and the corresponding scoring value in the currently effective configuration, a scoring calculation is performed on the target object data, and the scoring value is accumulated in the scoring result to obtain the final scoring result, including: Read the list of bonus rules from the currently active configuration. The list of bonus rules contains a string of bonus condition expressions and the corresponding bonus value. Extract predefined variable values from the target object data and inject them into the expression execution context; Iterate through each bonus condition expression string in the bonus rule list and dynamically evaluate it using the expression execution context as the namespace. If the evaluation result of the bonus condition expression string is true, the corresponding bonus value is added to the current score value in the scoring result to obtain the final score result.
[0060] Specifically, the bonus point calculation is achieved by reading the bonus point rule list and reusing the expression execution context, organically integrating the quality incentive assessment with the admission score. The bonus point rule list is a structured list storing bonus point conditions within the calculation rule block, containing bonus point condition expression strings and corresponding bonus point values. The bonus point condition expression string is an executable logical judgment statement stored as a string, used to determine whether the target object possesses quality attributes. The bonus point value is the additional reward score added when the condition is met. Predefined variable values are whitelist variables extracted from the target object data, including years of cooperation, annual procurement amount, and the age of the person in charge, sharing the same data source as the admission score calculation. The expression execution context is the namespace environment for dynamic evaluation, reusing the restricted execution context already constructed in the admission score calculation to maintain the consistency of the security sandbox mechanism.
[0061] The specific implementation process of this scheme includes: First, reading the list of bonus rules from the currently effective configuration, extracting the bonus condition expression strings and their corresponding bonus values, such as "cooperation_years>= 5" corresponding to a bonus value of 5, and "annual_purchase_amount>= 3000000" corresponding to a bonus value of 3. Second, extracting predefined variable values from the target object data, including the cooperation period, annual purchase amount, and the age of the person in charge, and injecting them into the constructed expression execution context. This context disables access to built-in functions and only allows references to whitelisted variables. Then, iterating through each bonus condition expression string in the list of bonus rules, dynamically evaluating them using the expression execution context as the namespace, that is, calling the expression parsing engine to execute string-based logical judgments in a restricted environment. If the evaluation result of the bonus condition expression string is true, the corresponding bonus value is accumulated into the current score value in the scoring result, updating it to the final score value. If the evaluation result is false or an exception occurs, the bonus rule is skipped and the process continues to the next rule. After iterating through all the bonus rules, the final score result is output. This result integrates the basic assessment of the admission score with the high-quality incentives of the bonus rules, which can be used by the business strategy module for priority ranking or differentiated pricing.
[0062] In this way, by reading the list of bonus rules from the currently effective configuration, the quality incentive conditions exist independently of the admission rules in a structured manner, supporting flexible configuration of differentiated bonus strategies. By extracting predefined variable values from the target object data and injecting them into the expression execution context, the security sandbox environment already built in the admission score calculation is reused to ensure that the execution of the bonus condition expressions is also subject to the constraint of disabled built-in functions, thus ensuring system security. By iterating through each bonus condition expression string sequentially and dynamically evaluating it using the expression execution context as the namespace, the judgment logic of the bonus conditions is dynamically parsed and executed at runtime. Adding or modifying bonus conditions only requires editing the configuration file without modifying the source code. By accumulating the corresponding bonus value to the current score value in the score result when the evaluation result is true, the basic admission score and the quality additional incentive are integrated, enabling the final score result to distinguish between objects that are "just up to standard" and those that are "significantly excellent". As can be seen, this solution achieves flexibility, security, and refined scoring results in quality identification through the externalized configuration of the bonus rule list, secure injection of predefined variables, dynamic evaluation of conditional expressions, and a fusion mechanism of score accumulation. It effectively overcomes the shortcomings of traditional solutions, such as the inability to distinguish the quality of objects and the difficulty in hard-coding and extending quality incentives, and significantly improves the discrimination and business adaptability of the evaluation system.
[0063] In some optional embodiments, the configuration loader is triggered via a hot-reload interface to reload the rule configuration files in the configuration directory, replacing the original memory dictionary object in the rule registry with the updated memory dictionary object, including: Receive the hot reload call request, clear all memory dictionary objects in the rule registry, and obtain an empty registry; Scan the configuration directory, enumerate all rule configuration files, parse each rule configuration file into an updated memory dictionary object, and extract the object code from each updated memory dictionary object; Using the object code as the key, each updated memory dictionary object is stored in an empty registry to obtain the updated rule registry; The updated rule registry is atomically replaced with the currently effective rule registry, so that the updated memory dictionary object takes effect immediately for subsequent rule execution requests.
[0064] Specifically, the reloading process of the configuration loader is triggered by receiving a hot reload call request, achieving zero-downtime updates to rule configurations. The hot reload call request is an update trigger request initiated by business users after modifying the rule configuration file, used to notify the system that the rule content has changed and to initiate a reload. The rule registry is an in-memory index structure built by the configuration loader, storing corresponding in-memory dictionary objects with object encoding as keys, supporting fast lookups. The in-memory dictionary object is a data structure stored in memory as key-value pairs after the rule configuration file is parsed, facilitating efficient runtime access. The configuration directory is a file storage path specified in the system, used to centrally store all rule configuration files. Atomic replacement is a complete registry update operation completed within a single function call, ensuring that the replacement process does not interrupt concurrent requests being processed.
[0065] The specific implementation process of this scheme includes: First, upon receiving a hot reload request, immediately clearing all memory dictionary objects in the rule registry to obtain an empty registry, thus releasing the memory space occupied by the old configuration. Second, scanning the configuration directory, enumerating all rule configuration files that meet the suffix requirements in the directory, reading each rule configuration file one by one and parsing it into updated memory dictionary objects, and extracting the object encoding field from each updated memory dictionary object as a unique identifier. Then, using the object encoding as the key, storing each updated memory dictionary object into the empty registry, establishing an updated rule registry, and forming a mapping index between the object encoding and the latest rule configuration. Finally, atomically replacing the updated rule registry with the currently effective rule registry, that is, completing the pointer switching or reference update within a single function call, so that the updated memory dictionary objects take effect immediately for subsequent rule execution requests, and the replacement process does not interrupt concurrent requests being processed, ensuring the continuity of system services.
[0066] This approach, by clearing all memory dictionary objects in the rule registry after receiving a hot reload request, completely releases the memory space occupied by the old configuration, avoiding data inconsistencies caused by mixing old and new configurations. By scanning the configuration directory and enumerating all rule configuration files, it ensures that each hot reload is rebuilt based on the latest complete state of the configuration directory, without relying on incremental comparisons, simplifying the update logic. By parsing each rule configuration file into updated memory dictionary objects and extracting the object encoding, the parsing process is independent and reliable; an anomaly in parsing a single configuration file does not affect the loading of other files. By storing each updated memory dictionary object in an empty registry using the object encoding as the key, a complete mapping index between the object encoding and the latest rule configuration is re-established, ensuring registry consistency. Finally, by atomically replacing the updated memory dictionary objects with the currently effective rule registry, the updated memory dictionary objects take effect immediately for subsequent rule execution requests, and the replacement process is completed within a single function call, without interrupting concurrent requests being processed. As can be seen, this solution achieves the technical effects of immediate rule configuration, data consistency, and service continuity through a collaborative mechanism of clearing and rebuilding, full scanning, independent parsing, complete mapping, and atomic replacement. It effectively overcomes the lengthy process of configuration changes requiring compilation, packaging, and deployment, as well as the service interruption caused by service restarts in traditional solutions, and significantly improves the response efficiency of rule updates and system availability.
[0067] For a better understanding of how the configuration loader works, see [link to documentation]. Figure 4 , Figure 4 This is a flowchart illustrating the configuration loader in one embodiment of this disclosure. The flowchart demonstrates two operating modes of the configuration loader: an initialization loading process and a hot loading process. Both modes work together to achieve dynamic management of rule configurations. The specific working process is as follows: For the initial loading process (triggered during system startup): After system startup, the configuration loader first scans the configuration directory, enumerating all rule configuration files with the ".yaml" suffix to obtain a list of configuration files to be loaded. Then, the configuration loader parses each file, converting each YAML-formatted rule configuration file into an in-memory dictionary object—that is, converting structured text into a key-value pair in-memory data structure for efficient runtime access. After parsing, the configuration loader extracts the `product_code` field from each in-memory dictionary object, using it as the unique identifier key for that product. Next, the configuration loader stores this information in the product registry, using `product_code` as the key to store the corresponding configuration dictionary object, establishing a mapping index relationship between product codes and rule configurations. Finally, after initial loading is complete, the configuration loader provides services externally, and the product registry exposes a query interface to the rule execution layer, supporting subsequent rule calculation requests.
[0068] For the hot reloading process (triggered by calling `reload()` at runtime): During runtime, when business users modify the configuration file, they trigger the hot reloading process of the configuration loader by calling the `reload()` interface. The configuration loader first clears the product registry, only removing the registry content in memory, without stopping system services, ensuring that concurrent requests being processed are not affected. Subsequently, the configuration loader re-executes the initialization process, repeating all the steps mentioned above: scanning the configuration directory, parsing files one by one, extracting `product_code`, and storing it in the product registry, rebuilding the complete product registry based on the latest file state in the configuration directory. The key to hot reloading is that the entire reloading process does not interrupt system services, does not restart any processes, and is completed within a single function call, ensuring service continuity. Finally, the new configuration takes effect immediately, and all subsequent rule execution requests use the updated rule parameters, achieving zero downtime and immediate effect for rule changes.
[0069] The initialization loading process and the hot reloading process share the same core steps of scanning, parsing, and registration. The difference lies in the triggering timing and pre-operations: initialization loading is executed when the system starts, building the product registry from scratch; hot reloading is triggered at runtime through the reload() interface, first clearing the old registry and then rebuilding it. Together, they enable dynamic management of rule configurations with "loading on startup and taking effect immediately after changes," allowing the addition, modification, and deletion of business rules to be done without modifying the source code or restarting the service, significantly improving system maintainability and business response efficiency.
[0070] Optionally, this disclosure provides a business object routing recommendation method. This method uses the aforementioned rule engine configuration method to obtain the rule calculation results for each object. Specifically, the method includes: Receive user business inquiry requests and extract the business demand quota from the natural language description of the user's business inquiry request to obtain the target business quota; Query the multidimensional data of the target business object to obtain the target object data. The multidimensional data includes basic attribute information, person in charge information, business status information, credit record information and transaction statistics information. Using the target object data and target business limit as input, and employing the rule engine configuration method described above, the rule calculation results for each object are obtained; Based on the target business quota and the rule calculation results of each object, a multi-dimensional comprehensive scoring and ranking is performed to obtain a recommended object sequence; The large language model is invoked to generate recommendation reason text based on the recommendation object sequence, and the recommendation object sequence, the rating details of each object, and the recommendation reason text are returned in the form of structured data.
[0071] For a better understanding of this embodiment, please refer to Figure 5 , Figure 5This is a schematic diagram of the overall process of a business object routing recommendation method in one embodiment of this disclosure. The flowchart illustrates the complete workflow of an intelligent routing recommendation system for enterprise financial products based on a configuration-driven rule engine. The end-to-end processing from user request to recommendation result output is as follows: First, the system receives a user's financing inquiry request, which includes the company's identifier and a description of the financing needs in natural language. Then, it invokes the data acquisition module to query the company's comprehensive data, including business registration information, legal information, order data, and financial and tax data, obtaining the target entity's data to provide a data foundation for subsequent rule evaluation.
[0072] Using the rule engine configuration method described above, a configuration file layer is maintained. Each financial product corresponds to an independent YAML format configuration file, such as chaoway_v1.yaml, chaoway_v2.yaml, chaoway_v3.yaml, etc. Each configuration file describes all the product's business rules in a structured manner, including basic product information, access rules, and calculation rules, achieving complete decoupling between business rules and execution code. For the configuration loading layer, the configuration loader (SkillManager) is responsible for scanning, parsing, and hot-loading management of configuration files, providing initialization loading, hot-loading interfaces, and product registry functionality. At system startup, the configuration loader scans the configuration file layer, parsing each YAML file into an in-memory dictionary object, extracting the object encoding as a key, and storing it in the product registry. During runtime, business users can trigger a reload through the hot-loading interface, replacing the original object with the updated in-memory dictionary object, achieving immediate effect of rule changes. For the rule execution layer, after configuration loading is complete, the system enters the rule execution layer, sequentially calling three core modules: Admission weighted scoring execution: Based on the admission threshold, deduction weight and admission pass score line in the current effective configuration, the target object data is weighted and scored to obtain the admission result and the score result, realizing the upgrade from binary judgment to refined quantitative evaluation.
[0073] Interest rate expression calculation: Based on the condition expression string and corresponding calculation range in the currently effective configuration, the calculation range that meets the conditions is dynamically evaluated in the restricted execution context. The calculation range that meets the conditions is accumulated to the benchmark interest rate, and the final result is constrained by the lower limit protection value of the interest rate to obtain the parameter adjustment result.
[0074] Bonus rule execution: Based on the bonus condition expression string and the corresponding bonus value in the currently effective configuration, the above-mentioned restricted execution context is reused for dynamic evaluation. The bonus values that meet the conditions are accumulated into the scoring result to obtain the final scoring result, distinguishing between ordinary qualified objects and high-quality objects.
[0075] After the rules are executed, the system enters the multi-dimensional sorting module, which comprehensively scores and sorts the approved products based on credit limit matching, interest rate discount, repayment flexibility, and eligibility matching, resulting in a recommendation sequence. Subsequently, the system calls the large-scale model recommendation generation module to generate recommendation reason text based on the sorting results, improving the interpretability and user-friendliness of the recommendations. Finally, the system outputs the recommendation results, returning a product list and detailed ratings for each product in structured data format, including eligibility results, actual interest rates, final ratings, and recommendation reasons, for users to make financing decisions.
[0076] This flowchart presents a complete chain of "request reception → data acquisition → configuration loading → rule execution (admission scoring + interest rate calculation + bonus calculation) → multi-dimensional sorting → large model generation → result output". The core innovation lies in the decoupling design of the configuration file layer and the configuration loading layer, which allows the addition, modification and deletion of business rules to only require operation on the YAML file. Combined with the hot reloading mechanism, it realizes rule updates with zero code and minute-level effectiveness, which significantly improves the system's flexibility, response efficiency and maintainability.
[0077] The following describes an apparatus embodiment of this application, which can be used to execute the rule engine configuration method in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the rule engine configuration method described above.
[0078] This disclosure also provides a rules engine configuration device 600, such as Figure 6 As shown, it includes: The configuration file module 601 is used to generate a rule configuration file for the target object in response to a rule configuration request. The rule configuration file includes basic product information, admission rules and calculation rules. The basic product information configures the object code, the admission rules configure the admission threshold and deduction weight, and the calculation rules configure the rule conditions and corresponding calculation range in the form of condition expression strings. The configuration loading module 602 is used to store the rule configuration file to the configuration directory, call the configuration loader to parse the rule configuration file in the configuration directory into a memory dictionary object, extract the object code in the memory dictionary object, store the memory dictionary object into the rule registry with the object code as the key, and provide a hot loading interface. The rule execution module 603 is used to respond to the rule execution request, query the memory dictionary object corresponding to the target object code from the rule registry as the current effective configuration, perform rule calculation on the target object data based on the rule parameters in the current effective configuration, and output the rule calculation result. The rule calculation result is used for business strategies. The update module 604 is used to respond to a configuration update request by calling the hot reload interface. The hot reload interface triggers the configuration loader to reload the rule configuration files in the configuration directory, and replaces the original memory dictionary object in the rule registry with the updated memory dictionary object.
[0079] In some optional embodiments, the configuration file module 601, in response to a rule configuration request, generates a rule configuration file for the target object, including: Read the target object's basic product information, extract the object code, product name, name of cooperating financial institution, maximum credit limit, benchmark interest rate, longest loan term and repayment method list, and generate a product basic information block; Read the admission rule parameters of the target object, extract the admission condition threshold, the deduction weight corresponding to the admission condition threshold, and the admission pass score line, and generate an admission rule block; Read the calculation rule parameters of the target object, extract the condition expression string and the corresponding calculation range of the condition expression string, and generate a calculation rule block; Combine the product basic information block, the access rule block, and the calculation rule block to obtain the rule configuration file.
[0080] In some optional embodiments, the rule execution module 603 performs rule calculations on the target object data based on the rule parameters in the currently effective configuration, and outputs the rule calculation results, including: Based on the admission threshold, deduction weight and admission pass score line in the current effective configuration, the admission score is calculated on the target object data to obtain the admission result and the score result. Based on the conditional expression string and corresponding calculation range in the current effective configuration, the target object data is dynamically evaluated to obtain the parameter adjustment result; Based on the scoring condition expression string and the corresponding scoring value in the current effective configuration, the target object data is scored, and the scoring value is accumulated into the scoring result to obtain the final scoring result. The admission results, parameter adjustment results, and final score results are output as the rule calculation results.
[0081] In some optional embodiments, the rule execution module 603 calculates an admission score for the target object data based on the admission threshold, deduction weight, and admission pass score line in the currently effective configuration, and obtains the admission result and the score result, including: Read the admission pass score line from the currently active configuration to obtain the initial score value; Read the admission threshold and corresponding deduction weight of each admission condition from the currently effective configuration, and then obtain the actual parameter values corresponding to each admission condition from the target object data in sequence. The actual parameter value is compared with the corresponding admission threshold. If the actual parameter value does not meet the admission threshold, the corresponding deduction weight is deducted from the initial score value, and the description information of the failure to meet the admission condition is added to the rejection reason list to obtain the current score value and the updated rejection reason list. After traversing all admission criteria, determine whether the current score is not lower than the admission passing score threshold and whether the rejection reason list is empty. If so, output the admission passed score and the current score as the scoring result; otherwise, output the admission failed score, the current score, and the rejection reason list as the scoring result.
[0082] In some optional embodiments, the rule execution module 603 dynamically evaluates the target object data based on the conditional expression string and corresponding calculation range in the currently effective configuration to obtain parameter adjustment results, including: Read the benchmark interest rate from the currently active configuration to obtain the initial calculated value; Extract predefined variable values from the target object data, construct an expression execution context, and inject the predefined variable values into the expression execution context. The predefined variable values include at least one of the following: cooperation period, annual purchase amount, and age of the person in charge. The expression execution context disables access to built-in functions. Read the conditional expression string and its corresponding calculation range from the currently active configuration, traverse each conditional expression string in turn, and dynamically evaluate it using the expression execution context as the namespace; If the evaluation result of the conditional expression string is true, the corresponding calculation range is added to the initial calculation value to obtain the current calculation value; If an exception occurs during the evaluation of the conditional expression string, skip the conditional expression string and continue the traversal; After traversing all conditional expression strings, the calculated lower limit protection value is read from the currently effective configuration. The current calculated value and the calculated lower limit protection value are then compared to obtain the parameter adjustment result.
[0083] In some optional embodiments, the rule execution module 603 calculates the score for the target object data based on the scoring condition expression string and the corresponding scoring value in the currently effective configuration, and adds the scoring value to the scoring result to obtain the final scoring result, including: Read the list of bonus rules from the currently active configuration. The list of bonus rules contains a string of bonus condition expressions and the corresponding bonus value. Extract predefined variable values from the target object data and inject them into the expression execution context; Iterate through each bonus condition expression string in the bonus rule list and dynamically evaluate it using the expression execution context as the namespace. If the evaluation result of the bonus condition expression string is true, the corresponding bonus value is added to the current score value in the scoring result to obtain the final score result.
[0084] In some optional embodiments, the update module 604 triggers the configuration loader to reload the rule configuration files in the configuration directory via a hot-reload interface, replacing the original memory dictionary object in the rule registry with the updated memory dictionary object, including: Receive the hot reload call request, clear all memory dictionary objects in the rule registry, and obtain an empty registry; Scan the configuration directory, enumerate all rule configuration files, parse each rule configuration file into an updated memory dictionary object, and extract the object code from each updated memory dictionary object; Using the object code as the key, each updated memory dictionary object is stored in an empty registry to obtain the updated rule registry; The updated rule registry is atomically replaced with the currently effective rule registry, so that the updated memory dictionary object takes effect immediately for subsequent rule execution requests.
[0085] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0086] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0087] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0088] like Figure 7As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0089] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0090] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the rule engine configuration method. For example, in some embodiments, the rule engine configuration method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the rule engine configuration method by any other suitable means (e.g., by means of firmware).
[0091] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0092] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0093] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0095] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0096] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0097] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0098] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for configuring a rules engine, wherein, The method includes: In response to a rule configuration request, a rule configuration file is generated for the target object. The rule configuration file includes basic product information, access rules, and calculation rules. The basic product information configures the object code, the access rules configure the access threshold and deduction weight, and the calculation rules configure the rule conditions and corresponding calculation range in the form of conditional expression strings. The rule configuration file is stored in the configuration directory. The configuration loader is called to parse the rule configuration file in the configuration directory into a memory dictionary object. The object code in the memory dictionary object is extracted. The memory dictionary object is stored in the rule registry with the object code as the key. A hot reloading interface is provided. In response to a rule execution request, the system queries the memory dictionary object corresponding to the target object code from the rule registry as the current effective configuration, performs rule calculations on the target object data based on the rule parameters in the current effective configuration, and outputs the rule calculation results, which are used for business strategies. In response to a configuration update request, the hot-load interface is invoked, and the configuration loader is triggered to reload the rule configuration file in the configuration directory through the hot-load interface, so as to replace the original memory dictionary object in the rule registry with the updated memory dictionary object.
2. The method according to claim 1, wherein, The step of generating a rule configuration file for the target object in response to a rule configuration request includes: Read the target object's basic product information, extract the object code, product name, name of cooperating financial institution, maximum credit limit, benchmark interest rate, longest loan term and repayment method list, and generate a product basic information block; Read the admission rule parameters of the target object, extract the admission condition threshold, the deduction weight corresponding to the admission condition threshold and the admission pass score line, and generate an admission rule block; Read the calculation rule parameters of the target object, extract the condition expression string and the calculation range corresponding to the condition expression string, and generate a calculation rule block; The product basic information block, the access rule block, and the calculation rule block are combined to obtain the rule configuration file.
3. The method according to claim 1, wherein, The step of performing rule calculations on the target object data based on the rule parameters in the currently effective configuration and outputting the rule calculation results includes: Based on the admission threshold, deduction weight and admission pass score line in the current effective configuration, the admission score is calculated on the target object data to obtain the admission result and the score result. Based on the conditional expression string and corresponding calculation range in the currently effective configuration, the target object data is dynamically evaluated to obtain the parameter adjustment result; Based on the scoring condition expression string and the corresponding scoring value in the currently effective configuration, the target object data is scored, and the scoring value is accumulated into the scoring result to obtain the final scoring result. The admission result, the parameter adjustment result, and the final score result are output as the rule calculation result.
4. The method according to claim 3, wherein, The process involves calculating an admission score for the target object data based on the admission threshold, deduction weight, and admission pass score line in the currently effective configuration, resulting in admission and score results, including: Read the admission pass score line from the currently effective configuration to obtain the initial score value; Read the admission threshold and corresponding deduction weight of each admission condition from the currently effective configuration, and sequentially obtain the actual parameter values corresponding to each admission condition from the target object data; The actual parameter value is compared with the corresponding admission threshold. If the actual parameter value does not meet the admission threshold, the corresponding deduction weight is deducted from the initial score value, and the description information of the failure to meet the admission condition is added to the rejection reason list to obtain the current score value and the updated rejection reason list. After traversing all admission criteria, determine whether the current score is not lower than the admission passing score line and whether the rejection reason list is empty. If so, output the admission passed score and the current score as the scoring result; otherwise, output the admission failed score, the current score and the rejection reason list as the scoring result.
5. The method according to claim 3, wherein, The step of dynamically evaluating the target object data based on the conditional expression string and corresponding calculation range in the currently effective configuration to obtain the parameter adjustment result includes: Read the benchmark interest rate from the currently effective configuration to obtain the initial calculated value; Extract predefined variable values from the target object data, construct an expression execution context, and inject the predefined variable values into the expression execution context. The predefined variable values include at least one of the following: cooperation period, annual purchase amount, and age of the person in charge. The expression execution context disables access to built-in functions. Read the conditional expression string and its corresponding calculation range from the currently effective configuration, traverse each conditional expression string in turn, and dynamically evaluate it using the expression execution context as the namespace; If the evaluation result of the conditional expression string is true, the corresponding calculation range is added to the initial calculation value to obtain the current calculation value; If an exception occurs during the evaluation of the conditional expression string, the conditional expression string is skipped and the iteration continues; After traversing all conditional expression strings, the calculated lower limit protection value is read from the currently effective configuration, and the current calculated value and the calculated lower limit protection value are subjected to a larger operation to obtain the parameter adjustment result.
6. The method according to claim 3, wherein, The step of calculating the score for the target object data based on the scoring condition expression string and the corresponding scoring value in the currently effective configuration, and accumulating the scoring value to the scoring result to obtain the final scoring result includes: Read the scoring rule list from the currently effective configuration. The scoring rule list contains scoring condition expression strings and corresponding scoring values. Extract predefined variable values from the target object data and inject them into the expression execution context; The scoring condition expression strings in the scoring rule list are traversed sequentially, and the expression execution context is used as the namespace for dynamic evaluation. If the evaluation result of the bonus condition expression string is true, the corresponding bonus value is added to the current score value in the score result to obtain the final score result.
7. The method according to claim 1, wherein, The step of triggering the configuration loader to reload the rule configuration file in the configuration directory through the hot-loading interface, and replacing the original memory dictionary object in the rule registry with the updated memory dictionary object, includes: Receive the hot reload call request, clear all memory dictionary objects in the rule registry, and obtain an empty registry; Scan the configuration directory, enumerate all rule configuration files, parse each rule configuration file into an updated memory dictionary object, and extract the object code from each updated memory dictionary object; Using the object code as the key, each updated memory dictionary object is stored in the empty registry to obtain the updated rule registry. The updated rule registry is atomically replaced with the currently effective rule registry, so that the updated memory dictionary object takes effect immediately for subsequent rule execution requests.
8. A business object routing recommendation method, wherein, The method further includes: Receive user business consultation requests and extract the business demand quota from the natural language description of the user business consultation request to obtain the target business quota; The multidimensional data of the target business object is queried to obtain the target object data, which includes basic attribute information, person in charge information, business status information, credit record information and transaction statistics information; Using the target object data and the target business quota as input, the rule engine configuration method as described in any one of claims 1 to 7 is used to obtain the rule calculation results for each object; Based on the target business quota and the rule calculation results of each object, a multi-dimensional comprehensive scoring and ranking is performed to obtain a recommended object sequence; The large language model is invoked to generate recommendation reason text based on the recommended object sequence, and the recommended object sequence, the rating details of each object, and the recommendation reason text are returned in the form of structured data.
9. A rules engine configuration device, wherein, The device includes: The configuration file module is used to generate a rule configuration file for the target object in response to a rule configuration request. The rule configuration file includes basic product information, admission rules, and calculation rules. The basic product information configures the object code, the admission rules configure the admission threshold and deduction weight, and the calculation rules configure the rule conditions and corresponding calculation range in the form of conditional expression strings. The configuration loading module is used to store the rule configuration file to the configuration directory, call the configuration loader to parse the rule configuration file in the configuration directory into a memory dictionary object, extract the object code in the memory dictionary object, store the memory dictionary object into the rule registry with the object code as the key, and provide a hot loading interface. The rule execution module is used to respond to a rule execution request, query the memory dictionary object corresponding to the target object code from the rule registry as the current effective configuration, perform rule calculation on the target object data based on the rule parameters in the current effective configuration, and output the rule calculation result, which is used for business strategies. The update module is used to respond to a configuration update request by calling the hot-load interface, which triggers the configuration loader to reload the rule configuration file in the configuration directory, and replaces the original memory dictionary object in the rule registry with the updated memory dictionary object.
10. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
11. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.