Formula configuration method and device, storage medium and computer equipment

By receiving formula data source configuration information and dynamically obtaining parameter values, the problem of insufficient flexibility in traditional methods is solved, and more efficient and accurate data processing is achieved to adapt to complex and personalized business needs.

CN119690991AActive Publication Date: 2025-03-25GUANGZHOU TIANCOM INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411993863.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-25
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Traditional formula input methods are poorly flexible and cannot effectively respond to complex and personalized data processing needs. They require manual intervention and redevelopment in the face of dynamically changing algorithms or formulas, resulting in inefficiency and increased risk of errors.

Method used

Provide a formula configuration method, which dynamically obtains parameter values ​​by receiving formula data source configuration information, and adjusts calculation formulas in real time according to preset variable SQL statements. The method includes receiving the formula data source configuration information, obtaining the target calculation formula, verifying and decomposing the formula, converting it into a numerical formula and performing operations to obtain the calculation result.

Benefits of technology

It improves the flexibility and dynamic nature of data processing, reduces the need for manual intervention, reduces the risk of errors, improves the efficiency and timeliness of data processing, and supports efficient and accurate computing results in a changing business environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690991A_ABST
    Figure CN119690991A_ABST
Patent Text Reader

Abstract

In the formula configuration method provided by the invention, formula data source configuration information is received, and the formula data source configuration information comprises a plurality of preset formula variables, preset configuration parameters corresponding to the preset formula variables and preset variable SQL statements; the preset variable SQL statement is used for acquiring a preset parameter value from a preset data source of each preset configuration parameter corresponding to the preset formula variable; a target calculation formula is obtained, and the target calculation formula is pre-configured according to the formula data source configuration information and comprises a target formula variable; 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; and according to a target variable SQL statement corresponding to each target formula variable in the target calculation formula, converting the target formula structure into a numerical formula containing a plurality of target parameter values, and then executing operation to obtain a calculation result of the target calculation formula. Therefore, the flexibility of formula input is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a formula configuration method, apparatus, storage medium and computer equipment. Background Art

[0002] With the rapid development of information technology, data processing and analysis are facing unprecedented challenges. With the rapid growth of data volume, users' demands for data processing are becoming increasingly complex, requiring more flexible and dynamic solutions. Traditional data processing methods, especially static processing methods based on fixed formulas and preset algorithms, can no longer meet the needs of modern data processing for flexibility and dynamism.

[0003] Nowadays, when building performance management systems, industries such as banks often face highly personalized needs, and traditional formula input methods are less flexible. Although some systems have introduced parameterized formulas that allow parameters to be adjusted within a certain range, these methods are still unable to effectively cope with complex needs that exceed the preset range. In addition, when users face dynamically changing algorithms or formulas, manual intervention and redevelopment are still required, resulting in inefficiency, increasing the risk of errors, and affecting the accuracy and timeliness of data processing. Summary of the invention

[0004] The purpose of the present application is to solve at least one of the above-mentioned technical deficiencies, especially 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] Receive formula data source configuration information, the formula data source configuration information includes multiple preset formula variables and their corresponding preset configuration parameters, and preset variable SQL statements, the preset variable SQL statements are 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, where the target calculation formula is pre-configured according to the formula data source configuration information and at least includes 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] According to the target variable SQL statement 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 the operation is performed to obtain the calculation result of the target calculation formula.

[0010] In one embodiment, the target calculation formula includes a plurality of target configuration items, each target configuration item includes a target formula variable and its corresponding target configuration parameter, and a target value condition of each corresponding target configuration parameter;

[0011] The steps of obtaining the target calculation formula include:

[0012] When receiving a placeholder for indicating the start of inputting a formula variable, a formula variable selection box pops up to obtain a target formula variable from various preset target formula variables;

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

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

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

[0016] 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 used as the target configuration parameter corresponding to the target formula variable, and then a value condition selection box for the target configuration parameter pops up. 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 used as the target value condition of the target configuration parameter, otherwise, the target value condition is left blank;

[0017] 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 and the corresponding target value condition corresponding to the target formula variable are left blank.

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

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

