Business data calculation method and device, electronic equipment and storage medium

By constructing conditional logic trees and computational abstract syntax trees to automatically generate business data calculation formulas, the inefficiency caused by formula customization in existing technologies is solved, and efficient and flexible business data calculation is achieved.

CN122633159APending Publication Date: 2026-08-25PING AN HEALTH INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610738565.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-26
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

In existing technologies, business data calculation formulas are highly customized, which means that a lot of time needs to be spent developing new formulas when different business scenarios change, resulting in low efficiency.

Method used

By acquiring business rule text, constructing conditional logic trees and computational abstract syntax trees, and generating calculation formula components, formulas that meet business requirements are automatically generated, avoiding redundant development.

Benefits of technology

It improved the efficiency of business data calculation, enabled the reusability and flexibility of formulas, and reduced the waste of time and human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633159A_ABST
    Figure CN122633159A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of service data computing method, device, electronic equipment and storage medium, belong to artificial intelligence technical field, apply to the field of financial technology and health care field.The method comprises: obtaining service rule text, service rule text includes business trigger condition and service computing text;Condition analysis is carried out to business trigger condition, obtains first business keyword and the condition logical relationship between first business keyword, and constructs condition logic tree;Text recognition is carried out to service computing text, obtains second business keyword and the computing operation operator between second business keyword, and constructs computing abstract syntax tree;According to condition logic tree and computing abstract syntax tree, generate computing formula component;The business data of target business is acquired;Data calculation is carried out to business data by computing formula component, obtains the business computing result of target business.The embodiment of the application can improve the efficiency of service data calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and is applied to the fields of fintech and healthcare, and particularly to a business data calculation method, apparatus, electronic device and storage medium. Background Technology

[0002] In the business decision-making process, business data needs to be processed and transformed into quantifiable results to provide data support for business decisions. For example, in a fintech scenario, insurance institutions can calculate premiums based on a user's age, health status, and historical claims records, allowing for differentiated premiums for users with different risk levels. Similarly, in a healthcare scenario, medical systems can analyze a patient's medical records, lifestyle habits, and other medical data to calculate the optimal medication and dosage, providing personalized treatment plans for patients.

[0003] In related technologies, business data calculations typically rely on specific calculation formulas. However, existing calculation formulas are highly customized, often hard-coded into business systems, requiring independent development of formulas for different business scenarios. When business scenarios change, significant time is spent developing new formulas, resulting in low efficiency in business data calculations. Therefore, improving the efficiency of business data calculations has become a pressing issue. Summary of the Invention

[0004] The main objective of this application is to provide a business data calculation method, apparatus, electronic device, and storage medium, which aims to improve the efficiency of business data calculation.

[0005] To achieve the above objectives, a first aspect of this application proposes a business data calculation method, the method comprising: Obtain the business rule text; wherein, the business rule text includes business triggering conditions and business calculation text; The business triggering conditions are parsed to obtain the first business keyword and the conditional logical relationship between the first business keyword, and a conditional logic tree is constructed based on the first business keyword and the conditional logical relationship. The business calculation text is subjected to text recognition to obtain the second business keyword and the calculation operation operator between the second business keyword, and a calculation abstract syntax tree is constructed based on the second business keyword and the calculation operation operator; Generate a calculation formula component based on the conditional logic tree and the computational abstract syntax tree; Obtain business data for the target business; The business data is calculated using the calculation formula component to obtain the business calculation result of the target business.

[0006] In some embodiments, the calculation formula component includes the conditional logic tree, and the step of performing data calculations on the business data through the calculation formula component to obtain the business calculation result of the target business includes: The business data is subjected to conditional judgment through the conditional logic tree to obtain a conditional judgment result; wherein, the conditional judgment result is used to indicate whether the business data meets or does not meet the business triggering condition; The business data is calculated based on the condition determination result to obtain the business calculation result.

[0007] In some embodiments, the conditional logic tree includes leaf nodes, and the step of performing conditional determination on the business data through the conditional logic tree to obtain a conditional determination result includes: The business data is substituted into the conditional logic tree for data determination, and the determination value output by the leaf node is obtained. If the judgment value is true, then the condition judgment result is determined to be that the business data meets the business triggering condition; If the judgment value is false, then the condition judgment result is determined to be that the business data does not meet the business triggering condition.

