Formula configuration method, apparatus, storage medium and computer equipment

By receiving formula data source configuration information and dynamically obtaining parameter values ​​using preset variable SQL statements, the target calculation formula is validated and decomposed, solving the problem of insufficient flexibility in traditional methods and achieving flexible, accurate and efficient data processing.

CN119690991BActive Publication Date: 2026-01-30GUANGZHOU TIANCOM INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411993863.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2026-01-30
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Traditional formula input methods are inflexible and cannot effectively cope with highly personalized and dynamically changing data processing needs, resulting in low efficiency and increased risk of errors.

Method used

By receiving formula data source configuration information, dynamically obtaining parameter values, verifying and decomposing the target calculation formula, converting SQL statements with preset variables into numerical formulas and executing calculations, flexible calculation formula configuration is achieved.

Benefits of technology

It improves the flexibility and dynamism of data processing, reduces human intervention, lowers the risk of errors, improves the accuracy and efficiency of calculations, and supports efficient computing in changing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690991B_ABST
    Figure CN119690991B_ABST
Patent Text Reader

Abstract

The formula configuration method provided in this application receives formula data source configuration information, which includes multiple preset formula variables and their corresponding preset configuration parameters, as well as preset variable SQL statements. The preset variable SQL statements are used to obtain preset parameter values ​​from the preset data source corresponding to each preset configuration parameter of the preset formula variable. A target calculation formula is obtained, which is pre-configured according to the formula data source configuration information and includes target formula variables. The target calculation formula is validated; if the validation passes, the target calculation formula is decomposed to obtain the target formula structure. Based on the target variable SQL statements corresponding to each target formula variable in the target calculation formula, the target formula structure is converted into a numerical formula containing multiple target parameter values, and then the calculation is performed to obtain the calculation result of the target calculation formula. This improves the flexibility of formula input.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a formula configuration method and device, a storage medium and a computer device. BACKGROUND

[0002] Under the background of rapid development of information technology, data processing and analysis are facing unprecedented challenges. With the rapid growth of data volume, users' demand for data processing is becoming increasingly complex, requiring more flexible and dynamic solutions. Traditional data processing methods, especially static processing methods based on fixed formulas and preset algorithms, have been difficult to meet the needs of flexibility and dynamics of modern data processing.

[0003] Nowadays, banks and other industries often face highly personalized needs when building performance management systems, and traditional formula input methods have poor flexibility. Although some systems introduce parameterized formulas, allowing parameters to be adjusted within a certain range, these methods still cannot effectively cope with complex requirements beyond the preset range. In addition, users still need manual intervention and redevelopment when facing dynamically changing algorithms or formulas, resulting in low efficiency, increasing the risk of errors, and affecting the accuracy and timeliness of data processing. SUMMARY

[0004] The purpose of the present application is to at least solve one of the above technical defects, in particular the technical defect that the traditional formula input method in the prior art has poor flexibility.

[0005] In a first aspect, the present application provides a formula configuration method, the method comprising:

[0006] receiving formula data source configuration information, the formula data source configuration information comprising a plurality of preset formula variables and corresponding respective preset configuration parameters, and a preset variable SQL statement, the preset variable SQL statement being used to obtain preset parameter values from a preset data source of each preset configuration parameter corresponding to the preset formula variable;

[0007] obtaining a target calculation formula, the target calculation formula being pre-configured according to the formula data source configuration information and comprising at least a target formula variable;

[0008] verifying the target calculation formula, and when the target calculation formula passes the verification, decomposing the target calculation formula to obtain a target formula structure of the target calculation formula;

[0009] converting the target formula structure into a numerical formula containing a plurality of target parameter values according to a target variable SQL statement corresponding to each target formula variable in the target calculation formula, and performing an operation to obtain a calculation result of the target calculation formula.

[0010] In one embodiment, the target calculation formula includes multiple target configuration items, each target configuration item including target formula variables and their corresponding target configuration parameters, as well as the target value conditions for each target configuration parameter.

[0011] The steps to obtain the target calculation formula include:

[0012] When a placeholder indicating the start of formula input is received, a formula variable selection box pops up to retrieve the target formula variable from various preset target formula variables;

[0013] For each target formula variable, when a placeholder indicating the start of input configuration parameters is received, a configuration parameter selection box corresponding to the target formula variable pops up, and the target configuration parameter and its target value condition are obtained according to the selection result in the configuration parameter selection box.

[0014] For each target formula variable, the target formula variable, its corresponding target configuration parameter, and the value conditions of each target configuration parameter are taken as target configuration items, and the calculation rules between each target configuration item are obtained to obtain the target calculation formula.

[0015] In one embodiment, the step of obtaining the target configuration parameter and its target value condition corresponding to the target formula variable based on the selection result in the configuration parameter selection box includes:

[0016] When any preset configuration parameter corresponding to the target formula variable is selected in the configuration parameter selection box, the selected preset configuration parameter is used as the target configuration parameter corresponding to the target formula variable. Then, the value condition selection box for the target configuration parameter pops up. If any preset value condition corresponding to the target configuration parameter is selected in the value condition selection box, the selected preset value condition is used as the target value condition for the target configuration parameter. Otherwise, the target value condition is set to empty.

[0017] When none of the preset configuration parameters corresponding to the target formula variable are selected in the configuration parameter selection box, the target configuration parameter and the target value condition corresponding to the target formula variable are set to empty.

[0018] In one embodiment, the step of verifying the target calculation formula includes:

[0019] The data source configuration information in the target calculation formula is validated for data source rules, and each symbol is checked for formula syntax rules.

