Service charge determination method and device, equipment and storage medium
By converting service fee rule parameters and transaction details into key-value pair sets and updating the service fee calculation script, the problem of long change of service fee calculation logic in the existing technology is solved, and efficient service fee calculation and flexible business are achieved response.
Patent Information
- Application Number
- CN202411159814.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, when the service fee calculation method changes in business scenarios or calculation rules, developers need to modify the program code and go through testing and operation and maintenance verification, resulting in a long process of changing the service fee calculation logic and inefficient efficiency.
By converting service fee rule parameters and transaction details into a key-value pair set, transmitting them to the service fee calculation script engine, judging and updating the script attribute name, and calculating service fees using the updated script to realize dynamic changes in the service fee calculation logic. Avoid launching process.
The process of changing the service fee calculation logic is simplified, efficiency is improved, development, testing and operation and maintenance costs are reduced, and the flexibility and maintainability of the computing logic is enhanced.
Smart Images

Figure CN119127942A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and storage medium for determining a service fee. Background Art
[0002] At present, with the continuous development of Internet technology, people can conduct business through the Internet, which has the advantages of convenience, speed and high efficiency, and has been widely used in the fields of banking, communication business, etc. When using the Internet to conduct banking business, it usually involves the calculation of various service fees, such as: actual interest collected, actual penalty interest collected, etc.
[0003] At present, the common service fee calculation method is to pre-configure the service fee calculation logic and write the configured service fee calculation logic into the application by hard coding. However, when the business scenario or calculation rules change, it is usually necessary to change the service fee calculation logic accordingly. At this time, the developer needs to modify the corresponding program code, which is tested and verified by the tester and finally released to the production environment by the operation and maintenance personnel. Only after the online process is completed can the calculation logic be changed and the service fee can be calculated. Because the entire change process of this method is long and requires the consumption of development, testing and operation and maintenance resources, the service fee calculation efficiency is low.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a service fee determination method, device, equipment and storage medium, aiming to solve the technical problem that the service fee calculation method in the prior art has a long process for changing the calculation logic, resulting in low efficiency in service fee calculation.
[0006] To achieve the above purpose, the present application proposes a method for determining a service fee, the method comprising:
[0007] The first key-value pair set and the second key-value pair set corresponding to the task to be calculated are transmitted to the service fee calculation script engine; wherein the first key-value pair set stores the first object attribute name corresponding to the service fee rule parameter object, the second key-value pair set stores the second object attribute name corresponding to the service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script;
[0008] Determine whether there is a target object attribute name that is the same as the script attribute name in the service fee calculation script in the first key-value pair set and the second key-value pair set;
[0009] If it exists, updating the service fee calculation script based on the target object attribute name to obtain an updated service fee calculation script;
[0010] The service fee of the task to be calculated is determined based on the updated service fee calculation script.
[0011] In one embodiment, before the step of transmitting the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine, the step further includes:
[0012] Convert the service fee rule parameters in the service fee calculation rule corresponding to the task to be calculated into a service fee rule parameter object;
[0013] Obtaining a first object attribute name and a first object attribute value corresponding to the service fee rule parameter object through a preset reflection mechanism;
[0014] The first object attribute name and the first object attribute value are stored in a first key-value pair set.
[0015] In one embodiment, the step of storing the first object attribute name and the first object attribute value in a first key-value pair set includes:
[0016] The first object attribute name is updated based on the target suffix identifier to obtain an updated first object attribute name;
[0017] The updated first object attribute name is used as a key value and the first object attribute value is used as an identification value and stored in a first key-value pair set.
[0018] In one embodiment, before the step of transmitting the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine, the step further includes:
[0019] Convert the transaction details data corresponding to the task to be calculated into a service fee transaction details object;
[0020] Obtaining a second object attribute name and a second object attribute value corresponding to the service fee transaction detail object through a preset reflection mechanism;
[0021] The second object attribute name and the second object attribute value are stored in a second key-value pair set.
[0022] In one embodiment, if the service fee calculation script exists, the step of updating the service fee calculation script based on the target object attribute name to obtain the updated service fee calculation script includes:
[0023] If it exists, determining the target object attribute value corresponding to the target object attribute name;
[0024] Replacing the script attribute name according to the target object attribute value;
[0025] When the replacement is completed, obtain the updated service fee calculation script.
[0026] In one embodiment, the step of determining the target object attribute value corresponding to the target object attribute name includes:
[0027] Performing a traversal query on the first key-value pair set and the second key-value pair set based on the target object attribute name;
[0028] The target object attribute value corresponding to the target object attribute name is determined according to the query result.
[0029] In one embodiment, the method further comprises:
[0030] Configure a service fee calculation script corresponding to the task to be calculated, and store the service fee calculation script in a preset script database;
[0031] When a calculation logic change request is detected, the service fee calculation script is loaded from the preset script database, and the service fee calculation script is displayed through a visualization page;
[0032] The service fee calculation script is changed in the visualization page based on the calculation logic change request.
[0033] In addition, to achieve the above purpose, the present application also proposes a service fee determination device, the device comprising:
[0034] A data transmission module, used for transmitting a first key-value pair set and a second key-value pair set corresponding to the task to be calculated to a service fee calculation script engine; wherein the first key-value pair set stores a first object attribute name corresponding to a service fee rule parameter object, and the second key-value pair set stores a second object attribute name corresponding to a service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script;
[0035] An attribute name determination module, used for determining whether there is a target object attribute name that is the same as the script attribute name in the service fee calculation script in the first key-value pair set and the second key-value pair set;
[0036] A script updating module, configured to update the service fee calculation script based on the target object attribute name if it exists, to obtain an updated service fee calculation script;
[0037] A service fee determination module is used to determine the service fee of the task to be calculated based on the updated service fee calculation script.
[0038] In addition, to achieve the above objectives, the present application also proposes a service fee determination device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the service fee determination method as described above.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the service fee determination method described above are implemented.
[0040] The present application provides a method for determining a service fee, and the present application discloses transmitting a first key-value pair set and a second key-value pair set corresponding to a task to be calculated to a service fee calculation script engine; wherein the first key-value pair set stores a first object attribute name corresponding to a service fee rule parameter object, and the second key-value pair set stores a second object attribute name corresponding to a service fee transaction detail object; determining whether there is a target object attribute name in the first key-value pair set and the second key-value pair set that is the same as the script attribute name in the service fee calculation script; if so, updating the service fee calculation script based on the target object attribute name to obtain an updated service fee calculation script; determining the task to be calculated based on the updated service fee calculation script service fee; compared with the prior art, when changing the service fee calculation logic, the developer needs to modify the corresponding program code, which is tested and verified by the tester and finally released to the production environment by the operation and maintenance personnel. The calculation logic can be changed and the service fee can be calculated only after the online process is completed. Since the present invention updates the service fee calculation script based on the target object attribute name when the attribute name in the service fee calculation script is the same as the attribute name in the first key-value pair set and the second key-value pair set, and determines the service fee through the updated service fee calculation script, the technical problem that the service fee calculation method in the prior art has a long process for changing the calculation logic, resulting in low efficiency in service fee calculation, is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1A flowchart diagram of the first embodiment of the method for determining the application service fee;
[0044] Figure 2 A flowchart diagram of the second embodiment of the method for determining the application service fee;
[0045] Figure 3 This is an example diagram of configuring service fee rules in the service fee determination method for this application;
[0046] Figure 4 This is an example diagram of the data details required to calculate the service fee in the method for determining the service fee for this application;
[0047] Figure 5 This is an example diagram of the business function flow in the method for determining the service fee for this application;
[0048] Figure 6 A flowchart of the third embodiment of the method for determining the application service fee is provided;
[0049] Figure 7 This is an example diagram of the service fee calculation script in the service fee determination method of this application;
[0050] Figure 8 This is a schematic diagram of the module structure of the service fee determination device of the embodiment of the present application;
[0051] Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the service fee determination method in the embodiment of the present application.
[0052] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0055] The main solution of the embodiment of the present application is: transmitting the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine; wherein the first key-value pair set stores the first object attribute name corresponding to the service fee rule parameter object, and the second key-value pair set stores the second object attribute name corresponding to the service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script; determining whether there is a target object attribute name that is the same as the script attribute name in the service fee calculation script in the first key-value pair set and the second key-value pair set; if so, updating the service fee calculation script based on the target object attribute name to obtain an updated service fee calculation script; and determining the service fee of the task to be calculated based on the updated service fee calculation script.
[0056] Because the existing technology requires developers to modify the corresponding program code when changing the service fee calculation logic, which is then tested and verified by testers and finally released to the production environment by operation and maintenance personnel, the calculation logic can be changed and the service fee can be calculated only after the online process is completed.
[0057] The present application provides a solution, which can update the service fee calculation script based on the target object attribute name when the attribute name in the service fee calculation script is the same as the target object attribute name in the first key-value pair set and the second key-value pair set, and determine the service fee through the updated service fee calculation script, thereby solving the technical problem that the service fee calculation method in the prior art has a long process for changing the calculation logic, resulting in low efficiency in service fee calculation.
[0058] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a service fee determination device, etc. The following takes the service fee determination device as an example (hereinafter referred to as the device) to illustrate this embodiment and the following embodiments.
[0059] Based on this, the present application embodiment provides a method for determining a service fee, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for determining application service fees.
[0060] In this embodiment, the service fee determination method includes steps S10 to S40:
[0061] Step S10: transmitting the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine.
[0062] Among them, the first key-value pair set stores the first object attribute name corresponding to the service fee rule parameter object, the second key-value pair set stores the second object attribute name corresponding to the service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script.
[0063] It should be noted that the above-mentioned tasks to be calculated may be any banking business or other financial business that requires calculation of service fees. In addition, the tasks to be calculated in this embodiment may also be tasks in other industries or fields, and this embodiment does not limit this.
[0064] It should be noted that the above-mentioned first key-value pair set and second key-value pair set are both data structures for storing key-value pairs, such as a Map set. Among them, each key in the Map set is unique, and the value can be repeated, which allows the corresponding value to be quickly found by the key. In this embodiment, the first key-value pair set can be a Java Map set storing the attribute names and attribute values corresponding to the service fee rule parameter object; the second key-value pair set can be a Java Map set storing the attribute names and attribute values corresponding to the service fee transaction detail object. Among them, the service fee rule parameter object can be an object used to characterize the billing parameters of the service fee rule. In this embodiment, the billing parameters of the service fee rule may include: billing mode, loan amount ratio, actual interest rate and actual penalty interest rate, etc.; the service fee transaction detail object can be an object used to characterize the transaction detail data for which the service fee needs to be calculated. In this embodiment, the service fee transaction detail data may include: loan principal, actual interest collected, actual penalty interest collected, interest refund, penalty interest refund, etc.
[0065] It can be understood that the first object attribute name is the attribute name corresponding to the service fee rule parameter object; correspondingly, the second object attribute name is the attribute name corresponding to the service fee transaction detail object.
[0066] It should be understood that the above-mentioned service fee calculation script engine may be an engine configured with a script for calculating service fees, that is, a service fee calculation script is configured in the service fee calculation script engine. In this embodiment, the service fee calculation script engine may be a QLExpress script engine, wherein QLExpress is a lightweight, extensible, object-oriented scripting language that directly supports JavaScript syntax and is mainly used for data processing and business rule customization. In this embodiment, the calculation logic of the service fee can be configured through the QLExpress script engine, which mainly configures the logical calculation relationship between the service fee rule parameter attributes and the service fee detail attributes. The QLExpress script can be saved in the database, and the relevant calculation script is dynamically loaded from the database when calculating the service fee.
[0067] In actual applications, when it is necessary to calculate the service fee for a certain banking business, the service fee rule parameter can be converted into a service fee rule parameter object, and the Java reflection mechanism is used to obtain the attribute name and attribute value corresponding to the service fee rule parameter object, and then the attribute name and attribute value corresponding to the service fee rule parameter object are stored in the first key-value pair set. At the same time, the transaction detail sample data for which the service fee needs to be calculated can also be converted into a service fee transaction detail object, and the Java reflection mechanism is used to obtain the attribute name and attribute value corresponding to the service fee transaction detail object, and then the attribute name and attribute value corresponding to the service fee transaction detail object are stored in the second key-value pair set. Then, when calculating the service fee, the first key-value pair set and the second key-value pair set can be passed into the QLExpress script engine.
[0068] Step S20: Determine whether there is a target object attribute name in the first key-value pair set and the second key-value pair set that is the same as the script attribute name in the service fee calculation script.
[0069] It should be noted that the above script attribute name may be an attribute name configured in the service fee calculation script. In this embodiment, the device may configure the QLExpress service fee calculation script in the QLExpress script engine. Since the QLExpress service fee calculation script is configured with the logical calculation relationship between the service fee rule parameters and the service fee detail data, and the logical calculation relationship between the service fee rule parameters and the service fee detail data in the QLExpress service fee calculation script is represented by the corresponding attribute names of the two, several script attribute names are configured in the QLExpress service fee calculation script.
[0070] It should be understood that the target object attribute name may be an attribute name in the first key-value pair set and the second key-value pair set that has the same name as the script attribute name.
[0071] Step S30: If it exists, the service fee calculation script is updated based on the target object attribute name to obtain an updated service fee calculation script.
[0072] In this embodiment, if there is a target object attribute name in the first key-value pair set and / or the second key-value pair set that is the same as the script attribute name in the service fee calculation script, the script attribute name in the service fee calculation script can be replaced with the attribute value corresponding to the target attribute name to update the service fee calculation script and obtain the updated service fee calculation script.
[0073] Step S40: determining the service fee of the task to be calculated based on the updated service fee calculation script.
[0074] In actual applications, after replacing the attribute names in the calculation formula between the service fee rule parameters and the service fee details data in the service fee calculation script with the attribute values in the first key-value pair set and / or the second key-value pair set, the service fee calculation script engine can automatically calculate the service fee for the task to be calculated through the service fee calculation script.
[0075] Furthermore, the method also includes: configuring a service fee calculation script corresponding to the task to be calculated, and storing the service fee calculation script in a preset script database; when a calculation logic change request is detected, loading the service fee calculation script from the preset script database, and displaying the service fee calculation script through a visualization page; and changing the service fee calculation script in the visualization page based on the calculation logic change request.
[0076] It should be understood that the preset script database may be a database for storing scripts for calculating service fees. The calculation logic change request may be a request for instructing to change the logic for calculating service fees.
[0077] In actual applications, if the business logic is fixed in the application, the logic changes lack flexibility, and the code readability and maintainability are poor. If the business scenarios or rules change frequently, it is not possible to quickly respond to changes in business needs. In this solution, the service fee calculation script corresponding to the task to be calculated can be pre-configured and stored in the preset script database. When a calculation logic change request is received later, the service fee calculation script can be loaded from the preset script database to the visualization page, and the service fee calculation script can be changed directly in the visualization page. That is, in this solution, when the service fee calculation logic needs to be changed, it is only necessary to modify the calculation logic in the database, and it is no longer necessary to execute the online release process of the application, which can save development, testing and operation and maintenance costs, and at the same time improve the flexibility of calculation logic changes. In addition, since the service fee calculation logic in this solution is uniformly maintained by the visual management page, it can quickly respond to changes in business needs.
[0078] In this embodiment, by using a visualization function to uniformly maintain the service fee calculation logic, the code readability and maintainability are improved, while saving subsequent development costs and maintenance costs, and reducing the probability of program errors. In addition, in this solution, the service fee calculation logic can be saved in the database, and the service fee calculation logic can be modified through the visualization page, thereby achieving the purpose of configurable service fee calculation logic. If the service fee calculation logic changes, the QLExpress script can be directly modified through the visualization page. The modification will take effect immediately after completion, and there is no need to execute the online release process of the application, which can improve development efficiency, quickly respond to changes in business needs, and reduce development, testing and operation and maintenance costs.
[0079] The present embodiment provides a method for determining a service fee, which discloses transmitting a first key-value pair set and a second key-value pair set corresponding to a task to be calculated to a service fee calculation script engine; wherein the first key-value pair set stores a first object attribute name corresponding to a service fee rule parameter object, and the second key-value pair set stores a second object attribute name corresponding to a service fee transaction detail object; determining whether there is a target object attribute name in the first key-value pair set and the second key-value pair set that is the same as the script attribute name in the service fee calculation script; if so, updating the service fee calculation script based on the target object attribute name to obtain an updated service fee calculation script; determining the task to be calculated based on the updated service fee calculation script service fee; compared with the prior art, when changing the service fee calculation logic, the developer needs to modify the corresponding program code, which is tested and verified by the tester and finally released to the production environment by the operation and maintenance personnel. The calculation logic can be changed and the service fee can be calculated only after the online process is completed. Since the target object attribute name in the first key-value pair set and the second key-value pair set have the same attribute name as that in the service fee calculation script, the service fee calculation script is updated based on the target object attribute name, and the service fee is determined by the updated service fee calculation script, thereby solving the technical problem that the service fee calculation method in the prior art has a long process for changing the calculation logic, resulting in low efficiency in service fee calculation.
[0080] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2 A flowchart diagram of the second embodiment of the method for determining the application service fee.
[0081] In this embodiment, before step S10, the service fee determination method further includes steps S01 to S03:
[0082] Step S01: converting the service fee rule parameters in the service fee calculation rule corresponding to the task to be calculated into a service fee rule parameter object.
[0083] It should be noted that the above service fee calculation rules are the rules for calculating the service fee of the business. Figure 3 , Figure 3 This is an example diagram of configuring the service fee rules in the service fee determination method for this application. Figure 3As shown, the service fee rule parameters in the service fee calculation rules in this embodiment may include: billing mode, loan amount ratio, actual interest rate, actual penalty interest rate, etc. For example, the user may pre-configure the business with channel code 1001 in institution 001 as follows: billing mode: A001; loan amount ratio: 1; actual interest rate: 1.2; actual penalty interest rate: 0.4; the business with channel code 1002 in institution 002 as follows: billing mode: A002; loan amount ratio: 1.2; actual interest rate: 1.5; actual penalty interest rate: 0.6; the business with channel code 1003 in institution 003 as follows: billing mode: A003; loan amount ratio: 1.5; actual interest rate: 1.8; actual penalty interest rate: 0.8, etc. This embodiment does not impose any restrictions on this.
[0084] It should be noted that the above service fee rule parameter object may be a JavaBean object corresponding to the service fee rule parameter, wherein a Java Bean object is a reusable component in a Java application, and a Bean object is usually used to encapsulate data and provide methods for accessing the data.
[0085] Step S02: obtaining the first object attribute name and the first object attribute value corresponding to the service fee rule parameter object through a preset reflection mechanism.
[0086] It should be understood that the above-mentioned preset reflection mechanism can be a mechanism with the function of allowing the program to check or modify the behavior of its classes and objects at runtime. In this embodiment, the preset reflection mechanism can be a Java reflection mechanism. Among them, the Java reflection mechanism means that in the running state of the program, an object of any class can be constructed, the class to which any object belongs can be understood, the member variables and methods of any class can be understood, and the properties and methods of any object can be called.
[0087] It can be understood that the first object attribute name and the first object attribute value are respectively the attribute name and attribute value corresponding to the service fee rule parameter object, such as Figure 3 As shown, the first object attribute names in this embodiment may include: feeModel, realFeeRate, realIncRate, etc.
[0088] Step S03: Store the first object attribute name and the first object attribute value into a first key-value pair set.
[0089] Specifically, the step S03 includes: updating the first object attribute name based on the target suffix identifier to obtain an updated first object attribute name; storing the updated first object attribute name as a key value and the first object attribute value as an identifier value in a first key-value pair set.
[0090] It should be noted that the above-mentioned target suffix identifier can be an identifier for distinguishing the attribute names in the first key-value pair set and the second key-value pair set. In this embodiment, _R can be added as a suffix to the first object attribute name, and then the first object attribute name with the suffix added is used as the key value, and the first object attribute value is stored in the first key-value pair set as the identifier value. For example, for the attribute name feeModel, the key (key value) put into the Java Map collection is the attribute name feeModel_R with the suffix added, and the corresponding value (identifier) stores the value corresponding to the Bean attribute name feeModel; for the attribute name loanRate, the key put into the Java Map collection is loanRate_R, and the corresponding value stores the value corresponding to the Bean attribute name loanRate.
[0091] Furthermore, before step S10, it also includes: converting the transaction detail data corresponding to the task to be calculated into a service fee transaction detail object; obtaining the second object attribute name and the second object attribute value corresponding to the service fee transaction detail object through a preset reflection mechanism; and storing the second object attribute name and the second object attribute value in a second key-value pair set.
[0092] It should be understood that the transaction details data is the data for which the service fee is to be calculated; the service fee transaction details object may be a Java Bean object corresponding to the transaction details data for which the service fee is to be calculated. Figure 4 , Figure 4 This is an example of the data details required to calculate the service fee in this application service fee determination method. Figure 4 As shown, the transaction details data in this embodiment may include: loan principal, actual interest collected, actual penalty interest collected, interest refund, penalty interest refund, etc.
[0093] It can be understood that the second object attribute name and the second object attribute value are the attribute name and attribute value corresponding to the service fee transaction detail object respectively. Figure 4 As shown, the second object attribute names in this embodiment may include: loanPrinAmt, interestAmt, penaltyAmt, returnAmtI and returnAmtW, etc.
[0094] In this embodiment, the device can convert the transaction details data for which the service fee needs to be calculated into a Java Bean object, use the Java reverse mechanism to obtain the attribute value corresponding to the Java Bean attribute name when calculating the service fee, and put the obtained attribute name and the corresponding attribute value into a Java Map collection (i.e., the second key-value pair collection mentioned above). In addition, if the amount of transaction details data is relatively large, batch processing is required.
[0095] In the specific implementation, refer to Figure 5 , Figure 5 This is an example diagram of the business function flow in this application service fee determination method. Figure 5 As shown, in this embodiment, the transaction details data for calculating the service fee can be derived from a database, a file or other data source, and the service fee rule parameter configuration can be maintained by business personnel. At the same time, the QLExpress script calculation logic can be written and maintained by developers. When the service fee needs to be calculated, the service fee rule parameters and the transaction details data can be converted into Java Bean objects, and the first object attribute name and the first object attribute value corresponding to the service fee rule parameter object, and the second object attribute name and the second object attribute value corresponding to the service fee transaction details object are obtained through the Java reflection mechanism, and then the first object attribute name and the first object attribute value are stored in the fee rule Map (i.e., the first key-value pair set mentioned above), where the key value needs to be suffixed with _R after the attribute name, and the second object attribute name and the second object attribute value are stored in the transaction details Map (i.e., the second key-value pair set mentioned above). When calculating the service fee, a QLExpress script engine running object can be created, and then the QLExpress calculation script can be loaded, and the Java Map set of the service fee rule parameters and the transaction details data can be passed in, and the service fee can be calculated according to the QLExpress script logic, and finally the calculation result of the service fee can be stored in the database.
[0096] In this embodiment, it is disclosed that the service fee rule parameters in the service fee calculation rules corresponding to the task to be calculated are converted into a service fee rule parameter object; the first object attribute name and the first object attribute value corresponding to the service fee rule parameter object are obtained through a preset reflection mechanism; the first object attribute name and the first object attribute value are stored in a first key-value pair set; because this embodiment can store the object attribute names and object attribute values corresponding to the service fee rule parameter object and the service fee transaction details object in the key-value pair set, the key-value pair set can be directly passed into the service fee calculation script engine to perform service fee calculation, thereby improving the service fee calculation efficiency.
[0097] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 6 , Figure 6 This is a flow chart of the third embodiment of the method for determining the application service fee.
[0098] In this embodiment, step S30 includes steps S301 to S303:
[0099] Step S301: If it exists, determine the target object attribute value corresponding to the target object attribute name.
[0100] It can be understood that the above target object attribute value is the attribute value corresponding to the object represented by the target object attribute name, for example, Figure 5 The attribute value corresponding to the attribute name loanPrinAmt shown in the figure is 10000.
[0101] Furthermore, the step of determining the target object attribute value corresponding to the target object attribute name includes: traversing and querying the first key-value pair set and the second key-value pair set based on the target object attribute name; and determining the target object attribute value corresponding to the target object attribute name according to the query result.
[0102] In this embodiment, since the attribute names and attribute values in the first key-value pair set and the second key-value pair set are stored correspondingly, after determining the target object attribute name, the first key-value pair set and the second key-value pair set can be traversed and queried according to the target object attribute name to obtain the target object attribute value corresponding to the target object attribute name.
[0103] Step S302: replacing the script attribute name according to the target object attribute value.
[0104] Step S303: When the replacement is completed, obtain the updated service fee calculation script.
[0105] In actual applications, after determining the target object attribute value, the service fee calculation script can automatically replace the script attribute name with the target object attribute value, and calculate the service fee according to the logical calculation formula configured therein.
[0106] In the specific implementation, refer to Figure 7 , Figure 7 This is an example diagram of the service fee calculation script in the service fee determination method of this application. Figure 7As shown, in this embodiment, the attribute names with _R as the suffix in the service fee calculation script are the service fee rule related parameter names, such as feeModel_R, realFeeRate_R and realIncRate_R, etc.; the attribute names with non-_R as the suffix are the transaction details related parameter names that need to calculate the service fee, such as loanPrinAmt, interestAmt, penaltyAmt, returnAmtI and returnAmtW, etc. When calculating the service fee, the pre-assembled first key-value pair set and the second key-value pair set can be passed into the service fee calculation script engine. If Figure 7 The attribute name in the service fee calculation script is the same as the key value in the passed-in Java Map collection (that is, the script attribute name in the service fee calculation script is the same as the attribute name in the key-value pair collection), the script engine can automatically Figure 7 Replace the attribute name with the value corresponding to the Java Map collection, and calculate the service fee of the business according to the mathematical formula configured in the service fee calculation script.
[0107] In this embodiment, it is disclosed that if the target object attribute value corresponding to the target object attribute name exists, the script attribute name is determined; the script attribute name is replaced according to the target object attribute value; when the replacement is completed, an updated service fee calculation script is obtained, so that the attribute name in the service fee calculation script can be directly replaced according to the attribute value stored in the key-value pair set and the service fee calculation can be performed, thereby improving the efficiency of service fee calculation.
[0108] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for determining the service fee of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0109] This application also provides a service fee determination device, please refer to Figure 8 , the service fee determination device comprises:
[0110] The data transmission module 10 is used to transmit the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine; wherein the first key-value pair set stores the first object attribute name corresponding to the service fee rule parameter object, the second key-value pair set stores the second object attribute name corresponding to the service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script;
[0111] An attribute name determination module 20 is used to determine whether there is a target object attribute name that is the same as the script attribute name in the service fee calculation script in the first key-value pair set and the second key-value pair set;
[0112] A script updating module 30, configured to update the service fee calculation script based on the target object attribute name if it exists, to obtain an updated service fee calculation script;
[0113] The service fee determination module 40 is used to determine the service fee of the task to be calculated based on the updated service fee calculation script.
[0114] The service fee determination device provided by the present application adopts the service fee determination method in the above embodiment, which can solve the technical problem that the service fee calculation method in the prior art has a long process for changing the calculation logic, resulting in low efficiency of service fee calculation. Compared with the prior art, the beneficial effects of the service fee determination device provided by the present application are the same as the beneficial effects of the service fee determination method provided by the above embodiment, and other technical features in the service fee determination device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0115] The present application provides a service fee determination device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the service fee determination method in the above-mentioned embodiment 1.
[0116] Reference below Fig. 9 , which shows a schematic diagram of the structure of a service fee determination device suitable for implementing an embodiment of the present application. The service fee determination device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The service fee determination device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0117] like Fig. 9As shown, the service fee determination device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the service fee determination device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the service fee determination device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a service fee determination device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0118] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0119] The service fee determination device provided by the present application adopts the service fee determination method in the above embodiment, which can solve the technical problem of service fee determination. Compared with the prior art, the beneficial effects of the service fee determination device provided by the present application are the same as the beneficial effects of the service fee determination method provided by the above embodiment, and other technical features in the service fee determination device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0120] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0122] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the service fee determination method in the above-mentioned embodiment.
[0123] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0124] The computer-readable storage medium may be included in the service fee determination device; or may exist independently without being assembled into the service fee determination device.
[0125] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the service fee determination device, the service fee determination device: transmits the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine; wherein the first key-value pair set stores the first object attribute name corresponding to the service fee rule parameter object, and the second key-value pair set stores the second object attribute name corresponding to the service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script; determines whether there is a target object attribute name in the first key-value pair set and the second key-value pair set that is the same as the script attribute name in the service fee calculation script; if so, updates the service fee calculation script based on the target object attribute name to obtain an updated service fee calculation script; and determines the service fee of the task to be calculated based on the updated service fee calculation script.
[0126] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0128] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0129] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned service fee determination method, and can solve the technical problem that the service fee calculation method in the prior art has a long process for changing the calculation logic, resulting in low efficiency in service fee calculation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the service fee determination method provided by the above-mentioned embodiment, and will not be repeated here.
[0130] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for determining a service fee, characterized in that: The method includes: The first key-value pair set and the second key-value pair set corresponding to the task to be calculated are transmitted to the service fee calculation script engine; wherein the first key-value pair set stores the first object attribute name corresponding to the service fee rule parameter object, the second key-value pair set stores the second object attribute name corresponding to the service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script; Determine whether there is a target object attribute name that is the same as the script attribute name in the service fee calculation script in the first key-value pair set and the second key-value pair set; If it exists, updating the service fee calculation script based on the target object attribute name to obtain an updated service fee calculation script; The service fee of the task to be calculated is determined based on the updated service fee calculation script.
2. The method according to claim 1, characterized in that Before the step of transmitting the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine, the step further includes: Convert the service fee rule parameters in the service fee calculation rule corresponding to the task to be calculated into a service fee rule parameter object; Obtaining a first object attribute name and a first object attribute value corresponding to the service fee rule parameter object through a preset reflection mechanism; The first object attribute name and the first object attribute value are stored in a first key-value pair set.
3. The method according to claim 2, characterized in that The step of storing the first object attribute name and the first object attribute value into a first key-value pair set includes: The first object attribute name is updated based on the target suffix identifier to obtain an updated first object attribute name; The updated first object attribute name is used as a key value and the first object attribute value is used as an identification value and stored in a first key-value pair set.
4. The method according to claim 1, characterized in that Before the step of transmitting the first key-value pair set and the second key-value pair set corresponding to the task to be calculated to the service fee calculation script engine, the step further includes: Convert the transaction details data corresponding to the task to be calculated into a service fee transaction details object; Obtaining a second object attribute name and a second object attribute value corresponding to the service fee transaction detail object through a preset reflection mechanism; The second object attribute name and the second object attribute value are stored in a second key-value pair set.
5. The method according to any one of claims 1 to 4, characterized in that If the service fee calculation script exists, the step of updating the service fee calculation script based on the target object attribute name to obtain an updated service fee calculation script includes: If it exists, determining the target object attribute value corresponding to the target object attribute name; Replacing the script attribute name according to the target object attribute value; When the replacement is completed, obtain the updated service fee calculation script.
6. The method according to claim 5, characterized in that The step of determining the target object attribute value corresponding to the target object attribute name comprises: Performing a traversal query on the first key-value pair set and the second key-value pair set based on the target object attribute name; The target object attribute value corresponding to the target object attribute name is determined according to the query result.
7. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Configure a service fee calculation script corresponding to the task to be calculated, and store the service fee calculation script in a preset script database; When a calculation logic change request is detected, the service fee calculation script is loaded from the preset script database, and the service fee calculation script is displayed through a visualization page; The service fee calculation script is changed in the visualization page based on the calculation logic change request.
8. A device for determining a service fee, characterized in that: The device comprises: A data transmission module, used for transmitting a first key-value pair set and a second key-value pair set corresponding to the task to be calculated to a service fee calculation script engine; wherein the first key-value pair set stores a first object attribute name corresponding to a service fee rule parameter object, and the second key-value pair set stores a second object attribute name corresponding to a service fee transaction detail object, and the service fee calculation script engine is configured with a service fee calculation script; An attribute name determination module, used for determining whether there is a target object attribute name that is the same as the script attribute name in the service fee calculation script in the first key-value pair set and the second key-value pair set; A script updating module, configured to update the service fee calculation script based on the target object attribute name if it exists, to obtain an updated service fee calculation script; A service fee determination module is used to determine the service fee of the task to be calculated based on the updated service fee calculation script.
9. A service fee determination device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the service fee determination method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the service fee determination method according to any one of claims 1 to 7 are implemented.