[0008] In some embodiments, the calculation formula component further includes the computational abstract syntax tree, and the step of performing data calculations on the business data based on the condition determination result to obtain the business calculation result includes: If the condition determination result indicates that the business data meets the business triggering condition, then the business data is calculated through the computation abstract syntax tree to obtain the business calculation result; If the condition determination result indicates that the business data does not meet the business triggering condition, then the default calculation rule is obtained, and the default calculation rule is executed to perform data calculation on the business data to obtain the business calculation result.

[0009] In some embodiments, obtaining the default calculation rule includes: The business data is subjected to feature extraction to obtain business features; Obtain the initial calculation rules that match the business characteristics and the number of rules for the initial calculation rules; The default calculation rule is determined based on the initial calculation rule and the number of rules.

[0010] In some embodiments, determining the default calculation rule based on the initial calculation rule and the number of rules includes: If the number of rules is equal to 1, then the initial calculation rule is used as the default calculation rule; If the number of rules is greater than 1, then the initial calculation rules are checked for rule conflicts to obtain a rule check result. The default calculation rule is determined based on the rule check result and the initial calculation rules. The rule check result is used to indicate whether there is a conflict or not among the initial calculation rules.

[0011] In some embodiments, after performing data calculations on the business data using the calculation formula component to obtain the business calculation result of the target business, the method further includes: The calculation formula component is updated to obtain the updated component; The update component performs data calculations on the business data to obtain the update calculation result of the target business. Calculate the difference between the business calculation result and the updated calculation result; The updated component is released in a preset production environment based on the difference in the results.

[0012] To achieve the above objectives, a second aspect of this application provides a business data computing apparatus, the apparatus comprising: The first acquisition module is used to acquire business rule text; wherein, the business rule text includes business triggering conditions and business calculation text; The condition parsing module is used to parse the business triggering conditions, obtain the conditional logic relationship between the first business keyword and the first business keyword, and construct a conditional logic tree based on the first business keyword and the conditional logic relationship. The text recognition module is used to perform text recognition on the business calculation text, obtain the second business keyword and the calculation operation operator between the second business keyword, and construct a calculation abstract syntax tree based on the second business keyword and the calculation operation operator; The generation module is used to generate a calculation formula component based on the conditional logic tree and the computational abstract syntax tree; The second acquisition module is used to acquire business data of the target business. The calculation module is used to perform data calculations on the business data through the calculation formula component to obtain the business calculation result of the target business.

[0013] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0014] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.

[0015] The business data calculation method, business data calculation device, electronic device, and computer-readable storage medium proposed in this application obtain business rule text and dynamically generate calculation formulas that meet business requirements based on the business rule text. The business rule text includes business triggering conditions and business calculation text. Due to the high complexity of business calculation logic, business triggering conditions may have multi-level and multi-combination composite judgment conditions, and there are complex associations and nesting relationships between these conditions. To ensure the accuracy of condition judgment, the business triggering conditions are parsed to obtain the first business keyword and the conditional logical relationship between them, and a conditional logic tree is constructed based on the first business keyword and the conditional logical relationship. The conditional logic tree clarifies the structure of the judgment conditions, structurally avoiding logical conflicts, redundancy, and ambiguity. Text recognition is performed on the business calculation text to obtain the second business keyword and the calculation operation operator between them, and a computational abstract syntax tree is constructed based on the second business keyword and the calculation operation operator. The computational abstract syntax tree transforms the string-form formula into a machine-understandable grammatical structure, eliminating formula ambiguity. The calculation formula component, generated based on the conditional logic tree and computational abstract syntax tree, enables automatic formula generation according to business scenarios. This avoids the significant time and human resources wasted on redeveloping formulas and ensures formula reusability across different business scenarios through component-based design. By acquiring business data from the target business and performing calculations on that data using the calculation formula component, the efficiency of business computation is improved. Attached Figure Description

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

[0017] Figure 1 This is a schematic diagram of the application environment for the business data calculation method provided in the embodiments of this application; Figure 2 This is a flowchart of the business data calculation method provided in the embodiments of this application; Figure 3 yes Figure 2 The flowchart of step S260 in the middle; Figure 4 yes Figure 3 The flowchart of step S310 in the process; Figure 5 yes Figure 3 The flowchart of step S320 in the text; Figure 6 yes Figure 5 The flowchart of step S520 in the text; Figure 7 yes Figure 6 The flowchart of step S630 in the process; Figure 8 This is another flowchart of the business data calculation method provided in the embodiments of this application; Figure 9 This is a schematic diagram of the structure of the business data computing device provided in the embodiments of this application; Figure 10 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0019] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0021] In the business decision-making process, business data needs to be processed and transformed into quantifiable results to provide data support for business decisions. For example, in a fintech scenario, insurance institutions can calculate premiums based on a user's age, health status, and historical claims records, allowing for differentiated premiums for users with different risk levels. Similarly, in a healthcare scenario, medical systems can analyze a patient's medical records, lifestyle habits, and other medical data to calculate the optimal medication and dosage, providing personalized treatment plans for patients.