[0020] In one embodiment, the step of decomposing the target calculation formula to obtain the target formula structure includes:

[0021] Each target configuration item is identified in the target calculation formula, and the format of each target configuration item is converted into a structured format while retaining the calculation rules of the target calculation formula, thus obtaining the target formula structure.

[0022] In one embodiment, the step of converting the target formula structure into a numerical formula containing multiple target parameter values ​​based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula includes:

[0023] Based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula, obtain the target parameter value corresponding to each target formula variable;

[0024] Replace each structured target configuration item in the target formula structure with the target parameter value of the corresponding target formula variable to obtain the numerical formula.

[0025] In one embodiment, the step of performing the calculation to obtain the calculation result of the target calculation formula includes:

[0026] Determine the dependencies in the target calculation formula, and perform calculations according to the execution order of the numerical formulas based on the dependencies to obtain the calculation result of the target calculation formula.

[0027] Secondly, this application provides a formula configuration device, the device comprising:

[0028] The formula data source configuration information receiving module is used to receive formula data source configuration information. The formula data source configuration information includes multiple preset formula variables and their corresponding preset configuration parameters, as well as preset variable SQL statements. The preset variable SQL statements are used to obtain preset parameter values ​​from the preset data source corresponding to each preset configuration parameter of the preset formula variable.

[0029] The target calculation formula acquisition module is used to acquire the target calculation formula, which is pre-configured based on the formula data source configuration information and includes at least the target formula variables.

[0030] The target calculation formula verification module is used to verify the target calculation formula, and when the target calculation formula passes the verification, it decomposes the target calculation formula to obtain the target formula structure.

[0031] The calculation result determination module is used to convert the target formula structure into a numerical formula containing multiple target parameter values ​​based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula, and to perform the calculation to obtain the calculation result of the target calculation formula.

[0032] Thirdly, this application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of any of the formula configuration methods described in the above embodiments.

[0033] Fourthly, this application provides a computer device, including: one or more processors, and a memory;

[0034] The memory stores computer-readable instructions that, when executed by one or more processors, perform the steps of any of the formula configuration methods described in the above embodiments.

[0035] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0036] The formula configuration method provided in this application effectively enhances the flexibility and dynamism of data processing, solving the problem that fixed formulas and preset algorithms in traditional methods cannot adapt to complex needs. Specifically, this method receives formula data source configuration information and dynamically obtains parameter values ​​based on preset variable SQL statements. It can adjust the calculation formula in real time according to requirements, achieving more personalized performance management and data processing. The verification and decomposition process of the target calculation formula ensures the accuracy and executability of the formula, thereby reducing the need for manual intervention, lowering the risk of errors, and improving the efficiency and timeliness of data processing. Furthermore, by dynamically calculating the target formula, this method supports maintaining efficient and accurate calculation results in constantly changing business environments. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 A flowchart illustrating the formula configuration method provided in this application embodiment;

[0039] Figure 2 This is a schematic diagram of the structure of the formula configuration device provided in the embodiments of this application;

[0040] Figure 3 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] This application provides a formula configuration method. The following embodiments illustrate this method applied to a computer device. It is understood that the computer device can be any device with data processing capabilities, including but not limited to a single server, server cluster, personal laptop, desktop computer, etc. Figure 1 As shown, the method may include the following steps:

[0043] S101: Receive formula data source configuration information. The formula data source configuration information includes multiple preset formula variables and their corresponding preset configuration parameters, as well as preset variable SQL statements. The preset variable SQL statements are used to obtain preset parameter values ​​from the preset data source corresponding to each preset configuration parameter of the preset formula variable.

[0044] The formula data source configuration information refers to the configuration parameters related to the data source for formula calculation. This includes multiple formula variables, the preset configuration parameters required for each formula variable, and the SQL statements for retrieving parameter values ​​from the data source. Its main purpose is to provide a dynamic and flexible data source for formula calculation. Preset formula variables refer to the variables used in the formula calculation process. These variables are pre-defined in the formula data source and associated with specific parameter values ​​and data sources. Formula variables can be configured with basic information, including variable name, application scenario, and variable description. Preset configuration parameters refer to the specific configuration parameters corresponding to each preset formula variable, including parameter name, type, and value range, used to define the value rules of formula variables in different scenarios. In one example, using "institutional indicator value" as the formula variable, its required configuration parameters include assessment indicators. The attributes of the assessment indicators include: Chinese name "assessment indicator," English name "APRLKPI_CODE," user input value (entered according to requirements, and the system default value when no input is provided), and value source range (assessment indicator library or custom). Among them, the Chinese name is the Chinese description of the parameter, which is easy to understand and use; the English name is the English identifier of the parameter, which is used for programming and system identification; the user input value indicates whether the parameter needs to be directly entered by the user or is assigned a default value by the system; the value source range is used to define the range or source of the parameter's value.