[0020] In one embodiment, the step of decomposing the target calculation formula to obtain a target formula structure of the target calculation formula 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, and the calculation rules of the target calculation formula are retained to obtain 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 ​​according to the target variable SQL statement corresponding to each target formula variable in the target calculation formula includes:

[0023] According to 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] Each structured target configuration item in the target formula structure is replaced with the target parameter value of the corresponding target formula variable to obtain a numerical formula.

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

[0026] Determine the dependencies in the target calculation formula, and perform operations after confirming the execution order of the numerical formula according to the dependencies to obtain the calculation result of the target calculation formula.

[0027] In a second aspect, the present application provides a formula configuration device, the device comprising:

[0028] A formula data source configuration information receiving module is used to receive formula data source configuration information, the formula data source configuration information includes a plurality of preset formula variables and their corresponding preset configuration parameters, and preset variable SQL statements, the preset variable SQL statements are used to obtain preset parameter values ​​from a preset data source of each preset configuration parameter corresponding to the preset formula variable;

[0029] A target calculation formula acquisition module is used to acquire a target calculation formula, where the target calculation formula is pre-configured according to the formula data source configuration information and at least includes target formula variables;

[0030] A target calculation formula verification module is used to verify the target calculation formula, and when the target calculation formula passes the verification, decompose the target calculation formula to obtain a target formula structure of the target calculation formula;

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

[0032] In a third aspect, the present application provides a storage medium: the storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the formula configuration method in any one of the above embodiments.

[0033] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0034] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the formula configuration method in any of the above embodiments are performed.

[0035] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0036] The formula configuration method provided in this application can effectively improve the flexibility and dynamism of data processing, and solves the problem that fixed formulas and preset algorithms in traditional methods cannot adapt to complex needs. Specifically, the method receives the formula data source configuration information and dynamically obtains parameter values ​​according to the preset variable SQL statement, so as to adjust the calculation formula in real time according to the needs and realize 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, reducing the risk of errors, and improving the efficiency and timeliness of data processing. In addition, the method supports maintaining efficient and accurate calculation results in a changing business environment by dynamically calculating the target formula. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0038] Figure 1 A flow chart of a formula configuration method provided in an embodiment of the present application;

[0039] Figure 2 A schematic diagram of the structure of a formula configuration device provided in an embodiment of the present application;

[0040] Figure 3 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] The present application provides a formula configuration method. The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with data processing functions, including but not limited to a single server, a server cluster, a personal laptop computer, a 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, and preset variable SQL statements, the preset variable SQL statements are used to obtain preset parameter values ​​from a preset data source of each preset configuration parameter corresponding to the preset formula variable.

[0044] Among them, the formula data source configuration information refers to the relevant configuration parameters of the data source for formula calculation, including multiple formula variables, the preset configuration parameters required for each formula variable, and the SQL statement to obtain the parameter value 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 needed in the formula calculation process. These variables are pre-set in the formula data source and are 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, value range, etc., which are used to define the value rules of formula variables in different scenarios. In an example, "institutional indicator value" is used as a formula variable, and its required configuration parameters include assessment indicators. The attributes of the assessment indicators include the Chinese name of the assessment indicator, the English name of the APRLKPI_CODE, the user input value is entered according to the requirements and the system default value when no input is made, and the value source range is the assessment indicator library or custom. Among them, the Chinese name is the Chinese expression 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 identifies whether the parameter requires direct user input or the system defaults; the value source range is used to define the value range or source of the parameter.

[0045] The preset variable SQL statement refers to the SQL query statement used to query and obtain the parameter value corresponding to the preset formula variable from the database. The SQL statement extracts the necessary information from the data source according to the configuration of the preset variables and parameters. In an example, assuming that the formula variable is the institutional indicator value, it is necessary to configure the SQL statement of its data source and define the relevant parameters. These parameters are used as variables dynamically passed in in the SQL statement to filter data. The configuration parameters of the institutional indicator value include the assessment indicator (parameter name: APRLKPI_CODE), the assessment date (parameter name: STAT_DT) and the institutional grade (parameter name: ORG_GRD). Therefore, for the "institutional indicator value" formula variable, its 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}, representing the parameter values ​​of assessment indicators, assessment date and institution level respectively; for string type parameters, single quotes are required in SQL statements, while for non-string type parameters, single quotes are not required; the return fields of SQL include key and value, key represents the returned primary key, including the specific institution or bank member primary key, and value represents the returned value.