[0022] In related technologies, business data calculations typically rely on specific calculation formulas. However, existing calculation formulas are highly customized, often hard-coded into business systems, requiring independent development of formulas for different business scenarios. When business scenarios change, significant time is spent developing new formulas, resulting in low efficiency in business data calculations. Therefore, improving the efficiency of business data calculations has become a pressing issue.

[0023] Based on this, embodiments of this application provide a business data calculation method, a business data calculation device, an electronic device, and a computer-readable storage medium, aiming to improve the efficiency of business data calculation.

[0024] The business data calculation method, business data calculation device, electronic device, and computer-readable storage medium provided in the embodiments of this application are specifically described through the following embodiments. First, the business data calculation method in the embodiments of this application is described.

[0025] The business data calculation method provided in this application relates to the field of artificial intelligence technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the business data calculation method, but is not limited to the above forms.

[0026] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0027] The business data-based calculation method provided in this application can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can obtain business rule text from the client, which includes business trigger conditions and business calculation text. It performs condition parsing on the business trigger conditions to obtain the first business keyword and the conditional logical relationship between them, and constructs a conditional logic tree based on the first business keyword and the conditional logical relationship. It performs text recognition on the business calculation text to obtain the second business keyword and the calculation operation operator between them, and constructs a computational abstract syntax tree based on the second business keyword and the computational operation operator. It generates a calculation formula component based on the conditional logic tree and the computational abstract syntax tree. It obtains the business data of the target business and performs data calculations on the business data through the calculation formula component to obtain the business calculation result of the target business. In this application, for business data calculations in the business decision-making process, the business rule text can be converted into a conditional logic tree and a computational abstract syntax tree. Formula components that meet business requirements can be automatically generated through the conditional logic tree and the computational abstract syntax tree, eliminating the need for extensive redevelopment of calculation formulas and thus improving the efficiency of business calculations. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The present application will now be described in detail through specific embodiments.

[0028] Figure 2 This is an optional flowchart of the business data calculation method provided in the embodiments of this application. Figure 2 The method may include, but is not limited to, steps S210 to S260.

[0029] Step S210: Obtain the business rule text; wherein, the business rule text includes business triggering conditions and business calculation text; Step S220: Perform condition parsing on the business triggering conditions to obtain the first business keyword and the conditional logic relationship between the first business keyword, and construct a conditional logic tree based on the first business keyword and the conditional logic relationship; Step S230: Perform text recognition on the business calculation text to obtain the calculation operation operator between the second business keyword and the second business keyword, and construct a calculation abstract syntax tree based on the second business keyword and the calculation operation operator; Step S240: Generate a calculation formula component based on the conditional logic tree and the computational abstract syntax tree; Step S250: Obtain the business data of the target business; Step S260: Perform data calculations on the business data using the calculation formula component to obtain the business calculation results for the target business.

[0030] Steps S210 to S260, as illustrated in this embodiment, convert business rule text into a conditional logic tree and a computational abstract syntax tree. Formulas that meet business requirements are automatically generated using these trees, and the formulas are reused through component-based design, eliminating the need for extensive redevelopment of calculation formulas. Utilizing calculation formula components for business data calculation improves the efficiency of business computation.

[0031] In step S210 of some embodiments, the business rule text uploaded by the target object through the business system is obtained. The target object is a person with business data calculation needs. The business system refers to a software application system designed, developed, and deployed for carrying out business activities. The business rule text defines business calculation logic and is described using natural language or semi-structured expressions. The business rule text includes business triggering conditions and business calculation text. The business triggering conditions are the prerequisites for executing business calculation actions, and the business calculation text defines the business calculation rules for business data items. It should be noted that the business triggering conditions can be empty, indicating that no condition judgment is required, and subsequent business calculation rules can be executed directly.

[0032] Taking fintech scenarios as an example, the business rule text is the financial business rule text, the business triggering condition is the triggering condition for financial business, and the business calculation rule is the calculation rule for financial business. For example, if the financial business is the claim amount calculation business, the business rule text could be designed such that when the insured is in a first-tier city and the care level is 3 (business triggering condition), the daily compensation amount is 0.1% of the insured amount multiplied by the number of care days (business calculation rule). Another example is if the financial business is the loan approval business, the business rule text could be designed such that if the borrower is a high-risk user (business triggering condition), a loan rejection notification is pushed (business calculation rule).