[0045] The SQL statement for preset variables refers to the SQL query statement used to retrieve the parameter values ​​corresponding to preset formula variables from the database. This SQL statement extracts necessary information from the data source based on the configuration of the preset variables and parameters. In one example, assuming the formula variable is an institutional indicator value, the SQL statement for its data retrieval source needs to be configured, and related parameters need to be defined. These parameters are dynamically passed variables in the SQL statement for filtering data. The configuration parameters for the institutional indicator value include the assessment indicator (parameter name: APRLKPI_CODE), the assessment date (parameter name: STAT_DT), and the institutional level (parameter name: ORG_GRD). Therefore, for the formula variable "institutional indicator value", the corresponding SQL query statement is as follows: `select t.APRL_ID askey,KPI_VAL as value from TEMP_KPIS_ORG_ACMT y INNER JOIN SCHM_ORG_GRD_VIEW tON y.ORG_APRL_ID=t.MAP_APRL_ID AND t.APRL_TYPE='2' where y.APRLKPI_CODE=` {APRLKPI_CODE} and Y.STAT_DT= {STAT_DT} AND t.ORG_GRD=' '{ORG_GRD}'. In this SQL statement, {APRLKPI_CODE}、 {STAT_DT}、 {ORG_GRD} represents the parameter values ​​for the assessment indicator, assessment date, and institution level, respectively. For string parameters, single quotes must be used in the SQL statement, while single quotes are not required for non-string parameters. The SQL return field includes a key and a value. The key represents the primary key returned, including the specific institution or employee primary key, and the value represents the returned value.

[0046] In this step, configuration information can be received from external or internal sources via an interface. This information can be transmitted through RESTful API, SOAP API, JSON, XML, or other standard formats. For example, if the configuration information is sent in JSON format, a parser reads this information and converts it into an internal data structure. Suppose it's a bank's performance management system where a user selects "Performance Indicators" and "Performance Date" in the configuration interface; these parameters can be received via the API. It's worth noting that the formula data source configuration allows users to dynamically add, delete, and modify data according to business needs.

[0047] Furthermore, after receiving the configuration information, the received data can be validated to ensure it conforms to the preset format, range, and validity. For example, this includes checking if the field types are correct, if required fields are filled, and if the date format meets the requirements. For instance, if an "Assessment Date" field is received, it can be verified that it conforms to the "YYYY-MM-DD" format. The validated configuration information can be stored in memory or persistent storage. The storage method will vary depending on the data's lifecycle and access frequency.

[0048] It is understandable that by receiving formula data source configuration information, it can flexibly adapt to different business needs, automatically obtain the required calculation parameters, and improve the accuracy and real-time performance of calculations through dynamic configuration. This process simplifies user interaction, reduces human input errors, supports multiple data sources and configuration methods, and enhances the flexibility and scalability of formula configuration.

[0049] S102: Obtain the target calculation formula, which is pre-configured based on the formula data source configuration information and includes at least the target formula variables.

[0050] The target calculation formula is a predefined and configured calculation formula based on the formula data source configuration information. It includes at least target formula variables. The target formula is used to perform data calculation tasks and, in specific application scenarios, outputs calculation results based on the input parameters and data. Target formula variables are the specific parameters or data items that need to be calculated in the target calculation formula. These variables occupy specific positions in the formula and can be dynamically populated with their corresponding values ​​according to the preset data source configuration information.

[0051] In this step, the target calculation formula can be received from a database, configuration file, or external interface. This means the target calculation formula is pre-configured by the user based on formula data source configuration information and then passed to the computer device, and it must include target formula variables. For example, if the net profit margin needs to be calculated, and net profit and total revenue are both formula variables, the user can simply enter "net profit / total revenue" in the formula configuration interface and confirm. The computer device will then obtain the target calculation formula, with net profit and total revenue as the target formula variables. It's important to note that the target calculation formula must include at least formula variables because these are dynamically changing parameters or data items during the calculation process. They obtain their actual values ​​from the preset data source or input and ultimately affect the calculation result. If the target calculation formula does not include formula variables, dynamic calculations related to specific data or parameters cannot be completed. Therefore, formula variables, as a core component, ensure that the calculation formula can dynamically adjust according to the input data and environment, providing personalized and accurate calculation results.

[0052] It is understandable that by pre-defining and configuring target calculation formulas based on formula data source configuration information, data calculation tasks can be flexibly and dynamically executed automatically according to different application scenarios. The target formula variables, as key elements in the formula, ensure that the calculation formula can be populated with corresponding variable values ​​based on real-time input parameters and data during execution. This not only improves the accuracy and efficiency of calculations but also significantly reduces the need for manual intervention, thereby quickly adapting to different business needs and data changes.

[0053] S103: Verify the target calculation formula, and when the target calculation formula passes the verification, decompose the target calculation formula to obtain the target formula structure.

[0054] The target calculation formula structure breaks down the target calculation formula into a more detailed and operational structural form. This target formula structure provides a clear execution path and calculation logic for executing the formula.

[0055] This step first analyzes the syntax of the formula to ensure that each part conforms to preset rules. The validation process can be performed using a parser. The parser converts the formula string into a data structure and checks the syntax for correctness. For data types involved, it also checks type compatibility, such as whether integer and floating-point operations are compliant. For example, if the target calculation formula is... Net profit / Total revenue First, confirm that net profit and total revenue are defined formula variables, and check if the division operator can be legally applied to the data types of these two variables. After the target calculation formula passes validation, the formula can be broken down into multiple simple operations based on the operators and parentheses in the formula. For example, the formula... Net profit / Total revenue It will be broken down into two parts: net profit and total revenue.

[0056] Understandably, firstly, validation ensures the legality and accuracy of formulas, helping to prevent users from entering incorrect formulas or formulas that do not conform to calculation rules, thus avoiding calculation failures or inaccurate results due to incorrect formulas. Secondly, decomposing the target calculation formula simplifies the calculation process, making the calculation steps clearer and the operation more efficient. By breaking down complex formulas into basic calculation units, each operation can be performed step by step, rather than processing the entire formula at once, reducing the complexity of the calculation.