[0046] In this step, the configuration information transmitted from the outside or inside can be received through the 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 is used to read the configuration information and convert it into an internal data structure. Assuming a performance management system of a bank, the user selects "assessment indicators" and "assessment date" in the configuration interface, and these parameters can be received through the API. It should be noted that the formula data source configuration allows users to dynamically add, delete and modify according to business needs.

[0047] Furthermore, after receiving the configuration information, the received data can be verified to ensure that it complies with the preset format, scope, and validity. For example, check whether the field type is correct, whether the required fields are filled in, whether the date format meets the requirements, etc. For example, if the "assessment date" field is received, verify whether it complies with the "YYYY-MM-DD" format. The verified configuration information can be stored in memory or persistent storage. The storage method will vary depending on the life cycle and access frequency of the data.

[0048] It can be understood that by receiving the formula data source configuration information, it is possible to flexibly adapt to different business needs, automatically obtain the required calculation parameters, and improve the accuracy and real-time performance of the calculation 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 a target calculation formula, where the target calculation formula is pre-configured according to formula data source configuration information and at least includes target formula variables.

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

[0051] In this step, the target calculation formula can be received from a database, a configuration file, or an external interface, that is, the target calculation formula is pre-configured by the user based on the formula data source configuration information and then transmitted to the computer device, and must contain the target formula variables. For example, if the net profit margin needs to be calculated, and both the net profit and the total income are formula variables, the user can only enter "net profit / total income" in the formula configuration interface and confirm, and the computer device can obtain the target calculation formula, and the target formula variables are net profit and total income. It should be noted that the target calculation formula includes at least formula variables because formula variables are parameters or data items that change dynamically during the calculation process. They obtain actual values ​​from preset data sources or inputs, and ultimately affect the calculation results. If the target calculation formula does not include formula variables, dynamic calculations related to specific data or parameters cannot be completed. Therefore, as a core part, formula variables ensure that the calculation formula can be dynamically adjusted according to the input data and environment, and provide personalized and accurate calculation results.

[0052] It can be understood that by pre-defining and configuring the target calculation formula according to the formula data source configuration information, data calculation tasks can be automatically executed flexibly and dynamically according to different application scenarios. The target formula variable, as a key element in the formula, ensures that the calculation formula can fill in the corresponding variable value according to the real-time input parameters and data when it is executed. In this way, not only the accuracy and efficiency of the calculation are improved, but also the need for manual intervention is greatly reduced, so as to quickly adapt to different business needs and data changes.

[0053] S103: 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.

[0054] The target calculation formula structure is to break down the target calculation formula into a more detailed and operational structure. The target formula structure provides a clear execution path and calculation logic for executing the formula.

[0055] In this step, the grammatical structure of the formula is first analyzed to ensure that each part of the formula complies with the preset rules. The verification process can be performed using a parser, which converts the formula string into a data structure and checks whether the syntax is correct. For the data types involved, the parser also checks the type compatibility, such as whether the operations of integers and floating-point numbers are compliant. For example, if the target calculation formula is Net Profit / Total Revenue First, confirm whether net profit and total income are defined formula variables, and check whether the division operator can be legally applied to the data types of these two variables. After the target calculation formula is verified, the formula can be broken down into multiple simple operations based on the structure of operators and brackets 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] It can be understood that, firstly, verification ensures the legitimacy and accuracy of the formula, which helps prevent users from entering incorrect formulas or formulas that do not comply with the calculation rules, and avoids calculation failures or inaccurate results caused by incorrect formulas. Secondly, decomposing the target calculation formula can simplify the calculation process, making the calculation steps clearer and the operation more efficient. After decomposing a complex formula into basic calculation units, each operation can be performed step by step, rather than processing the entire formula at once, reducing the complexity in the calculation.

[0057] S104: According to the target variable SQL statement 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 an operation is performed to obtain a calculation result of the target calculation formula.

[0058] The target variable SQL statement refers to an SQL query statement for obtaining parameter values ​​required by the target formula variable from a database or other data source, and can dynamically obtain data corresponding to the formula variable to fill in the formula.