[0033] Taking a healthcare scenario as an example, the business rule text is the medical business rule text, the business triggering condition is the triggering condition for the medical business, and the business calculation rule is the calculation rule for the medical business. For example, if the medical business is to detect a patient's allergy to a drug, the business rule text could be designed such that if the patient's allergy history includes drug A (business triggering condition), then drug A is output as a prohibited drug, and an alternative drug suggestion is provided to the patient (business calculation rule). Another example is to calculate medication dosage. The business rule text could be designed such that if the patient is under 18 years old and the medication is drug A (business triggering condition), then the standard daily dose equals the patient's weight multiplied by the standard dose range of drug A (business calculation rule).

[0034] In step S220 of some embodiments, the business triggering conditions may have situations where lower-level conditions depend on the output of upper-level conditions, the judgment dimensions are independent of each other but jointly determine the result, and different condition branches converge or diverge to form a network or non-linear execution path. This makes the business triggering conditions usually present complex characteristics of multi-level nesting, multi-dimensional combination, and multi-path association. By modeling the business triggering conditions as a tree structure, the hierarchical relationship and priority between conditions can be clearly expressed.

[0035] Specifically, the business trigger conditions are segmented into multiple words. Keyword detection is then performed on these words to obtain the first business keyword. The first business keyword is a semantic unit carrying the business judgment and can be a field, a number, or a string value. For example, if the business trigger condition is that the insured's care level is level 3, the first business keyword could be "insured," "care level," and "level 3." Conditional logical relationships between the first business keywords are extracted from the business trigger conditions. These relationships consist of operators, connectors, and implicit semantic relationships that connect, combine, or modify the first business keywords, such as comparison operators (greater than, equal to), relational operators (containment, range), and logical connectors (and, or). For example, "care level" is an attribute of the main entity "insured," and "level 3" is the attribute value of the attribute field.

[0036] The first business keyword is mapped to a pre-defined standard field in the data dictionary. The standard field is used as a tree node, and the conditional logical relationship is used as the connection relationship between the tree nodes to construct a tree structure, resulting in a conditional logic tree. For example, if the first business keywords are A and B, and the conditional logical relationship between A and B is AND, then a tree structure with AND as the parent node and A and B as the child nodes will be generated.

[0037] In step S230 of some embodiments, the business calculation text is usually natural language or semi-structured expression, which has problems such as inconsistent expression, non-standard format, and ambiguous logical nesting. In order to clearly present the complex calculation logic, the business calculation text is modeled as a tree structure to express the priority relationship, logical branch relationship, etc. in the business calculation.

[0038] Specifically, the business calculation text is segmented into multiple words. Keywords are extracted from these words to obtain second business keywords. These second business keywords are lexical units that carry the semantics of the business calculation and can be fields, numerical values, string values, etc. For example, if the business calculation text is "Daily compensation amount is 0.1% of the insured amount multiplied by the number of nursing days," the second business keywords could be "daily compensation amount," "insured amount," "0.1%," and "nursing days." Calculation operators between the second business keywords are extracted from the business calculation text. These calculation operators are operators, functions, and data processing units that express calculation logic and are used to perform specific operations on the input data to produce output results. For example, the calculation operator between the insured amount and 0.1% is multiplication operator 1; the calculation operator between the result calculated based on the insured amount, 0.1%, and multiplication operator 1 and the number of nursing days is multiplication operator 2; and the calculation operator between the result calculated based on the insured amount, 0.1%, multiplication operator 1, and multiplication operator 2 and the daily compensation amount is an assignment operator.

[0039] The second business keyword and computational operation operator are converted into Reverse Polish Notation (RPN) expressions using a recursive descent algorithm or a shunting-yard algorithm, and then the RPN expressions are assembled into an abstract syntax tree to obtain a computational abstract syntax tree.

[0040] To ensure the generated formulas are logically consistent, the computational abstract syntax tree is subjected to syntax validation, and data type compatibility is checked. For example, a monetary field cannot be multiplied by a date field. If a syntax conflict is found, a compile-time exception is thrown.