[0057] S104: Based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula, convert the target formula structure into a numerical formula containing multiple target parameter values, and perform the calculation to obtain the calculation result of the target calculation formula.

[0058] Among them, the target variable SQL statement refers to the SQL query statement that obtains the parameter values ​​required for the target formula variable from the database or other data sources. It can dynamically obtain the data corresponding to the formula variable to populate the formula.

[0059] In this step, for each target formula variable, the corresponding SQL statement for that variable is found. For example, if the formula variable is sales revenue, an SQL query is executed to retrieve the corresponding sales revenue data from the database. Once the target variable SQL statement is retrieved and the query is successfully executed, the returned parameter values ​​are filled into the placeholders in the formula, thus converting the target calculation formula into a specific numerical formula. For example, if the target formula structure is sales revenue / total cost, the variables in the formula are replaced with the actual sales revenue and total cost data, forming a complete numerical formula. The converted numerical formula can be directly used for calculation, that is, actual operations are performed on the values ​​in the formula, such as division and multiplication, to obtain the final calculation result. For example, assuming the target formula is sales revenue / total cost, the retrieved sales revenue and total cost values ​​will be used to perform a division operation to obtain the final calculation result.

[0060] It's understandable that by first obtaining the SQL statement for the target variables, then converting the target formula structure into a numerical formula containing multiple target parameter values, and finally executing the calculation, it's possible to ensure that each variable in the formula is correctly populated and calculated. This execution flow ensures the dynamic nature and flexibility of the formula, especially when real-time data needs to be obtained from external data sources. Automated numerical population and calculation not only improves the accuracy of the calculation but also enhances computational efficiency.

[0061] In the above embodiments, the flexibility and dynamism of data processing are effectively improved, solving the problem that fixed formulas and preset algorithms in traditional methods cannot adapt to complex needs. Specifically, this method receives formula data source configuration information and dynamically obtains parameter values ​​based on preset variable SQL statements. It can adjust the calculation formula in real time according to needs, achieving more personalized performance management and data processing. The verification and decomposition process of the target calculation formula ensures the accuracy and executability of the formula, thereby reducing the need for manual intervention, lowering the risk of errors, and improving the efficiency and timeliness of data processing. Furthermore, by dynamically calculating the target formula, this method supports maintaining efficient and accurate calculation results in constantly changing business environments.

[0062] In one embodiment, the target calculation formula includes multiple target configuration items, each target configuration item including target formula variables and their corresponding target configuration parameters, as well as the target value conditions for each target configuration parameter.

[0063] The steps to obtain the target calculation formula include:

[0064] When a placeholder indicating the start of formula input is received, a formula variable selection box pops up to retrieve the target formula variable from various preset target formula variables;

[0065] For each target formula variable, when a placeholder indicating the start of input configuration parameters is received, a configuration parameter selection box corresponding to the target formula variable pops up, and the target configuration parameter and its target value condition are obtained according to the selection result in the configuration parameter selection box.

[0066] For each target formula variable, the target formula variable, its corresponding target configuration parameter, and the value conditions of each target configuration parameter are taken as target configuration items, and the calculation rules between each target configuration item are obtained to obtain the target calculation formula.

[0067] The target configuration item is a fundamental component of the target calculation formula. Each target configuration item includes a target formula variable and its corresponding target configuration parameters, as well as the conditions for these parameters to take values. Together, they define how to acquire and use relevant data to complete the calculation. The target configuration parameters are the parameters corresponding to the target formula variable, defining how to specify the data requirements for the target formula variable. For example, a variable may have multiple parameters, and these parameters may affect the calculation result. The target value conditions are conditions related to the target configuration parameters, used to restrict or filter the source or range of data, ensuring that the selected data meets predetermined business requirements or rules.

[0068] Specifically, upon receiving a placeholder indicating the start of formula variable input, a formula variable selection box pops up, displaying a preset list of formula variables, allowing the user to quickly select the required formula variable without manually entering the variable name. For each target formula variable, upon receiving a placeholder indicating the start of configuration parameter input, appropriate configuration parameters are dynamically generated based on the options, and a configuration parameter selection box corresponding to that target formula variable pops up, showing the possible configuration parameters for that variable. At this point, the user can select specific parameters related to that formula variable. Based on the selection result in the configuration parameter selection box, the target configuration parameters and their target value conditions corresponding to the target formula variable are obtained. In one example, based on the user's selection, the relevant configuration parameters and their corresponding value conditions can be obtained from the data source and populated. For example, if the user selects a "time" parameter, the value range of the parameter can be obtained according to the set rules, which might be "the past month" or "this quarter," etc.

[0069] For each target formula variable, the target formula variable, its corresponding target configuration parameter, and the value conditions for each target configuration parameter are combined into a complete target configuration item, forming the basic components of the target calculation formula. Then, the relationships and calculation rules of all target configuration items are analyzed and summarized, and these configuration items are combined into a complete target calculation formula.

[0070] In this embodiment, by receiving formula variable placeholders and displaying a selection box, users can intuitively and efficiently select the required formula variables. Subsequent pop-up configuration parameter selection boxes and the acquisition of target configuration parameters and value conditions ensure that users can configure appropriate parameters and constraints according to specific needs, thereby improving the accuracy and flexibility of formula configuration. Integrating this information into target configuration items and obtaining calculation rules allows all configurations to be integrated into the final target calculation formula, providing a clear and standardized foundation for subsequent calculations and data processing. This dynamic and visual operation method not only improves the flexibility of the configuration process but also ensures the customization and adaptability of the calculation formula, thereby enhancing the accuracy and efficiency of the calculation.