[0059] In this step, according to each target formula variable, the corresponding target variable SQL statement is found. For example, if the formula variable is sales, an SQL query is executed to obtain the corresponding sales data from the database. Once the target variable SQL statement is obtained and the query is successfully executed, the returned parameter value will be filled into the placeholder of the formula, so that the target calculation formula is converted into a specific numerical formula. For example, if the target formula structure is sales / total cost, the actual sales and total cost data are used to replace the variables in the formula to form a complete numerical formula. The converted numerical formula can be used directly for calculation, that is, actual operations are performed on the numerical values ​​in the formula, such as division, multiplication, etc., and finally the calculation result is obtained. For example, assuming that the target formula is sales / total cost, the sales and total cost values ​​​​queried will be used for division operations to obtain the final calculation result.

[0060] It can be understood that by first obtaining the target variable SQL statement, then converting the target formula structure into a numerical formula containing multiple target parameter values, and finally performing the operation, it can ensure that each variable in the formula is correctly filled and calculated. This execution process can ensure the dynamics and flexibility of the formula, especially when real-time data needs to be obtained from external data sources. Through automated numerical filling and operation, not only the accuracy of the calculation is improved, but also the efficiency of the calculation is improved.

[0061] In the above embodiments, the flexibility and dynamism of data processing can be effectively improved, and the problem that fixed formulas and preset algorithms in traditional methods cannot adapt to complex needs is solved. Specifically, the method receives the formula data source configuration information and dynamically obtains parameter values ​​according to the preset variable SQL statement, so that the calculation formula can be adjusted in real time according to the needs to achieve 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, reducing the risk of errors, and improving the efficiency and timeliness of data processing. In addition, the method supports maintaining efficient and accurate calculation results in a constantly changing business environment by dynamically calculating the target formula.

[0062] In one embodiment, the target calculation formula includes multiple target configuration items, each target configuration item includes a target formula variable and its corresponding target configuration parameter, and a target value condition for each corresponding target configuration parameter;

[0063] The steps of obtaining the target calculation formula include:

[0064] When receiving a placeholder for indicating the start of inputting a formula variable, a formula variable selection box pops up to obtain a target formula variable from various preset target formula variables;

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

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

[0067] Among them, the target configuration item is the basic component of the target calculation formula. Each target configuration item includes a target formula variable and its corresponding target configuration parameter, as well as the value conditions of these parameters, which together define how to obtain and use relevant data to complete the calculation. The target configuration parameter is the parameter corresponding to the target formula variable, which defines how to specify the data requirements of the target formula variable. For example, a variable may have multiple parameters, and these parameters may affect the calculation results. The target value condition is a condition related to the target configuration parameter, which is used to limit or filter the source or range of data to ensure that the selected data meets the predetermined business requirements or rules.

[0068] Specifically, when a placeholder is received to indicate the start of inputting a formula variable, a formula variable selection box pops up to display a preset formula variable list, so that the user can quickly select the required formula variable without manually entering the variable name. For each target formula variable, when a placeholder is received to indicate the start of inputting a configuration parameter, appropriate configuration parameters are dynamically generated according to the options, and a configuration parameter selection box corresponding to the target formula variable pops up to display the configuration parameters that may be required for the variable. At this time, the user can select specific parameters related to the formula variable. According to the selection result in the configuration parameter selection box, the target configuration parameter corresponding to the target formula variable and its target value condition are obtained. In an example, the relevant configuration parameters and their corresponding value conditions can be obtained and filled from the data source according to the user's selection. For example, if the user selects a "time" parameter, the value range of the parameter can be obtained according to the set rules, which may be "past month" or "this quarter", etc.

[0069] For each target formula variable, the target formula variable and its corresponding target configuration parameter, as well as the corresponding value conditions of each target configuration parameter, are combined into a complete target configuration item, forming the basic components of the target calculation formula. After that, 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 the formula variable placeholder and popping up a selection box, the user can intuitively and efficiently select the required formula variables. The subsequent pop-up configuration parameter selection box and the operation of obtaining the target configuration parameters and value conditions ensure that the user can configure the appropriate parameters and their restrictions according to specific needs, thereby improving the accuracy and flexibility of the formula configuration. By integrating this information into the target configuration items and obtaining the calculation rules, all configurations can be integrated into the final target calculation formula, providing a clear and standardized basis 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 improving the accuracy and efficiency of the calculation.