[0041] In step S240 of some embodiments, the conditional logic tree and computational abstract syntax tree are serialized into JSON or binary format and persistently stored in a database. This allows for the rapid generation of calculation formula components that meet business calculation needs. These calculation formula components are reusable, loadable, contain data processing logic, and are decoupled from the business system code, avoiding redundant development of the same calculation logic in different business scenarios. When the business calculation logic changes, the business rule text can be directly modified without redeploying the code, improving formula development efficiency. For example, both accident insurance premium calculation and medical insurance premium calculation use the same premium calculation logic: sum assured × occupational coefficient × fixed rate. By constructing this same calculation logic as a calculation formula component and reusing it, development efficiency can be improved, thereby increasing the efficiency of business data calculation. The calculation formula component includes a conditional logic tree and a computational abstract syntax tree, both of which include leaf nodes and non-leaf nodes.

[0042] In step S250 of some embodiments, after generating the calculation formula component, business data of the target business is obtained. The target business is the business to be numerically calculated or processed, such as insurance underwriting or insurance product business to be performed on premium calculation, risk assessment, and coverage calculation, or medical business to be performed on medical diagnosis, outpatient expense calculation, and outpatient expense reimbursement. The business data is the real data required to complete the calculation of the target business, such as user information, policy information, claims reporting information, product parameters, and historical medical records. To ensure the security of the business data, it can be encrypted.

[0043] The calculation formula component is invoked to perform data calculations on the business data, and the calculation result output by the calculation formula component is used as the business calculation result for the target business. The business calculation result can be a specific numerical value, or a judgment conclusion (such as underwriting approval or rejection), control instructions (such as activating the payment button or hiding some sensitive information), or other non-numerical results. The business calculation result is encapsulated into a standard JSON response and returned to the target object through the interface.

[0044] Please see Figure 3 In some embodiments, step S260 may include, but is not limited to, steps S310 to S320: Step S310: Perform condition judgment on the business data through the condition logic tree to obtain the condition judgment result; wherein, the condition judgment result is used to indicate whether the business data meets or does not meet the business triggering condition. Step S320: Perform data calculations on the business data based on the condition determination results to obtain the business calculation results.

[0045] In step S310 of some embodiments, the business data is deserialized into a context object recognizable by the execution engine. The execution engine loads a conditional logic tree, performs path traversal in the conditional logic tree based on the passed context object to perform condition determination, and obtains the condition determination result. The condition determination result includes whether the business data meets the business triggering condition or whether the business data does not meet the business triggering condition.

[0046] In step S320 of some embodiments, the corresponding data calculation logic is selected according to the condition determination result, and the business data is calculated according to the data calculation logic to obtain the business calculation result.

[0047] Steps S310 to S320 above perform data calculations using the generated calculation formula component, thereby improving the efficiency of business calculations.

[0048] Please see Figure 4 In some embodiments, step S310 may include, but is not limited to, steps S410 to S430: Step S410: Substitute the business data into the conditional logic tree to perform data judgment and obtain the judgment value output by the leaf node; Step S420: If the judgment value is true, then the condition judgment result is determined to be that the business data meets the business triggering condition. Step S430: If the judgment value is false, then the condition judgment result is determined to be that the business data does not meet the business triggering condition.

[0049] In step S410 of some embodiments, the conditional logic tree is traversed according to the business data until a leaf node is reached, and the judgment value output by the leaf node is obtained. The judgment value is either true or false.

[0050] In step S420 of some embodiments, if the judgment value output by each leaf node is true, the condition judgment result is determined to be that the business data meets the business triggering condition, and then the formula calculation is triggered.

[0051] In step S430 of some embodiments, if any leaf node outputs a false value, the condition determination result is determined to be that the business data does not meet the business triggering condition, and then the degradation logic is executed or the default value is returned.

[0052] By using steps S410 to S430 above, it is possible to quickly determine whether the business data meets the business triggering conditions.

[0053] Please see Figure 5 In some embodiments, step S320 may include, but is not limited to, step S510 or step S520: Step S510: If the condition determination result indicates that the business data meets the business triggering condition, then the business data is calculated by calculating the abstract syntax tree to obtain the business calculation result. Step S520: If the condition determination result indicates that the business data does not meet the business triggering condition, then obtain the default calculation rule, execute the default calculation rule to perform data calculation on the business data, and obtain the business calculation result.

[0054] In step S510 of some embodiments, if the condition determination result indicates that the business data meets the business triggering condition, then each node in the computation abstract syntax tree is traversed, the actual value of the business data is substituted into the standard field of the leaf node in the abstract syntax tree, and the calculation is performed layer by layer from bottom to top according to the calculation operation operator and calculation order recorded in the non-leaf node. The calculation result is output by the root node to obtain the business calculation result.