[0071] In one embodiment, the step of obtaining the target configuration parameters and their target value conditions corresponding to the target formula variable based on the selection result in the configuration parameter selection box includes:

[0072] When any preset configuration parameter corresponding to the target formula variable is selected in the configuration parameter selection box, the selected preset configuration parameter is used as the target configuration parameter corresponding to the target formula variable. Then, the value condition selection box for the target configuration parameter pops up. If any preset value condition corresponding to the target configuration parameter is selected in the value condition selection box, the selected preset value condition is used as the target value condition for the target configuration parameter. Otherwise, the target value condition is set to empty.

[0073] When none of the preset configuration parameters corresponding to the target formula variable are selected in the configuration parameter selection box, the target configuration parameter and the target value condition corresponding to the target formula variable are set to empty.

[0074] Specifically, when any preset configuration parameter corresponding to the target formula variable is selected in the configuration parameter selection box, the system first detects that the user has selected a preset configuration parameter. Then, a selection box for the value conditions of the target configuration parameter pops up, displaying multiple selectable value conditions associated with the configuration parameter. If any preset value condition corresponding to the target configuration parameter is selected in the value condition selection box, the value condition selected by the user is applied to the target configuration parameter, and this value condition is used as the target value condition of the target configuration parameter. Otherwise, the target value condition is set to empty; that is, if the user does not select a valid value condition, the target value condition will be in an unentered state. When none of the preset configuration parameters corresponding to the target formula variable are selected in the configuration parameter selection box, all target configuration parameters and their value conditions corresponding to the target formula variable are set to empty; that is, the target configuration parameters and their target value conditions will be in an unentered state. It should be noted that the target formula variable is the core part of the target calculation formula and is required, while the target configuration parameters and their target value conditions are optional. When the target configuration parameters or target value conditions are not entered, the corresponding default values ​​can be obtained for calculation, or they can be hidden and not involved in the calculation.

[0075] In one example, in the formula algorithm configuration, users configure custom calculation formulas through an intuitive visual interface. These formulas consist of placeholders containing variables; variable names are required, while parameter names and values ​​are optional. For example, the formula for "Institutional Indicator Value" might contain something like " Institutional performance indicators [Performance indicator = average daily balance of all deposits over the years, assessment date = end of last month] The structure is "...", where "performance indicators" and "performance date" are parameter names, and "average daily balance of various deposits" and "end of last month" are the corresponding values. Formula variables are defined using "...". "" serves as a start and end placeholder, containing the formula variable name in between. If the formula variable contains configuration parameters, the parameter name and value conditions are placed in "". Within the formula, multiple parameters are separated by commas. For example, "Institutional Indicator Value [Assessment Indicator = Average Daily Balance of Various Deposits, Assessment Date = End of Last Month]" represents a variable with two parameters. If some parameters are not entered by the user, such as "Assessment Date", the default value will be used automatically. When the user enters the formula, they should enter the following: When the user selects a variable, a selection box automatically pops up. When the user selects a parameter name, a selection box is provided for them to choose the parameter name. Then, based on the selected parameter, a selection box automatically pops up for the user to choose the specific value. This process ensures that the user can flexibly select or ignore parameters, while automatically handling missing parameters to ensure the formula executes correctly. For example, if the user does not select "Assessment Date", the current date is used as the default value, thus ensuring that the formula can continue to execute without errors.

[0076] In this embodiment, by guiding the user to gradually select configuration parameters and value conditions, the configuration of each target formula variable is ensured to be accurate and meet the calculation requirements. When the user selects a configuration parameter and specifies value conditions, the selected content is immediately applied to the calculation process. This not only improves the flexibility of configuration but also avoids the user selecting invalid or irrelevant options. If no valid selection is made, the configuration item is automatically cleared, ensuring that the target calculation formula is not affected by redundant or erroneous data. In this way, potential errors caused by invalid configurations are effectively avoided, improving the reliability and accuracy of the calculation process.

[0077] In one embodiment, the step of verifying the target calculation formula includes:

[0078] The data source configuration information in the target calculation formula is validated for data source rules, and each symbol is checked for formula syntax rules.

[0079] Among them, data source rules refer to the rules that constrain and standardize the variables, parameters, and their value ranges in the data source during formula configuration and data processing. Formula syntax rule checking refers to analyzing the formula structure to ensure that the formula syntax conforms to predefined specifications and prevents formatting errors or invalid operations.

[0080] Specifically, analyzing the symbols in the formula, such as " "、" Use symbols such as ", "=", and commas to check if their usage conforms to predefined formula syntax rules. For example, ensure that each " Placeholders appear in pairs, each... The parameters within the formula are checked for correctness, and the equals sign and comma conform to grammatical requirements. It also checks whether these symbols appear in valid positions, such as whether operators are between two valid operands and whether parentheses are correctly paired. Simultaneously, it checks whether each formula variable name referenced in the formula exists and is valid, ensuring that the formula variables are correctly obtained from the predefined data source. For each configuration parameter required by the formula variable, it checks whether the parameter name matches the preset, and verifies whether the value conditions of each configuration parameter conform to the predefined value range. For example, if the formula involves "examination date," it verifies whether the date is within a valid range. Understandably, for optional parameters, if the user does not input a value, the parameter is assigned a default value; if the parameter value exceeds the preset range, an error is displayed and the formula is prevented from saving.