[0071] In one embodiment, according to the selection result in the configuration parameter selection box, the step of obtaining the target configuration parameter corresponding to the target formula variable and the target value condition thereof includes:

[0072] 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 used as the target configuration parameter corresponding to the target formula variable, and then a value condition selection box for the target configuration parameter pops up. 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 used as the target value condition of the target configuration parameter, otherwise, the target value condition is left blank;

[0073] 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 and the corresponding target value condition corresponding to the target formula variable are left blank.

[0074] Specifically, when any preset configuration parameter corresponding to the target formula variable in the configuration parameter selection box is selected, it is first detected that the user has selected a preset configuration parameter in the configuration parameter selection box, and then the value condition selection box of the target configuration parameter pops up, and multiple selectable value conditions associated with the configuration parameter are displayed. If any preset value condition corresponding to the target configuration parameter in the value condition selection box is selected, the value condition selected by the user is applied to the target configuration parameter, and the value condition is used as the target value condition of the target configuration parameter. Otherwise, the target value condition is set to blank, that is, if the user does not select a valid value condition, the target value condition will be in an uninput state. When none of the preset configuration parameters corresponding to the target formula variable in the configuration parameter selection box are selected, all target configuration parameters and their value conditions corresponding to the target formula variable are set to blank, that is, the target configuration parameter and its target value condition will be in an uninput state. It should be noted that the target formula variable is the core part of the target calculation formula and is mandatory, 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 directly 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. Taking "Institutional Indicator Value" as an example, the formula may contain something like " Institutional indicator value [assessment indicator = average daily balance of various deposits, assessment date = end of previous month] " structure, where "assessment index" and "assessment date" are parameter names, "average daily balance of each deposit" and "end of last month" are corresponding values, and the formula variables are " " as the placeholder for the start and end, with the formula variable name in the middle. If the formula variable contains configuration parameters, the parameter name and value condition are placed in " ", multiple parameters are separated by ", ". 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 is automatically used instead. When the user enters the formula, after entering " ", a selection box will automatically pop up for users to select variables, and a selection box will be provided for users to select parameter names when "[" is entered. Then, a selection box will automatically pop up based on the selected parameter to allow users to select specific values. This process ensures that users can flexibly select or ignore parameters, while automatically handling missing parameters to ensure that the formula is executed correctly. For example, if the user does not select "Assessment Date", the current date is used as the default value, thereby 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, it is ensured that the configuration of each target formula variable is accurate and meets the calculation requirements. When the user selects a configuration parameter and specifies the value conditions, the selected content is immediately applied to the calculation process, which not only improves the flexibility of the configuration, but also avoids the user from selecting invalid or irrelevant options. If there is no valid selection, the configuration item is automatically blanked to ensure that the target calculation formula is not interfered with by redundant or erroneous data. In this way, potential errors caused by invalid configurations are effectively avoided, and the reliability and accuracy of the calculation process are improved.

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

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

[0079] Data source rules refer to the rules that constrain and regulate 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 prevent format errors or invalid operations.

[0080] Specifically, symbols in the parsing formula, such as " ”、" ", "=", commas, etc., check whether the use of symbols complies with the predefined formula syntax rules. For example, make sure that each " "Placeholders appear in pairs, each " " The parameters in the formula are correct, and the equal sign and comma meet the grammatical requirements. It will also check whether these symbols appear in legal positions, such as whether the operator is between two legal operands, whether the brackets are correctly paired, etc. At the same time, check whether each formula variable name referenced in the formula exists and is valid, and ensure that the formula variables are correctly obtained from the predefined data source. For each configuration parameter required by the formula variable, check whether its parameter name is consistent with the preset, and verify whether the value condition of each configuration parameter meets the predefined value range. For example, if the formula involves "assessment date", verify whether the date is within the valid range. It can be understood that for optional parameters, if the user does not enter, the parameter is assigned a default value. If the parameter value exceeds the preset range, an error is prompted and the formula is prevented from being saved.