[0055] In step S520 of some embodiments, if the condition determination result indicates that the business data does not meet the business triggering condition, meaning that the calling condition of the calculation formula component is not met, then the default calculation rule is obtained. The default calculation rule is a calculation logic, formula, or value standard pre-set in the business process. The default calculation rule is executed, and data calculation is performed on the business data according to the default calculation rule to obtain the business calculation result.

[0056] Steps S510 to S520 above perform data calculations on business data that meet the business triggering conditions by calculating the abstract syntax tree. This allows for flexible configuration of calculation rules without modifying the underlying code, adapting to differentiated calculation needs in various business scenarios. When business data does not meet the business triggering conditions, the system automatically switches to the default calculation rules for fallback calculations, avoiding calculation interruptions or business process blockages and improving system fault tolerance.

[0057] Please see Figure 6 In some embodiments, step S520 may include, but is not limited to, steps S610 to S630: Step S610: Extract features from the business data to obtain business features; Step S620: Obtain the initial calculation rules that match the business characteristics and the number of rules for the initial calculation rules; Step S630: Determine the default calculation rule based on the initial calculation rule and the number of rules.

[0058] In step S610 of some embodiments, business data is input into a feature extraction network for feature extraction to obtain business features. The feature extraction network can be selected according to the actual situation, such as the transformer model, BERT model, etc. Business features are key data information extracted from business data that can characterize business attributes, business status, or business type, such as user identity features, account transaction behavior features, business product features, etc.

[0059] In step S620 of some embodiments, multiple calculation rules are stored in the rule base. Rule features for each calculation rule are extracted using a feature extraction network. The similarity between the business feature and the rule feature is calculated. If the similarity is greater than a preset similarity threshold, it indicates a closer match between the business feature and the rule feature, and the calculation rule is used as the initial calculation rule. The preset similarity threshold can be selected according to actual conditions, such as 0.7. The number of calculation rules with a similarity greater than the preset similarity threshold is obtained. If this number is greater than 0, it is used as the rule count, which is an integer greater than 0. If the number is equal to 0, it indicates that no calculation rule corresponding to the business feature was matched. The calculation rules are then sorted in descending order of similarity, and the first K calculation rules are used as the initial calculation rules, with the rule count of the initial calculation rules being K. K is an integer greater than or equal to 1 and can be set according to actual conditions; no specific limitation is made here. For example, K is 20.

[0060] In step S630 of some embodiments, if the number of rules is equal to 1, the initial calculation rule is used as the default calculation rule. If the number of rules is greater than 1, the initial calculation rule is filtered to obtain the default calculation rule.

[0061] Through steps S610 to S630, a default calculation rule matching the business data can be obtained. Based on the default calculation rule, a fallback calculation is performed, ensuring the continuity and stability of the business calculation process and thus improving the robustness of the business system.

[0062] Please see Figure 7 In some embodiments, step S630 may include, but is not limited to, step S710 or step S720: Step S710: If the number of rules is equal to 1, then the initial calculation rule is used as the default calculation rule; Step S720: If the number of rules is greater than 1, then perform rule conflict verification on the initial calculation rules to obtain the rule verification result, and determine the default calculation rule based on the rule verification result and the initial calculation rules; wherein, the rule verification result is used to indicate whether there is a conflict between the initial calculation rules or not.

[0063] In step S710 of some embodiments, if the number of rules in the initial calculation rule is equal to 1, it means that a unique calculation rule is obtained from the rule base based on the business data, and the initial calculation rule is used as the default calculation rule.

[0064] In step S720 of some embodiments, the number of initial calculation rules is greater than one, indicating that multiple calculation rules are obtained by matching business data from the rule base. To avoid problems such as logical conflicts and inconsistent calculation results caused by multiple calculation rules, rule conflict verification can be performed on the initial calculation rules through a large language model or rule engine to obtain rule verification results. The large language model is a deep learning model with powerful semantic understanding capabilities. The rule verification results are used to indicate whether there is a logical conflict between any two initial calculation rules. Logical conflicts include situations where the triggering conditions are the same, or there are overlapping but different calculation logics, or conflicting triggering condition ranges.

[0065] If the rule validation result indicates a logical conflict between two initial calculation rules, then the priority of these two initial calculation rules is obtained, and the initial calculation rule with the highest priority is selected as the default calculation rule. If the rule validation result indicates that there is no logical conflict between the two initial calculation rules, then both initial calculation rules are used as the default calculation rules, and calculations are performed on different dimensions of the business data respectively. For example, Rule 1: If the order amount is greater than 200, then deduct 20; Rule 2: If the payment method is credit card, then return 1% cash. Rules 1 and Rule 2 have no logical conflict and can be applied to the business data simultaneously.