[0081] In this embodiment, by validating formula syntax rules and data source rules, it can be ensured that the formula entered by the user will not have syntax errors or fail to calculate due to invalid parameters. Formula syntax rule validation can avoid the incorrect use of special symbols and operators, ensuring the correctness of the formula structure; while data source rule validation ensures that the formula variable names and parameter values ​​referenced in the formula conform to the preset data source rules, avoiding invalid formulas or inaccurate execution results due to data mismatch or invalid values.

[0082] In one embodiment, the step of decomposing the target calculation formula to obtain the target formula structure includes:

[0083] Each target configuration item is identified in the target calculation formula, and the format of each target configuration item is converted into a structured format while retaining the calculation rules of the target calculation formula, thus obtaining the target formula structure.

[0084] Specifically, the first step is to analyze each target configuration item in the target calculation formula. This can be done by scanning the placeholders in the formula to extract each formula variable and its corresponding configuration parameter name and value conditions. For example, the formula " Institutional performance indicators [Performance indicator = average daily balance of all deposits over the years, assessment date = end of last month] In this context, "Institutional Indicator Value" is the formula variable, "Assessment Indicator" and "Assessment Date" are configuration parameters, and "Average Daily Balance of Various Deposits" and "End of Last Month" are value retrieval conditions. Once the target configuration item is identified, it undergoes format conversion, transforming it from its original formula form into a structured format such as JSON or a database table. For example, "Institutional Indicator Value" and its related parameters "Assessment Indicator" and "Assessment Date" are converted into a structured data block, recording each attribute and its value. During the conversion process, the calculation rules of the target formula, i.e., the operational logic between formula variables, such as addition and division, must be preserved. These rules, along with the relevant configuration items, are stored together to form the target formula structure.

[0085] In this embodiment, by identifying configuration items in the target calculation formula and converting them into a structured format while preserving the calculation rules, the correct parsing and execution of the formula are ensured. This not only improves data consistency and storage efficiency but also enhances flexibility and scalability, enabling it to quickly adapt to different formula configurations and algorithm adjustments.

[0086] In one embodiment, the step of converting the target formula structure into a numerical formula containing multiple target parameter values ​​based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula includes:

[0087] Based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula, obtain the target parameter value corresponding to each target formula variable;

[0088] Replace each structured target configuration item in the target formula structure with the target parameter value of the corresponding target formula variable to obtain the numerical formula.

[0089] Specifically, based on the mapping relationship between target formula variables and target variable SQL statements, SQL queries are automatically executed to retrieve relevant data from the database and obtain the target parameter values ​​for each target formula variable. For example, if the target formula variable is "institutional indicator value," the corresponding SQL statement might query the corresponding data in the "institutional indicator table" and return the actual value of that data. Within the target formula structure, each target configuration item is identified, and according to predefined rules, the target formula variables are replaced with their corresponding target parameter values. For instance, the "institutional indicator value" in the target formula structure is replaced by the actual value returned by the query, forming a numerical formula. Based on the final generated numerical formula containing the actual values, numerical calculations can be performed directly.