[0081] In this embodiment, the formula syntax rule and data source rule verification can ensure that the formula entered by the user will not have syntax errors or calculation failures due to invalid parameters when executed. Formula syntax rule verification can avoid the incorrect use of special symbols and operators and ensure the correctness of the formula structure; while data source rule verification ensures that the formula variable names and parameter values ​​referenced in the formula comply with the preset data source rules, avoiding invalid formulas or inaccurate execution results due to data mismatch or illegal values.

[0082] In one embodiment, the step of decomposing the target calculation formula to obtain the target formula structure of the target calculation formula 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, and the calculation rules of the target calculation formula are retained to obtain the target formula structure.

[0084] Specifically, you first need to parse each target configuration item in the target calculation formula. You can extract each formula variable and its corresponding configuration parameter name and value condition by scanning the placeholders in the formula. For example, the formula " Institutional indicator value [assessment indicator = average daily balance of various deposits, assessment date = end of previous month] "Institutional indicator value" is a formula variable, "assessment indicator" and "assessment date" are configuration parameters, and "average daily balance of each deposit" and "end of last month" are value conditions. Once the target configuration item is identified, it is formatted and converted from the original formula form to a structured format, such as JSON or a database table. For example, the "institutional indicator value" and its related parameters "assessment indicator" and "assessment date" are converted into a structured data block to record various attributes and their values. During the conversion process, it is also necessary to retain the calculation rules of the target formula, that is, the operation logic between the formula variables, such as addition, division and other operations, store these rules and related configuration items together, and form a target formula structure.

[0085] In this embodiment, the configuration items in the target calculation formula are identified and converted into a structured format while retaining the calculation rules to ensure the correct parsing and execution of the formula. 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, according to the target variable SQL statement corresponding to each target formula variable in the target calculation formula, the step of converting the target formula structure into a numerical formula containing multiple target parameter values ​​includes:

[0087] According to 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] Each structured target configuration item in the target formula structure is replaced with the target parameter value of the corresponding target formula variable to obtain a numerical formula.

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

[0090] In an example, first find the SQL query statement corresponding to each formula variable, and replace the configuration items in the formula structure according to the pre-set rules. For example, suppose there is a formula ` Institutional indicator value [assessment indicator = average daily balance of various deposits, assessment date = end of previous month] / Institutional planned value [assessment index = annual average daily balance of various deposits] * Weight `. For each parameter, first check whether the user has entered the parameter name and the corresponding parameter value. If the user has entered, these values ​​will be used first; if not, the preset default value will be used first. If there is no preset value and the parameter is not required, the parameter and SQL fragment will be ignored to ensure the integrity of the SQL query statement. After the parameter value is replaced, the formula is finally parsed as , indicating that the parameters have been successfully replaced and the values ​​calculated.

[0091] In this embodiment, by automatically obtaining the target parameter value corresponding to the target formula variable and replacing it in the target formula structure, a numerical formula that can be actually calculated can be generated from a structured format quickly and accurately. Not only does it ensure the consistency and correctness of the data, but it also avoids manual input errors or inconsistencies. In addition, through structured processing, the formula can be clearly parsed, making the execution process of the entire formula more efficient and accurate. In this way, the stability and flexibility of processing complex formulas can be greatly improved, ensuring that the results meet expectations and improving calculation efficiency.

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

[0093] Determine the dependencies in the target calculation formula, and perform operations after confirming the execution order of the numerical formula according to the dependencies to obtain the calculation result of the target calculation formula.

[0094] Among them, dependency refers to the fact that the calculation results of certain variables or formulas in a calculation formula depend on the results of other formulas. During the calculation process, some calculations must be performed first to provide the required input for other calculations. The execution order refers to the order of execution steps automatically determined according to the dependency when processing the target calculation formula. Through this sequential arrangement, it is ensured that the input data of each calculation step is ready, avoiding incorrect calculations caused by the wrong calculation order.