[0066] It should be noted that if the number of initial calculation rules is greater than 1, business features and each initial calculation rule can be input into the large language model for rule recommendation, and the recommended rules output by the large language model can be used as the default calculation rules.

[0067] Through the above steps S710 to S720, a default calculation rule without logical conflicts can be obtained, so as to accurately and quickly calculate and process business data based on the default calculation rule.

[0068] Please see Figure 8 In some embodiments, after step S260, the business data calculation method may also include, but is not limited to, steps S810 to S840: Step S810: Update the calculation formula component to obtain the updated component; Step S820: Perform data calculations on the business data through the update component to obtain the update calculation result of the target business; Step S830: Calculate the result difference value between the business calculation result and the update calculation result; Step S840: Publish the updated component in the preset production environment based on the result difference value.

[0069] In step S810 of some embodiments, the calculation formula component is upgraded by optimizing the algorithm, improving the calculation accuracy, expanding the functions, and optimizing the architecture to obtain a new version component, which is then used as the updated component.

[0070] When the calculation formula component is updated, the system retrieves downstream products, policy versions, and related reports that call or reference it to obtain the component's dependencies. Based on these dependencies, it calculates the coverage impact of the component update and generates an impact analysis report to support business decisions. For example, if the calculation formula component is used to calculate claim amounts, the impact analysis report can determine the number of affected policies.

[0071] In step S820 of some embodiments, in order to test the functionality of the update component, the update component is invoked to perform data calculation on the business data in a secure sandbox environment to obtain the update calculation result of the target business.

[0072] In step S830 of some embodiments, feature extraction is performed on the business calculation result and the updated calculation result respectively to obtain a first feature of the business calculation result and a second feature of the updated calculation result. A similarity value between the first feature and the second feature is then calculated. A result difference value is determined based on the similarity value. The result difference value is inversely proportional to the similarity value and can be the reciprocal of the similarity value, a negative number, etc. The result difference value indicates the difference between the first feature and the second feature; the smaller the result difference value, the smaller the difference between the first feature and the second feature, and the greater the degree of similarity.

[0073] In step S840 of some embodiments, if the result difference value is less than or equal to a preset threshold, such as 0.1, it indicates that the difference between the output of the updated component and the calculation formula component is small, meaning that the output of the updated component is relatively accurate. In this case, the updated component is fully deployed in the production environment so that it can be used in the business system for business data calculation and processing. If the result difference value is greater than the preset threshold, it indicates that the difference between the output of the updated component and the calculation formula component is large, and the updated component cannot achieve accurate data calculation. In this case, the updated component is corrected.

[0074] Steps S810 to S840 above, by quantifying the differences between the old and new versions, can ensure the accurate updating of the calculation formula component.

[0075] Please see Figure 9 This application embodiment also provides a business data computing device that can implement the above-described business data computing method. The business data computing device includes: The first acquisition module 910 is used to acquire business rule text; wherein, the business rule text includes business triggering conditions and business calculation text; The condition parsing module 920 is used to parse the business trigger conditions, obtain the first business keyword and the conditional logic relationship between the first business keyword, and construct a conditional logic tree based on the first business keyword and the conditional logic relationship. The text recognition module 930 is used to perform text recognition on business calculation text, obtain the calculation operation operator between the second business keyword and the second business keyword, and construct a calculation abstract syntax tree based on the second business keyword and the calculation operation operator; Module 940 is used to generate computation formula components based on the conditional logic tree and computational abstract syntax tree; The second acquisition module 950 is used to acquire business data of the target business. The calculation module 960 is used to perform data calculations on business data through the calculation formula component to obtain the business calculation results of the target business.

[0076] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned business data calculation method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0077] Please see Figure 10 , Figure 10 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1010 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1020 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010 to execute the business data calculation method of the embodiments of this application. The input / output interface 1030 is used to implement information input and output; The communication interface 1040 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1050 transmits information between various components of the device (e.g., processor 1010, memory 1020, input / output interface 1030, and communication interface 1040); The processor 1010, memory 1020, input / output interface 1030 and communication interface 1040 are connected to each other within the device via bus 1050.

[0078] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described business data calculation method.