[0090] In one example, the SQL query statement corresponding to each formula variable is first found, and the configuration items in the formula structure are replaced according to predefined rules. For example, suppose there is a formula ` Institutional performance indicators [Performance indicator = average daily balance of all deposits over the years, assessment date = end of last month] / Institutional planned value [Performance indicator = Average daily balance of various deposits] * Weight For each parameter, the system first checks if the user has entered the parameter name and corresponding value. If the user has entered them, these values ​​will be used first; if not, the default value will be used first. If there is no default value and the parameter is not required, the parameter and the SQL fragment will be ignored to ensure the integrity of the SQL query statement. After the parameter values ​​are replaced, the formula is finally parsed as follows: This indicates that the parameter has been successfully replaced and the value has been calculated.

[0091] In this embodiment, by automatically obtaining the target parameter values ​​corresponding to the target formula variables and replacing them in the target formula structure, a numerical formula that can be actually calculated can be quickly and accurately generated from a structured format. This not only ensures the consistency and correctness of the data but also avoids errors or inconsistencies caused by manual input. Furthermore, through structured processing, the formula can be clearly parsed, making the entire formula execution process more efficient and accurate. Thus, the stability and flexibility in processing complex formulas can be greatly improved, ensuring that the results meet expectations and increasing computational efficiency.

[0092] In one embodiment, the step of performing the calculation to obtain the result of the target calculation formula includes:

[0093] Determine the dependencies in the target calculation formula, and perform calculations according to the execution order of the numerical formulas based on the dependencies to obtain the calculation result of the target calculation formula.

[0094] In this context, dependency refers to a computational formula where the result of certain variables or formulas depends on the results of other formulas. During the computation process, some calculations must be performed first to provide the necessary input for other calculations. Execution order refers to the sequence of execution steps automatically determined based on dependencies when processing the target computational formula. This sequential arrangement ensures that the input data for each computational step is ready, avoiding erroneous calculations due to incorrect computation order.

[0095] Specifically, the process first analyzes all variables and formulas in the target calculation formula to identify which formulas reference the results of other formulas. For example, if the target calculation formula is C=A+B, where A is a result calculated by another formula and B is a direct numerical constant, then the results of A and B are used as inputs to calculate C. Based on the dependencies between variables in the target calculation formula, an execution order is automatically generated. First, it determines which formulas do not depend on the results of other formulas. Then, according to the dependencies, it ensures that formulas that do not depend on other formulas are executed first, followed by formulas that depend on other formulas. For example, if in the formula C=A+B, A and B are calculated independently, then A and B are calculated first, and C is calculated last. In one example, assuming the target calculation formula is X=A*B+C, where A depends on the formula A=D+E, and B and C do not depend on other formulas, then D and E are calculated first to obtain the value of A, then B and C are calculated, and finally X is calculated.

[0096] Once the dependencies and execution order are determined, the variables in the target calculation formula are replaced with actual numerical values ​​or expressions to generate a specific numerical formula. For example, in the formula X=A+B, A and B will be replaced with calculated numerical values ​​or sub-formulas, ultimately generating a numerical formula that can be executed directly.

[0097] In this embodiment, by automatically determining the dependencies in the target calculation formula and generating the execution order accordingly, the smooth progress of the calculation can be ensured, avoiding calculation errors caused by incorrect execution order or missing dependencies, thereby improving the accuracy and efficiency of the calculation. Furthermore, through this automatic identification of dependencies and automatic generation of the execution order, the calculation order can be dynamically adjusted when the user modifies or adds new formulas, reducing manual intervention and improving flexibility and scalability. Ultimately, while ensuring the accuracy of the calculation results, the execution efficiency of the calculation can be improved, unnecessary waste of computing resources can be reduced, and the calculation process can be optimized.

[0098] The formula configuration apparatus provided in the embodiments of this application is described below. The formula configuration apparatus described below can be referred to in correspondence with the formula configuration method described above. For example Figure 2 As shown, this application provides a formula configuration device, the device comprising:

[0099] Formula data source configuration information receiving module 201 is used to receive formula data source configuration information. The formula data source configuration information includes multiple preset formula variables and their corresponding preset configuration parameters, as well as preset variable SQL statements. The preset variable SQL statements are used to obtain preset parameter values ​​from the preset data source of each preset configuration parameter corresponding to the preset formula variable.

[0100] The target calculation formula acquisition module 202 is used to acquire the target calculation formula, which is pre-configured according to the formula data source configuration information and includes at least the target formula variables.

[0101] The target calculation formula verification module 203 is used to verify the target calculation formula, and when the target calculation formula passes the verification, it decomposes the target calculation formula to obtain the target formula structure.

[0102] The calculation result determination module 204 is used to convert the target formula structure into a numerical formula containing multiple target parameter values ​​based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula, and to perform the calculation to obtain the calculation result of the target calculation formula.

[0103] In one embodiment, the target calculation formula includes multiple target configuration items, each target configuration item including target formula variables and their corresponding target configuration parameters, as well as the target value conditions for each target configuration parameter; the target calculation formula acquisition module 202 includes:

[0104] The target formula variable acquisition unit is used to pop up a formula variable selection box when it receives a placeholder indicating the start of formula variable input, so as to acquire the target formula variable from various preset target formula variables;

[0105] The target configuration parameter acquisition unit is used to, for each target formula variable, when it receives a placeholder indicating the start of inputting configuration parameters, pop up the configuration parameter selection box corresponding to the target formula variable, and obtain the target configuration parameter and its target value condition corresponding to the target formula variable based on the selection result in the configuration parameter selection box;

[0106] The target calculation formula acquisition unit is used to, for each target formula variable, take the target formula variable and its corresponding target configuration parameters, as well as the value conditions of each target configuration parameter, as target configuration items, and obtain the calculation rules between each target configuration item to obtain the target calculation formula.

[0107] In one embodiment, the target configuration parameter acquisition unit includes:

[0108] The first target configuration parameter acquisition subunit is used to, when any preset configuration parameter corresponding to the target formula variable is selected in the configuration parameter selection box, use the selected preset configuration parameter as the target configuration parameter corresponding to the target formula variable, and then pop up the value condition selection box for the target configuration parameter. If any preset value condition corresponding to the target configuration parameter is selected in the value condition selection box, the selected preset value condition is used as the target value condition for the target configuration parameter; otherwise, the target value condition is set to empty.

[0109] The second target configuration parameter acquisition sub-unit is used to set the target configuration parameter and the corresponding target value condition of the target formula variable to empty when none of the preset configuration parameters corresponding to the target formula variable are selected in the configuration parameter selection box.

[0110] In one embodiment, the target calculation formula verification module 203 includes:

[0111] The target calculation formula verification unit is used to verify the data source rules of the formula data source configuration information in the target calculation formula and to check the formula syntax rules for each symbol.

[0112] In one embodiment, the target calculation formula verification module 203 includes:

[0113] The target formula structure determination unit is used to identify each target configuration item in the target calculation formula, convert the format of each target configuration item into a structured format, and retain the calculation rules of the target calculation formula to obtain the target formula structure.

[0114] In one embodiment, the calculation result determination module 204 includes:

[0115] The target parameter value acquisition unit is used to obtain the target parameter value corresponding to each target formula variable based on the target variable SQL statement corresponding to each target formula variable in the target calculation formula.

[0116] The numerical formula determination unit is used to replace each structured target configuration item in the target formula structure with the target parameter value of the corresponding target formula variable to obtain the numerical formula.

[0117] In one embodiment, the calculation result determination module 204 includes:

[0118] The calculation result determination unit is used to determine the dependencies in the target calculation formula, and perform calculations according to the execution order of the numerical formulas based on the dependencies, so as to obtain the calculation result of the target calculation formula.

[0119] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the formula configuration method as described in any of the above embodiments.

[0120] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the formula configuration method as described in any of the above embodiments.

[0121] Indicatively, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 3 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the formula configuration method of any of the above embodiments.

[0122] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0123] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0124] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this document, "a," "an," "the," "the," and "its" may also include plural forms unless the context clearly indicates otherwise. "Multiple" refers to at least two, such as 2, 3, 5, or 8, etc. "And / or" includes any and all combinations of the related listed items.

[0125] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0126] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of formula configuration, characterized by, The method comprises: receiving formula data source configuration information, the formula data source configuration information comprising a plurality of preset formula variables and corresponding respective preset configuration parameters, and a preset variable SQL statement for obtaining preset parameter values from a preset data source corresponding to each preset configuration parameter of a preset formula variable; when a placeholder indicating the start of input of a formula variable is received, a formula variable selection box is popped up to obtain a target formula variable from respective preset target formula variables; for each target formula variable, when a placeholder indicating the start of input of a configuration parameter is received, a configuration parameter selection box corresponding to the target formula variable is popped up, and a target configuration parameter corresponding to the target formula variable and a target value condition of the target configuration parameter are obtained according to a selection result in the configuration parameter selection box; for each target formula variable, the target formula variable and the target configuration parameter corresponding thereto, and the value condition of each target configuration parameter corresponding thereto are taken as target configuration items, and a calculation rule between respective target configuration items is obtained to obtain a target calculation formula; the target calculation formula is checked, and when the target calculation formula passes the check, the target calculation formula is decomposed to obtain a target formula structure of the target calculation formula; the target formula structure is converted into a numerical formula comprising a plurality of target parameter values according to a target variable SQL statement corresponding to each target formula variable in the target calculation formula, and an operation is performed to obtain a calculation result of the target calculation formula.

2. The formula configuration method according to claim 1, characterized by, The step of obtaining the target configuration parameter corresponding to the target formula variable and the target value condition of the target configuration parameter according to the selection result in the configuration parameter selection box comprises: when any preset configuration parameter corresponding to the target formula variable in the configuration parameter selection box is selected, the selected preset configuration parameter is taken as the target configuration parameter corresponding to the target formula variable, and then a value condition selection box of the target configuration parameter is popped up, and if any preset value condition corresponding to the target configuration parameter in the value condition selection box is selected, the selected preset value condition is taken as the target value condition of the target configuration parameter, otherwise, the target value condition is set as empty; when none of the preset configuration parameters corresponding to the target formula variable in the configuration parameter selection box is selected, the target configuration parameter corresponding to the target formula variable and the target value condition corresponding thereto are set as empty.

3. The formula configuration method according to claim 1, characterized by, The step of checking the target calculation formula comprises: a data source rule verification is performed on formula data source configuration information in the target calculation formula, and a formula syntax rule check is performed on each symbol.

4. The formula configuration method according to claim 1, characterized by, The step of decomposing the target calculation formula to obtain the target formula structure of the target calculation formula comprises: each target configuration item in the target calculation formula is identified, a format of each target configuration item is converted into a structured format, and a calculation rule of the target calculation formula is retained to obtain the target formula structure.

5. The formula configuration method according to claim 4, characterized by, The step of converting the target formula structure into a numerical formula containing a plurality of target parameter values according to a target variable SQL statement corresponding to each target formula variable in the target calculation formula, comprises: According to the target variable SQL statement corresponding to each target formula variable in the target calculation formula, obtaining the target parameter value corresponding to each target formula variable; Each structured target configuration item in the target formula structure is replaced by the target parameter value of the corresponding target formula variable to obtain the numerical formula.

6. The method of claim 1 to 5, wherein, The step of performing operation to obtain the calculation result of the target calculation formula, comprises: Determine the dependency relationship in the target calculation formula, and perform operation according to the execution order of the numerical formula to obtain the calculation result of the target calculation formula.

7. A formula configuration device characterized by comprising: The device comprises: The formula data source configuration information receiving module is configured to receive formula data source configuration information, wherein the formula data source configuration information comprises a plurality of preset formula variables and corresponding preset configuration parameters of each preset formula variable, and a preset variable SQL statement, wherein the preset variable SQL statement is used to obtain a preset parameter value from a preset data source corresponding to each preset configuration parameter of a preset formula variable; The target calculation formula obtaining module is configured to pop up a formula variable selection box when a placeholder indicating the start of inputting a formula variable is received, so as to obtain a target formula variable from each preset target formula variable; for each target formula variable, a configuration parameter selection box corresponding to the target formula variable is popped up when a placeholder indicating the start of inputting a configuration parameter is received, and a target configuration parameter corresponding to the target formula variable and a target value condition of each target configuration parameter are obtained according to the selection result in the configuration parameter selection box; for each target formula variable, the target formula variable and the target configuration parameter corresponding thereto, and the value condition of each target configuration parameter corresponding thereto are taken as a target configuration item, and a calculation rule between each target configuration item is obtained to obtain the target calculation formula; The target calculation formula checking module is configured to check the target calculation formula, and decompose the target calculation formula to obtain a target formula structure of the target calculation formula when the target calculation formula passes the check; The calculation result determining module is configured to convert the target formula structure into a numerical formula containing a plurality of target parameter values according to a target variable SQL statement corresponding to each target formula variable in the target calculation formula, and perform operation to obtain the calculation result of the target calculation formula.

8. A storage medium characterized by: The storage medium stores computer readable instructions, and the computer readable instructions are executed by one or more processors to perform the steps of the formula configuration method according to any one of claims 1 to 6.

9. A computer device, comprising: Comprise: One or more processors, and a memory; The memory stores computer readable instructions, and the computer readable instructions are executed by the one or more processors to perform the steps of the formula configuration method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Formula custom configuration method and related device

    CN112394976A

  • Financial data processing method and device

    CN118427208A