[0095] Specifically, all variables and formulas in the target calculation formula are first parsed to identify which formulas refer to the calculation results of other formulas. For example, if the target calculation formula is C=A+B, where A is a result calculated by other formulas and B is a direct numerical constant, the calculation results of A and B are used as the input for calculating C. According to the dependency relationship between the variables in the target calculation formula, a calculation execution order is automatically generated. First, it is determined which formulas do not depend on the results of other formulas, and then according to the dependency relationship, it is ensured that the independent formulas are executed first, and then the formulas that depend on other formulas are executed. For example, if A and B are calculated independently in the formula C=A+B, then A and B are calculated first, and C is calculated last. In an example, assuming that 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, D and E are calculated first to obtain the value of A, then B and C are calculated, and finally X is calculated.

[0096] After the dependencies and execution order are determined, the variables in the target calculation formula are replaced with actual 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 values ​​or sub-formulas, and finally a numerical formula that can be directly executed is generated.

[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, and calculation errors caused by incorrect execution order or missing dependencies can be avoided, thereby improving the accuracy and efficiency of the calculation. In addition, through the automatic identification of such dependencies and the automatic generation of the execution order, the calculation order can be dynamically adjusted when the user modifies or adds a new formula, reducing manual intervention and improving flexibility and scalability. Ultimately, on the basis of 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 following describes the formula configuration device provided in the embodiment of the present application. The formula configuration device described below and the formula configuration method described above can be referred to in correspondence with each other. Figure 2 As shown, the present application provides a formula configuration device, the device comprising:

[0099] The formula data source configuration information receiving module 201 is used to receive formula data source configuration information, the formula data source configuration information includes a plurality of preset formula variables and their corresponding preset configuration parameters, and 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] A target calculation formula acquisition module 202 is used to acquire a target calculation formula, where the target calculation formula is pre-configured according to the formula data source configuration information and at least includes 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, decompose the target calculation formula to obtain the target formula structure of the target calculation formula;

[0102] The calculation result determination module 204 is used to convert the target formula structure into a numerical formula containing multiple target parameter values ​​according to the target variable SQL statement corresponding to each target formula variable in the target calculation formula, and perform operations 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 includes a target formula variable and its corresponding target configuration parameter, and a target value condition of each corresponding target configuration parameter; the target calculation formula acquisition module 202 includes:

[0104] A target formula variable acquisition unit, configured to pop up a formula variable selection box when receiving a placeholder for indicating the start of inputting a formula variable, so as to acquire the target formula variable from various preset target formula variables;

[0105] A target configuration parameter acquisition unit is used to, for each target formula variable, pop up a configuration parameter selection box corresponding to the target formula variable when receiving a placeholder for indicating the start of inputting configuration parameters, and acquire the target configuration parameter corresponding to the target formula variable and its target value condition according to the selection result in the configuration parameter selection box;

[0106] The target calculation formula acquisition unit is used to take each target formula variable and its corresponding target configuration parameter, as well as the corresponding value condition of each target configuration parameter, as the target configuration item for each target formula variable, 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] A first target configuration parameter acquisition subunit is used for, when any preset configuration parameter corresponding to the target formula variable in the configuration parameter selection box is selected, taking the selected preset configuration parameter as the target configuration parameter corresponding to the target formula variable, and then popping up a value condition selection box for the target configuration parameter; if any preset value condition corresponding to the target configuration parameter in the value condition selection box is selected, taking the selected preset value condition as the target value condition of the target configuration parameter; otherwise, leaving the target value condition blank;

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

[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] A target parameter value acquisition unit, used to acquire a target parameter value corresponding to each target formula variable according to a target variable SQL statement corresponding to each target formula variable in a 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 a numerical formula.

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

[0118] The calculation result determination unit is used to determine the dependency relationship in the target calculation formula, and perform operations after confirming the execution order of the numerical formula according to the dependency relationship to obtain the calculation result of the target calculation formula.

[0119] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the formula configuration method described in any one of the above embodiments.

[0120] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the formula configuration method as described in any one of the above embodiments.

[0121] Indicatively, Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 3 The computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, 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 further 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 based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

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

[0124] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.

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