[0079] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0080] The business data calculation method, business data calculation device, electronic device, and computer storage medium provided in this application convert business rule text into a conditional logic tree and a computational abstract syntax tree. These elements automatically generate formulas that meet business requirements, and the formulas are reused through component-based design, eliminating the need for extensive redevelopment of calculation formulas. Utilizing calculation formula components for business data calculation improves the efficiency of business calculations.

[0081] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0082] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0083] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0084] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0085] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0086] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0087] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0088] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0089] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0090] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0091] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0092] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for calculating business data, characterized in that, The method includes: Obtain the business rule text; wherein, the business rule text includes business triggering conditions and business calculation text; The business triggering conditions are parsed to obtain the first business keyword and the conditional logical relationship between the first business keyword, and a conditional logic tree is constructed based on the first business keyword and the conditional logical relationship. The business calculation text is subjected to text recognition to obtain the second business keyword and the calculation operation operator between the second business keyword, and a calculation abstract syntax tree is constructed based on the second business keyword and the calculation operation operator; Generate a calculation formula component based on the conditional logic tree and the computational abstract syntax tree; Obtain business data for the target business; The business data is calculated using the calculation formula component to obtain the business calculation result of the target business.

2. The method according to claim 1, characterized in that, The calculation formula component includes the conditional logic tree. The step of performing data calculations on the business data using the calculation formula component to obtain the business calculation result for the target business includes: The business data is subjected to conditional judgment through the conditional logic tree to obtain a conditional judgment result; wherein, the conditional judgment result is used to indicate whether the business data meets or does not meet the business triggering condition; The business data is calculated based on the condition determination result to obtain the business calculation result.

3. The method according to claim 2, characterized in that, The conditional logic tree includes leaf nodes. The step of performing conditional judgments on the business data through the conditional logic tree to obtain conditional judgment results includes: The business data is substituted into the conditional logic tree for data determination, and the determination value output by the leaf node is obtained. If the determination value is true, then the condition determination result is determined to be that the business data meets the business triggering condition; If the judgment value is false, then the condition judgment result is determined to be that the business data does not meet the business triggering condition.

4. The method according to claim 2, characterized in that, The calculation formula component further includes the calculation abstract syntax tree, and the step of performing data calculations on the business data based on the condition determination result to obtain the business calculation result includes: If the condition determination result indicates that the business data meets the business triggering condition, then the business data is calculated through the computation abstract syntax tree to obtain the business calculation result; If the condition determination result indicates that the business data does not meet the business triggering condition, then the default calculation rule is obtained, and the default calculation rule is executed to perform data calculation on the business data to obtain the business calculation result.

5. The method according to claim 4, characterized in that, The method for obtaining the default calculation rule includes: The business data is subjected to feature extraction to obtain business features; Obtain the initial calculation rules that match the business characteristics and the number of rules for the initial calculation rules; The default calculation rule is determined based on the initial calculation rule and the number of rules.

6. The method according to claim 5, characterized in that, The step of determining the default calculation rule based on the initial calculation rule and the number of rules includes: If the number of rules is equal to 1, then the initial calculation rule is used as the default calculation rule; If the number of rules is greater than 1, then the initial calculation rules are checked for rule conflicts to obtain a rule check result. The default calculation rule is determined based on the rule check result and the initial calculation rules. The rule check result is used to indicate whether there is a conflict or not among the initial calculation rules.

7. The method according to any one of claims 1 to 6, characterized in that, After performing data calculations on the business data using the calculation formula component to obtain the business calculation result of the target business, the method further includes: The calculation formula component is updated to obtain the updated component; The update component performs data calculations on the business data to obtain the update calculation result of the target business. Calculate the difference between the business calculation result and the updated calculation result; The updated component is released in a preset production environment based on the difference in the results.

8. A business data computing device, characterized in that, The device includes: The first acquisition module is used to acquire business rule text; wherein, the business rule text includes business triggering conditions and business calculation text; The condition parsing module is used to parse the business triggering conditions, obtain the conditional logic relationship between the first business keyword and the first business keyword, and construct a conditional logic tree based on the first business keyword and the conditional logic relationship. The text recognition module is used to perform text recognition on the business calculation text, obtain the second business keyword and the calculation operation operator between the second business keyword, and construct a calculation abstract syntax tree based on the second business keyword and the calculation operation operator; The generation module is used to generate a calculation formula component based on the conditional logic tree and the computational abstract syntax tree; The second acquisition module is used to acquire business data of the target business. The calculation module is used to perform data calculations on the business data through the calculation formula component to obtain the business calculation result of the target business.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.