[0126] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be 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 the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A formula configuration method, characterized in that: The method comprises: Receive formula data source configuration information, the formula data source configuration information including a plurality of preset formula variables and respective preset configuration parameters corresponding thereto, and preset variable SQL statements, the preset variable SQL statements being used to obtain preset parameter values ​​from a preset data source of each preset configuration parameter corresponding to the preset formula variables; Obtaining a target calculation formula, where the target calculation formula is pre-configured according to the formula data source configuration information and at least includes a target formula variable; 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; According to the target variable SQL statement 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 an operation is performed to obtain a calculation result of the target calculation formula.

2. The formula configuration method according to claim 1, characterized in that: The target calculation formula includes a plurality of target configuration items, each of which includes the target formula variable and its corresponding target configuration parameter, and a corresponding target value condition for each of the target configuration parameters; The step of obtaining the target calculation formula includes: When a placeholder for indicating the start of inputting a formula variable is received, a formula variable selection box pops up to obtain the target formula variable from each of the preset target formula variables; For each of the target formula variables, when a placeholder for indicating the start of inputting configuration parameters is received, a configuration parameter selection box corresponding to the target formula variable is popped up, and according to the selection result in the configuration parameter selection box, the target configuration parameter corresponding to the target formula variable and its target value condition are obtained; For each target formula variable, the target formula variable and its corresponding target configuration parameter, as well as the corresponding value condition of each target configuration parameter, are used as the target configuration item, and the calculation rules between the target configuration items are obtained to obtain the target calculation formula.

3. The formula configuration method according to claim 2, characterized in that: The step of obtaining the target configuration parameter and the target value condition corresponding to the target formula variable according to the selection result in the configuration parameter selection box includes: 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 used as the target configuration parameter corresponding to the target formula variable, and then a value condition selection box for the target configuration parameter pops up. 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 used as the target value condition of the target configuration parameter, otherwise, the target value condition is left blank; 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 and the corresponding target value condition corresponding to the target formula variable are left blank.

4. The formula configuration method according to claim 2, characterized in that: The step of verifying the target calculation formula includes: The formula data source configuration information in the target calculation formula is verified according to data source rules, and each symbol is checked according to formula syntax rules.

5. The formula configuration method according to claim 2, characterized in that: The step of decomposing the target calculation formula to obtain a target formula structure of the target calculation formula includes: 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, and the calculation rules of the target calculation formula are retained to obtain the target formula structure.

6. The formula configuration method according to claim 5, characterized in that: The step of converting the target formula structure into a numerical formula containing multiple target parameter values ​​according to the 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 with a target parameter value of a corresponding target formula variable to obtain the numerical formula.

7. The formula configuration method according to any one of claims 1 to 6, characterized in that: The step of performing the operation to obtain the calculation result of the target calculation formula includes: Determine the dependency relationship in the target calculation formula, and perform operations after confirming the execution order of the numerical formula according to the dependency relationship to obtain the calculation result of the target calculation formula.

8. A formula configuration device, characterized in that: The device comprises: A formula data source configuration information receiving module, used to receive formula data source configuration information, wherein the formula data source configuration information includes a plurality of preset formula variables and respective preset configuration parameters corresponding thereto, and preset variable SQL statements, wherein the preset variable SQL statements are used to obtain preset parameter values ​​from a preset data source of each preset configuration parameter corresponding to the preset formula variable; A target calculation formula acquisition module, used to acquire a target calculation formula, wherein the target calculation formula is pre-configured according to the formula data source configuration information and at least includes a target formula variable; A target calculation formula verification module is used to verify the target calculation formula, and when the target calculation formula passes the verification, decompose the target calculation formula to obtain a target formula structure of the target calculation formula; The calculation result determination module is used to convert the target formula structure into a numerical formula containing multiple target parameter values ​​according to the target variable SQL statement corresponding to each target formula variable in the target calculation formula, and perform operations to obtain the calculation result of the target calculation formula.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the formula configuration method as described in any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the formula configuration method according to any one of claims 1 to 7 are performed.

Citation Information

Patent Citations

  • Multidimensional investment index supervision method

    CN106293891A

  • Formula custom configuration method and related device

    CN112394976A

  • Formula engine development method and device, electronic equipment and storage medium

    CN112835926A

  • Index data acquisition method and device, computer equipment and storage medium

    CN115220731A

  • Data processing method, device, medium and system

    CN118227647A