A compensation accounting full-link data traceability method and system
By decoupling the dynamic payroll calculation class into calculation functions, formulas, and calculation classes, intermediate results are obtained and stored, and calculation result reports are generated. This solves the problem of not being able to trace intermediate results in payroll calculation, and improves the accuracy and efficiency of payroll calculation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2026-07-21
Smart Images

Figure CN117076275B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for tracing the entire data chain of payroll calculation. Background Technology
[0002] As current compensation and benefits policies become increasingly diversified and complex, the diversity of salary items and personnel attributes makes it difficult for corporate payroll specialists to calculate salaries. This results in complex payroll rules, long intermediate result logic chains, and an inability to guarantee the accuracy of the calculation results.
[0003] Existing technical solutions can only view the final result after payroll calculation is completed, or trace data discrepancies between multiple calculations. The lack of traceability for intermediate results leads to a crisis of trust from customers. For example, the value of basic salary is related to salary adjustment data, job grade, and employment relationship information. Current technical solutions only obtain the final basic salary result. If two calculations are inconsistent, customers are unclear which of these data points—salary adjustment data, job grade, or employment relationship—changed, leading to the change in the final result.
[0004] In short, the existing technology has the following drawbacks: when the calculation results are abnormal, IT personnel need to locate the problem through background logs, calculation logs, etc., which makes customer operation and maintenance work very difficult; the background logs have timeliness issues, and may not be traceable if the operation and maintenance personnel cannot be contacted in time; there are no intermediate result traceability reports during the calculation process, making it impossible to detect abnormal information. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of the prior art by proposing a full-chain data traceability method for payroll calculation, which enables full-chain traceability of payroll calculation results, thereby improving the flexibility and efficiency of payroll calculation.
[0006] In a first aspect, the present invention provides a method for full-chain data traceability in payroll calculation, including:
[0007] Obtain the raw salary calculation data, and call the corresponding dynamic accounting class based on the raw salary calculation data; wherein, the dynamic accounting class includes multiple decoupled dynamic classes;
[0008] Based on the call point of the dynamic class, obtain the dynamic proxy object of the call point, and intercept the intermediate results of the dynamic class based on the dynamic proxy object; wherein, the intermediate results include at least one of the function parameters, formula parameters, or process data of the dynamic class;
[0009] Based on the calling point corresponding to the intermediate result, at least one of the function parameters, the formula parameters, or the process data is stored to obtain the intermediate result mapping relationship;
[0010] The calculation dynamic class is called to process the intermediate result mapping relationship and obtain a calculation result report, so that the user can trace back based on the calculation result report.
[0011] This invention employs a method of calling a dynamic calculation function class based on the original payroll data. Based on the specific call point of this dynamic class, intermediate results from the calculation based on the original payroll data are obtained. These intermediate results provide feedback on the entire payroll calculation data chain. Specifically, when payroll calculation is abnormal, users can quickly trace the source and pinpoint the data anomaly based on the obtained intermediate results, thereby improving payroll calculation efficiency. Furthermore, storing the corresponding intermediate results extends their validity period, facilitating further calculations and enabling users to quickly trace the entire payroll chain, thus further improving payroll calculation efficiency.
[0012] Furthermore, the dynamic accounting class includes multiple decoupled dynamic classes, including:
[0013] The initial dynamic accounting class is decoupled to obtain an accounting function class, an accounting formula class, and a calculation class. Corresponding dynamic classes are then generated for the accounting function class, accounting formula class, and calculation class to obtain the decoupled dynamic accounting class. The dynamic accounting class includes: an accounting function dynamic class, an accounting formula dynamic class, and a calculation dynamic class.
[0014] This invention decouples the initial dynamic calculation class, resulting in dynamic classes for calculation functions, calculation formulas, and calculations. This refines the functionality of the initial calculation function, generating multiple dynamic classes with single responsibilities, facilitating the high-level aggregation of internal functions and formulas. Furthermore, it encapsulates the dynamic classes corresponding to the obtained calculation functions, calculation formulas, and calculations, enabling the division of complex initial calculation function dynamic classes into single-function dynamic classes for calculation functions, calculation formulas, and calculations. This facilitates the maintenance of the dynamic classes, and further calculations based on the obtained dynamic classes allow for the easy display of intermediate results, enabling users to quickly trace the entire process and thus improving the efficiency of payroll calculation.
[0015] Furthermore, the initial dynamic calculation class is decoupled to obtain a calculation function class, a calculation formula class, and a calculation class, and corresponding dynamic classes are generated for the calculation function class, the calculation formula class, and the calculation class, respectively; wherein, obtaining the dynamic classes corresponding to the calculation function class and the calculation formula class specifically involves: parsing the calculation function and the calculation formula in the initial dynamic calculation class to obtain the function body and the formula body, respectively, and converting the function body and the formula body into corresponding string code fragments to obtain the first string code fragment corresponding to the function body and the second string code fragment corresponding to the formula body;
[0016] The first string code fragment and the second string code fragment are respectively converted into executable bytecode, resulting in executable dynamic classes of calculation functions and calculation formulas, so that the dynamic classes of calculation functions and calculation formulas can be directly called.
[0017] Furthermore, the step of obtaining the dynamic proxy object of the call point based on the call point of the dynamic class, and intercepting the intermediate results of the dynamic class based on the dynamic proxy object, includes:
[0018] In the preset calculation entry dynamic class, the calculation formula dynamic class is called. If the calculation formula dynamic class applies a first calculation function, the first calculation function dynamic class corresponding to the first calculation function is directly called so that the first intermediate result of the calculation formula dynamic class is intercepted by the first dynamic proxy object corresponding to the first calculation function dynamic class. The calculation dynamic class includes the calculation formula dynamic class and the first calculation function dynamic class.
[0019] Furthermore, the step of directly calling the first calculation function dynamic class corresponding to the first calculation function, so as to intercept the first intermediate result of the calculation formula dynamic class according to the first dynamic proxy object corresponding to the first calculation function dynamic class, includes:
[0020] Obtain the first call point corresponding to the first dynamic class of the first accounting function, and at the first call point, obtain the first dynamic proxy object corresponding to the first dynamic class of the first accounting function;
[0021] Based on the first interceptor pre-declared in the first dynamic proxy object, the first function parameter of the first calculation function is obtained, and the first function parameter is encapsulated to obtain the first intermediate result; wherein, the first function parameter includes: a first input parameter and a first output parameter.
[0022] Furthermore, before calling the dynamic class of the accounting formula in the preset calculation entry dynamic class, the following steps are included:
[0023] The second accounting function dynamic class is directly called in the dynamic class of the calculation entry point, and the second dynamic proxy object corresponding to the accounting function dynamic class is obtained at the second call point corresponding to the second accounting function dynamic class; wherein, the accounting dynamic class includes: the second accounting function dynamic class;
[0024] According to the second interceptor pre-declared in the second dynamic proxy object, the second function parameter of the second calculation function is obtained, and the second function parameter is encapsulated to obtain the second intermediate result; wherein, the second function parameter includes: a second input parameter and a second output parameter.
[0025] Furthermore, it also includes:
[0026] If the first calculation function is not applied in the dynamic class of the calculation formula, then the third call point corresponding to the dynamic class of the calculation formula is obtained, and at the third call point, the third dynamic proxy object corresponding to the dynamic class of the calculation formula is obtained;
[0027] Based on the third interceptor pre-declared in the third dynamic proxy object, the formula parameters and process data of the calculation formula are obtained, and the formula parameters and process data are encapsulated to obtain the third intermediate result; wherein, the process data includes the pre-processed original salary calculation data.
[0028] Furthermore, the step of calling the dynamic class to process the intermediate result mapping relationship and obtain a calculation result report includes:
[0029] The data obtained from the intermediate result mapping relationship is used as the fourth intermediate result, and the calculation dynamic class is called to calculate the fourth intermediate result to obtain the first calculation result corresponding to the salary item; wherein, the calculation dynamic class includes the calculation dynamic class;
[0030] If the first calculation result differs from the initial second calculation result, a corresponding calculation result report is generated based on the first calculation result, the second calculation result, and the fourth intermediate result, according to the specific business requirements.
[0031] Furthermore, the step of calling the dynamic accounting class to process the intermediate result mapping relationship also includes:
[0032] When the number of fourth intermediate results in the intermediate result mapping relationship reaches the recording threshold, the computation dynamic class is called to save the fourth intermediate results to the database in a single-threaded pool, and at the same time, the saved fourth intermediate results are released.
[0033] Furthermore, after obtaining the raw salary calculation data, the method further includes: preprocessing the raw salary calculation data, specifically:
[0034] The calculation logic of the dynamic class is sorted out, and the original salary calculation data is classified according to the calculation logic. The classification results are stored in the cache so that the preprocessed original salary calculation data can be read directly from the cache.
[0035] Secondly, the present invention also provides a full-chain data traceability system for payroll calculation, comprising:
[0036] The calling module is used to obtain the original salary calculation data and call the corresponding dynamic accounting class based on the original salary calculation data; wherein, the dynamic accounting class includes multiple decoupled dynamic classes;
[0037] The intermediate result acquisition module is used to acquire the dynamic proxy object of the call point of the dynamic class, and intercept the intermediate result of the dynamic class based on the dynamic proxy object; wherein, the intermediate result includes at least one of the function parameters, formula parameters or process data of the dynamic class;
[0038] The mapping module is used to store at least one of the function parameters, the formula parameters, or the process data according to the calling point corresponding to the intermediate result, so as to obtain the intermediate result mapping relationship;
[0039] The traceability module is used to call the dynamic class to process the intermediate result mapping relationship and obtain a calculation result report so that the user can trace the result based on the calculation result report. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating the full-chain data traceability method for payroll calculation provided in this embodiment of the invention.
[0041] Figure 2 This is a business flow diagram of the full-link data traceability method for payroll calculation provided in this embodiment of the invention;
[0042] Figure 3 This is a flowchart illustrating the full-chain data traceability method for payroll calculation provided in this embodiment of the invention.
[0043] Figure 4 This is a flowchart illustrating the full-chain data traceability method for payroll calculation provided in this embodiment of the invention.
[0044] Figure 5 This is a schematic diagram of the structure of the full-link data traceability system for payroll calculation provided in this embodiment of the invention. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] It is worth noting that the data sources for the raw payroll calculation are numerous, including: personnel information, system information, calculation information, log information, and front-end data; among which, personnel information includes: personnel data, attendance data, and salary adjustment data. Furthermore, during the payroll calculation process, intermediate results are used again for further calculations. The complexity of the raw data sources and the calculation process itself leads to a complex calculation chain for payroll calculation. When users perform calculations, if the calculation results fail or multiple results are inconsistent, it becomes impossible to determine at which data node the anomaly occurred.
[0047] Based on this, the technical concept of the present invention is as follows: by decoupling the initial dynamic calculation class according to the principle of single function, function class, formula class and calculation class are obtained, and dynamic classes are generated accordingly. By setting the call point in the corresponding dynamic class, the intermediate results of the corresponding dynamic class are intercepted, and the final calculation result report is obtained based on the intermediate results, so that users can perform full-chain traceability based on the calculation result report, thereby improving the efficiency of payroll calculation.
[0048] Example 1, see Figure 1 This is a flowchart illustrating the full-chain data traceability method for payroll calculation provided in this embodiment of the invention, including steps S11 to S14, specifically:
[0049] Step S11: Obtain the original salary calculation data and call the corresponding dynamic accounting class according to the original salary calculation data; wherein, the dynamic accounting class includes multiple decoupled dynamic classes.
[0050] Specifically, obtaining the preprocessed raw salary calculation data involves: sorting out the calculation logic of the dynamic class, classifying the raw salary calculation data according to the calculation logic, and storing the classification results in a cache so that the preprocessed raw salary calculation data can be read directly from the cache.
[0051] Specifically, the calculation logic of the dynamic class is sorted out, and the original salary calculation data is classified according to the calculation logic, including: sorting out the calculation logic corresponding to the decoupled dynamic class, obtaining personnel information, system information, calculation information and front-end data, and classifying the personnel information, system information, calculation information and front-end data according to the dynamic class to obtain the classification results required for different dynamic classes; wherein, the calculation logic includes: the parameter structure required by the dynamic class and the parameter call situation between different dynamic classes.
[0052] This invention employs a dynamic class-based calculation logic, categorizes the original payroll data, and caches the categorization results. This facilitates subsequent calculations based directly on the cached data, reducing the amount of data computation and improving payroll calculation efficiency.
[0053] It is worth noting that during the payroll calculation process, the calculation engine records information such as intermediate results, personnel information, and resource caching, enabling traceability and tracking.
[0054] Obtaining multiple decoupled dynamic classes involves: decoupling the initial calculation dynamic class to obtain a calculation function class, a calculation formula class, and a calculation class, and generating corresponding dynamic classes for each of the calculation function class, calculation formula class, and calculation class to obtain the decoupled calculation dynamic class; wherein, the calculation dynamic class includes: a calculation function dynamic class, a calculation formula dynamic class, and a calculation dynamic class.
[0055] This invention employs a method of decoupling the initial calculation function dynamic class from data, resulting in a calculation function dynamic class, a calculation formula dynamic class, and a calculation dynamic class. The initial calculation function state class is further decoupled based on different operations on the data, thereby refining the functionality of the initial calculation function and generating multiple dynamic classes with single responsibilities for easy internal aggregation. Furthermore, the resulting calculation function, calculation formula, and calculation-generated corresponding dynamic classes are functionally encapsulated. This allows for the division of complex initial calculation function dynamic classes into functionally single-function calculation function dynamic classes, calculation formula dynamic classes, and calculation dynamic classes, facilitating the maintenance of these dynamic classes. Further calculations based on these dynamic classes facilitate the display of intermediate results, enabling users to quickly trace the entire process and thus improving payroll calculation efficiency.
[0056] Specifically, the initial dynamic calculation class is decoupled to obtain a calculation function class, a calculation formula class, and a calculation class. Corresponding dynamic classes are then generated for each of these classes. Obtaining the dynamic classes for the calculation function class and the calculation formula class involves: parsing the calculation function and calculation formula in the initial dynamic calculation class to obtain the function body and formula body, respectively. The function body and formula body are then converted into corresponding string code fragments, resulting in a first string code fragment corresponding to the function body and a second string code fragment corresponding to the formula body. These first and second string code fragments are then converted into executable bytecode, resulting in executable dynamic calculation function classes and dynamic calculation formula classes, allowing direct invocation of these classes.
[0057] The initial dynamic calculation class is decoupled, and each function and each highly readable formula is treated as a method. The functions and formulas are converted into string code fragments, and then the string code fragments are converted into executable bytecode. This process can be implemented using third-party technologies or can be extended based on the initial dynamic calculation class. The calculation class is obtained by re-parsing and encapsulating the remaining code of the calculation function class and calculation formula class after decoupling from the initial dynamic calculation class. Therefore, no third-party technology is required, and the calculation dynamic class can be obtained directly from the calculation class.
[0058] As a preferred embodiment, string code snippets are converted into executable bytecode using Java Assist third-party technology.
[0059] It is worth noting that the calculation function and calculation formula in the initial calculation function are not decoupled. When generating the corresponding initial calculation object dynamic class based on the initial calculation function, both the calculation function and the calculation formula are within the same initial calculation object dynamic class. Because the initial calculation object dynamic class does not decouple its internal calculation function and calculation formula, it is impossible to quickly trace the source when performing salary calculation. This invention decouples the initial calculation function and generates a dynamic class for each of the resulting calculation functions, calculation formulas, and calculations.
[0060] Step S12: Based on the call point of the dynamic class, obtain the dynamic proxy object of the call point, and intercept the intermediate results of the dynamic class based on the dynamic proxy object; wherein, the intermediate results include at least one of the function parameters, formula parameters, or process data of the dynamic class.
[0061] The process of obtaining a dynamic proxy object for the call point of the dynamic class and intercepting the intermediate result of the dynamic class based on the dynamic proxy object includes: calling a calculation formula dynamic class in a preset calculation entry dynamic class; if a first calculation function is applied in the calculation formula dynamic class, then directly calling the first calculation function dynamic class corresponding to the first calculation function, so that the first intermediate result of the calculation formula dynamic class is intercepted based on the first dynamic proxy object corresponding to the first calculation function dynamic class; wherein the calculation dynamic class includes: the calculation formula dynamic class and the first calculation function dynamic class.
[0062] The method of directly calling the dynamic class of the first calculation function corresponding to the first calculation function, so as to intercept the first intermediate result of the calculation formula dynamic class according to the first dynamic proxy object corresponding to the first calculation function dynamic class, includes: obtaining the first call point corresponding to the first calculation function dynamic class, and obtaining the first dynamic proxy object corresponding to the first calculation function dynamic class at the first call point; obtaining the first function parameter of the first calculation function according to the first interceptor pre-declared in the first dynamic proxy object, and encapsulating the first function parameter to obtain the first intermediate result; wherein the first function parameter includes: a first input parameter and a first output parameter.
[0063] If the first calculation function is not applied in the dynamic class of the calculation formula, then the third call point corresponding to the dynamic class of the calculation formula is obtained, and at the third call point, the third dynamic proxy object corresponding to the dynamic class of the calculation formula is obtained; according to the third interceptor pre-declared in the third dynamic proxy object, the formula parameters and process data of the calculation formula are obtained, and the formula parameters and process data are encapsulated to obtain the third intermediate result; wherein, the process data includes the preprocessed original salary calculation data.
[0064] Before calling the dynamic class of the accounting formula in the preset calculation entry dynamic class, the process includes: directly calling the second accounting function dynamic class in the calculation entry dynamic class, and obtaining the second dynamic proxy object corresponding to the accounting function dynamic class at the second call point corresponding to the second accounting function dynamic class; wherein, the accounting dynamic class includes: the second accounting function dynamic class; according to the second interceptor pre-declared in the second dynamic proxy object, obtaining the second function parameter of the second accounting function, and encapsulating the second function parameter to obtain the second intermediate result; wherein, the second function parameter includes: a second input parameter and a second output parameter.
[0065] It's worth noting that the dynamic entry point class is obtained by dynamically injecting the corresponding methods into the acquired entry point. The entry points of both the dynamic classes for the calculation function and the dynamic class for the calculation formula are placed within the dynamic entry point class for invocation. The dynamic entry point class can be defined based on the decoupled dynamic classes for the calculation function and the calculation formula, or the entry point can be declared in advance within the dynamic entry point class before obtaining the decoupled dynamic classes for the calculation function and the calculation formula. No specific limitation is imposed here.
[0066] As a preferred embodiment, EhCache caching technology is used to store the preprocessed raw accounting data in the cache. Therefore, in the dynamic class of accounting functions, dynamic class of accounting formulas, or dynamic class of calculations, data for all employees can be queried simultaneously, reducing database access.
[0067] It is worth noting that the payroll calculation process uses a percentage of the calculation progress to display the progress.
[0068] In a preferred embodiment, the dynamic proxy object is a Spring AOP (Aspect Oriented Programming) dynamic proxy object.
[0069] As a preferred embodiment, at each call point, a Spring AOP dynamic proxy object is obtained through a third-party Spring AOP aspect technology. The dynamic proxy object can then declare interceptors to obtain the input parameters and parameters of the calculation function, or to obtain formula parameters and process data, etc.
[0070] As a preferred embodiment, dynamic proxy objects are dynamically injected into the calculation function class and the calculation formula class at runtime.
[0071] It is worth noting that if dynamic proxy objects are injected into the calculation function class and calculation formula class at runtime, different payroll calculation items can be encapsulated into corresponding classes. This can isolate the calculation logic of different payroll calculation functions and formulas, thereby reducing the coupling between calculation functions and formulas, improving code reusability, increasing payroll calculation efficiency, and enabling unified maintenance of various payroll calculation functions.
[0072] As another preferred embodiment, dynamic proxy objects are statically injected into the calculation function class and the calculation formula class respectively at compile time.
[0073] Step S13: Based on the calling point corresponding to the intermediate result, store at least one of the function parameters, the formula parameters, or the process data to obtain the intermediate result mapping relationship.
[0074] Specifically, based on the personnel information used for payroll calculation, at least one of the function parameters, formula parameters, or process data is stored in a cache to obtain an intermediate result mapping relationship; wherein, the original payroll data includes the personnel information.
[0075] The process of calling the dynamic class to process the intermediate result mapping relationship to obtain a calculation result report includes: taking the data obtained from the intermediate result mapping relationship as the fourth intermediate result, and calling the calculation dynamic class to calculate the fourth intermediate result to obtain the first calculation result corresponding to the salary item; wherein, the calculation dynamic class includes the calculation dynamic class; if there is a difference between the first calculation result and the initial second calculation result, then according to the specific business, a corresponding calculation result report is generated based on the first calculation result, the second calculation result and the fourth intermediate result.
[0076] It is worth noting that, firstly, this invention decouples the initial dynamic accounting class to obtain a dynamic accounting class, which includes a dynamic accounting function class, a dynamic accounting formula class, and a dynamic calculation class; the original salary calculation data is preprocessed according to the calculation logic of the dynamic accounting function class, the dynamic accounting formula class, and the dynamic calculation class; the preprocessing includes classifying the original salary calculation data and storing it in a cache.
[0077] Then, the dynamic class of the calculation function is called in the preset calculation entry dynamic class. At the call point corresponding to the dynamic class of the calculation function, the dynamic proxy object is obtained. The input parameters and output parameters of the calculation function are obtained through the interceptor declared in advance by the dynamic proxy object. The input parameters and output parameters are encapsulated according to the personnel information of the salary calculation. The encapsulated intermediate result is obtained from the call point and stored in the intermediate result mapping relationship according to the personnel information.
[0078] It is worth noting that the input parameters include the preprocessed raw salary calculation data extracted from the cache, data recorded in the intermediate result mapping relationship, or data stored in the database; wherein, the intermediate result mapping relationship includes: intermediate data stored according to personnel information, which is the output parameter of the previously calculated accounting function dynamic class or the formula parameter of the previously calculated accounting formula dynamic class.
[0079] Next, the dynamic class for calculating the calculation formula is called from the preset calculation entry dynamic class. When calling the dynamic class for calculating the calculation formula, it is necessary to determine whether a calculation function is applied. If a calculation function is applied, the dynamic class for calculating the corresponding calculation function is called directly. Similarly, at the call point corresponding to the dynamic class for calculating the calculation function, a dynamic proxy object is obtained. Through the interceptor declared in advance by the dynamic proxy object, the input parameters and output parameters of the calculation function are obtained. According to the personnel information for salary calculation, the input parameters and output parameters are encapsulated. The encapsulated intermediate result is obtained from the call point, and the intermediate result is stored in the intermediate result mapping relationship according to the personnel information.
[0080] If no calculation function is applied, the dynamic class corresponding to the calculation formula is called. At the call point corresponding to the dynamic class of the calculation formula, a dynamic proxy object is obtained. Through the interceptor declared in advance by the dynamic proxy object, the formula parameters of the calculation formula and the process data in the calculation process are obtained. According to the personnel information of the payroll calculation, the formula parameters and process data are encapsulated. The encapsulated intermediate result is obtained from the call point, and the intermediate result is stored in the intermediate result mapping relationship according to the personnel information.
[0081] It is worth noting that the payroll calculation process includes n dynamic classes of calculation functions, m dynamic classes of calculation formulas, and l dynamic classes of calculations; where n, m, and l are all positive integers; each dynamic class of calculation formulas may or may not use any dynamic classes of calculations, or it may use one or more dynamic classes of calculations.
[0082] In one embodiment, the intermediate result mapping relationship includes: calculation processing information, basic personnel information, job / appointment information, salary adjustment data, attendance / leave data, performance appraisal results, accounting variable results, parsing instances, and log files.
[0083] It is worth noting that the process data includes calculation processing information and accounting variable results. The function parameters or formula parameters include the corresponding personnel information, job / appointment information, salary adjustment data, examination / leave data, performance appraisal results, and analysis examples. It can be understood that the intermediate result mapping relationship includes the calculation processing information, accounting variable results, and corresponding parameters for the corresponding dynamic class; the parameters include function parameters and formula parameters, and these parameters are obtained from the preprocessed raw salary calculation data.
[0084] Step S14: Call the calculation class to process the intermediate result mapping relationship and obtain a calculation result report so that the user can trace back based on the calculation result report.
[0085] The process of calling the dynamic class to process the intermediate result mapping relationship and obtain a calculation result report includes: using data obtained from the intermediate result mapping relationship as a fourth intermediate result, and calling the calculation dynamic class to calculate the fourth intermediate result to obtain a first calculation result corresponding to the salary item; wherein the calculation dynamic class includes the calculation dynamic class; if there is a difference between the first calculation result and the initial second calculation result, a corresponding calculation result report is generated according to the specific business, based on the first calculation result, the second calculation result, and the fourth intermediate result. The calculation result report is output using a business language.
[0086] When the number of fourth intermediate results in the intermediate result mapping relationship reaches the recording threshold, the computation dynamic class is called to save the fourth intermediate results to the database in a single-threaded pool, and at the same time, the saved fourth intermediate results are released.
[0087] It is worth noting that the present invention uses a computing engine to store the fourth intermediate result. In addition, system information and log information are also saved. That is, the calculation result report includes the intermediate result mapping relationship and the final salary calculation, as well as the corresponding generated system information and log information. The obtained calculation result report is output through business language to facilitate users to quickly trace the source.
[0088] As a preferred embodiment, a single-threaded pool is used to asynchronously save the first calculation result.
[0089] As a preferred embodiment, thread pool technology is used in the payroll calculation process.
[0090] In a preferred embodiment, the recording threshold is the same as the number of stored fourth intermediate results. It can be understood that for every N fourth intermediate results obtained, a single-threaded pool is used to asynchronously save them according to the personnel information; where N is a positive integer.
[0091] For example, if the intermediate result mapping relationship includes intermediate results of payroll calculation for 1000 employees, and the intermediate results include: input parameters, output parameters, formula parameters, variables and corresponding pay items, the intermediate results are stored in the calculation object of the corresponding calculation dynamic class. Since this data volume may be very large, the intermediate results are asynchronously saved once every 1000 employees are calculated, and the intermediate results already saved in the intermediate result mapping relationship are released at the same time. This can reduce memory usage, thereby reducing memory access and thus speeding up the full-chain traceability efficiency of payroll calculation.
[0092] In a preferred embodiment, for multiple pending computational transactions, a queuing mechanism is used to process the transactions. That is, only one computational transaction of a user can be in the computational process at a time.
[0093] It's worth noting that intermediate results are read from the intermediate result mapping relationship, and the dynamic calculation class is called according to the queuing mechanism for calculation. If the calculation result corresponding to the salary item is inconsistent with the initial calculation result, a corresponding calculation result report is generated based on the calculated result, the initial calculation result, and the intermediate results, according to the specific business logic. This report allows users to track the entire salary calculation process and quickly identify anomalies. If the calculation result corresponding to the salary item is consistent with the initial calculation result, the intermediate results and the calculated result are not saved.
[0094] If the amount of data in the intermediate result mapping relationship reaches the recording threshold, the intermediate results in the entire intermediate result mapping relationship will be asynchronously saved to the database according to the personnel information, and the intermediate results already saved in the intermediate result mapping relationship will be released at the same time.
[0095] Alternatively, after retrieving several intermediate results from the intermediate result mapping relationship, the retrieved intermediate results are asynchronously saved to the database according to the personnel information, and the intermediate results already saved in the intermediate result mapping relationship are released at the same time.
[0096] As a preferred embodiment, a progress percentage cache bar is used to display the progress of caching to the database.
[0097] In one embodiment, the final payroll calculation includes the results of multiple pay items.
[0098] In one embodiment, obtaining accurate calculation result reports in downstream operations includes: calculation report details, calculation lock / review, salary payment details, expense allocation details, payroll and report services.
[0099] It's worth noting that downstream operations can accurately output calculation result reports, allowing users to trace the payroll calculation process. This helps users clearly understand the data flow, the number of employees counted, the number of successful / failed payments, and the reasons for failures, facilitating timely handling of anomalies. The primary users are payroll processing personnel and payroll specialists; payroll specialists are mainly responsible for anomaly handling, while processing personnel are primarily responsible for payroll calculation.
[0100] This invention employs a method of calling a dynamic calculation function class based on the original payroll data. Based on the specific call point of this dynamic class, intermediate results of the preprocessed original payroll data are obtained. These intermediate results provide feedback on the entire payroll calculation data chain. Specifically, when payroll calculation is abnormal, users can quickly trace the source and pinpoint the data anomaly based on the intermediate results, thereby improving payroll calculation efficiency. Furthermore, the corresponding intermediate results are encapsulated and stored to extend their validity period, facilitating further calculations and display, enabling users to quickly trace the entire chain and further improve payroll calculation efficiency.
[0101] Example 2, see Figure 2 This is a business flow diagram of the full-link data traceability method for payroll calculation provided in this embodiment of the invention. The original calculation data includes: personnel information, system information, calculation information, log information, and front-end data. Payroll is calculated based on the original calculation data to obtain intermediate result mapping relationships. These intermediate result mappings include: calculation processing information, basic personnel information, job / appointment information, salary adjustment data, attendance / leave data, performance appraisal results, calculation variable results, parsing instances, and log files. The intermediate result mapping relationships are then applied to downstream business processes to obtain accurate calculation result reports, including: detailed calculation report, calculation lock / approval, payroll distribution details, expense allocation details, payslips, and report services.
[0102] By tracing the corresponding business through the entire payroll calculation data chain, and calling the decoupled dynamic calculation function class, which corresponds to a single function, formula, and calculation, it is possible to support the recording and tracking of intermediate results of complex calculations. Based on the call points of the dynamic calculation class, intermediate results can be obtained, which facilitates the location of abnormal node data, solves occasional problems, and makes every calculation traceable. Furthermore, the details in the calculation result report make it easy to identify the reasons for payroll calculation failures and help users quickly locate abnormal problems.
[0103] Example 3, see Figure 3 This is a flowchart illustrating the full-link data traceability method for payroll calculation provided in this embodiment of the invention. In the diagram, the initial calculation function is decoupled to obtain the calculation function, calculation formula, and calculation; wherein each function in the initial calculation function is treated as a method to obtain a single-function calculation function, and each formula is treated as a method to obtain the calculation formula.
[0104] The corresponding methods are dynamically injected into the calculation function, calculation formula and calculation respectively, resulting in dynamic classes of calculation function, calculation formula and calculation. The dynamic class of calculation formula is called from the preset calculation entry dynamic class.
[0105] If the calculation formula dynamic class uses a calculation function, then at the call point corresponding to the calculation function dynamic class, a dynamic proxy object is obtained, and an interceptor is declared through the dynamic proxy object. The interceptor enters the call process of the calculation function dynamic class, records the intermediate results, and encapsulates the intermediate results corresponding to the calculation function dynamic class according to the call point corresponding to the calculation function dynamic class, and stores them in the intermediate result mapping relationship.
[0106] After the calculation function in the dynamic class of the calculation formula is called, a dynamic proxy object is obtained at the call point corresponding to the dynamic class of the calculation formula. An interceptor is declared through the dynamic proxy object. The interceptor enters the call process of the dynamic class of the calculation formula and records the intermediate results. According to the call point corresponding to the dynamic class of the calculation formula, the intermediate results corresponding to the dynamic class of the calculation formula are encapsulated and stored in the intermediate result mapping relationship.
[0107] Finally, the calculation class is called to process the intermediate result mapping relationship to obtain a calculation result report, so that the user can trace back based on the calculation result report.
[0108] It is worth noting that decoupling can result in multiple accounting functions, multiple accounting formulas, and multiple calculations.
[0109] In payroll calculation scenarios dominated by calculation formulas and functions, the system enables full-chain data traceability calculation to divide the initial dynamic calculation class into single-function calculation formulas and functions. Intermediate results from these formulas and functions are obtained based on the corresponding dynamic calculation classes, adapting to complex payroll calculation scenarios and improving the usability and efficiency of full-chain data traceability. Furthermore, by calling the decoupled dynamic calculation function classes, the system supports recording and tracking intermediate results of complex calculations. Intermediate results are obtained based on the call points of these dynamic calculation classes, facilitating the location of abnormal data nodes, resolving sporadic issues, and ensuring traceability for every calculation. The calculation result reports also help identify the causes of payroll calculation failures, enabling users to quickly locate anomalies.
[0110] Example 4, see Figure 4 This is a flowchart illustrating the full-link data traceability method for payroll calculation provided in this embodiment of the invention. In the diagram, the initial calculation function is decoupled, resulting in a calculation formula that does not use the calculation function. However, the initial calculation function is not decoupled, so only a dynamic class for the calculation function and a dynamic class for the calculation are dynamically generated.
[0111] First, at the call point corresponding to the dynamic class of the calculation formula, a dynamic proxy object is obtained. An interceptor is declared through the dynamic proxy object. The interceptor intervenes in the call process of the dynamic class of the calculation formula, encapsulates the intercepted formula parameters into intermediate results, and stores them in the intermediate result mapping relationship. Finally, the calculation dynamic class is called to process the intermediate result mapping relationship to obtain a calculation result report, which allows the user to trace the results.
[0112] It is worth noting that decoupling can result in one or more dynamic classes for calculation formulas and one or more dynamic classes for computation.
[0113] In payroll calculation scenarios dominated by calculation formulas, end-to-end data traceability is achieved by calling decoupled dynamic calculation function classes. These classes, each with a single function corresponding to a calculation formula, support the recording and tracking of intermediate results for complex calculations. By accessing the call points of these dynamic calculation classes, intermediate results can be obtained, facilitating the location of abnormal data nodes, resolving sporadic issues, and ensuring that every calculation is traceable. Furthermore, the calculation result reports help identify the reasons for payroll calculation failures, assisting users in locating anomalies. This improves the usability of end-to-end data traceability in payroll calculation and ultimately enhances the efficiency of payroll calculation.
[0114] In Example 5, the initial calculation function is decoupled, resulting in a calculation formula that uses the calculation function. This decoupling also yields a separate calculation function and the calculation itself. Therefore, a dynamic class for the calculation formula, a dynamic class for the calculation, and a dynamic class for the first calculation function can be obtained. The dynamic class for the calculation formula can call the dynamic class for the second calculation function corresponding to the applied calculation function. First, the dynamic class for the first calculation function corresponding to the separate calculation function is called from the preset calculation entry dynamic class. At the call point corresponding to the first calculation function dynamic class, a dynamic proxy object is obtained, and an interceptor is declared through the dynamic proxy object. The interceptor intervenes in the call process of the first calculation function dynamic class, encapsulates the intercepted formula parameters into intermediate results, and stores them in the intermediate result mapping relationship.
[0115] Then, in the dynamic class of the calculation entry point, the dynamic class of the second calculation function applied by the calculation formula is called. At the call point corresponding to the dynamic class of the second calculation function, a dynamic proxy object is obtained, and an interceptor is declared through the dynamic proxy object. The interceptor enters the call process of the dynamic class of the second calculation function, encapsulates the intercepted function parameters into intermediate results, and stores them in the intermediate result mapping relationship.
[0116] It is worth noting that if decoupling results in multiple dynamic classes of calculation formulas, including those that apply calculation functions and those that do not, then it is also necessary to call the dynamic classes of calculation formulas that do not apply calculation functions to obtain the corresponding intermediate results and store them in the intermediate result mapping relationship.
[0117] It is worth noting that when decoupling the initial calculation function, a first calculation function dynamic class and a second calculation function dynamic class are generated simultaneously. However, during the call, the first calculation function dynamic class is called first, and then the second calculation function dynamic class and the calculation formula dynamic class without the application of the calculation function are called in the calculation formula dynamic class. The intermediate results corresponding to the second calculation function dynamic class called in the calculation formula dynamic class and the intermediate results of the calculation formula dynamic class without the application of the calculation function are integrated according to the personnel information. After obtaining the final intermediate result of the calculation formula dynamic class, the calculation dynamic class is called to calculate the intermediate results corresponding to the first calculation function dynamic class and the calculation formula dynamic class.
[0118] Finally, the dynamic calculation class is called to process the intermediate result mapping relationship to obtain a calculation result report, so that the user can trace back based on the calculation result report.
[0119] By using full-chain data traceability in payroll calculation scenarios dominated by calculation formulas, and by calling decoupled dynamic classes of calculation functions, we can obtain individual calculation functions, calculation formulas containing applied calculation functions, and dynamic classes with single functions corresponding to calculations without applied calculation functions. This enables the tracking of intermediate results in more complex payroll calculations, thereby improving the usability of full-chain data traceability in payroll calculations and ultimately improving the efficiency of payroll calculations in complex scenarios.
[0120] Example 6, see Figure 5 This is a schematic diagram of the structure of the full-link data traceability system for payroll calculation provided in this embodiment of the invention, including a calling module 51, an intermediate result acquisition module 52, a mapping module 53, and a traceability module 54.
[0121] It is worth noting that the calling module 51 is used to call the decoupled accounting function dynamic class according to the preprocessed raw salary calculation data, and transmit the obtained dynamic class to the intermediate result acquisition module 52; after receiving the corresponding dynamic class, the intermediate result acquisition module 52 extracts the intermediate result according to the calling point corresponding to the dynamic class, and transmits the intermediate result to the mapping module 53; the mapping module 53 encapsulates and stores the received intermediate result, and transmits the obtained intermediate result mapping relationship to the traceability module 54; after obtaining the intermediate result mapping relationship, the traceability module 54 processes it to obtain a calculation result report, so as to perform traceability based on the calculation result report.
[0122] Module 51 is used to obtain the original salary calculation data and call the corresponding dynamic accounting class according to the original salary calculation data; wherein, the dynamic accounting class includes multiple decoupled dynamic classes.
[0123] The process includes, after obtaining the original salary calculation data, preprocessing the original salary calculation data, specifically: sorting out the calculation logic of the dynamic class, classifying the original salary calculation data according to the calculation logic, and storing the classification results in a cache so that the preprocessed original salary calculation data can be read directly from the cache.
[0124] Obtaining multiple decoupled dynamic classes involves: decoupling the initial calculation dynamic class to obtain a calculation function class, a calculation formula class, and a calculation class, and generating corresponding dynamic classes for each of the calculation function class, calculation formula class, and calculation class to obtain the decoupled calculation dynamic class; wherein, the calculation dynamic class includes: a calculation function dynamic class, a calculation formula dynamic class, and a calculation dynamic class.
[0125] Specifically, the initial dynamic calculation class is decoupled to obtain a calculation function class, a calculation formula class, and a calculation class. Corresponding dynamic classes are then generated for each of these classes. Obtaining the dynamic classes for the calculation function class and the calculation formula class involves: parsing the calculation function and calculation formula in the initial dynamic calculation class to obtain the function body and formula body, respectively. The function body and formula body are then converted into corresponding string code fragments, resulting in a first string code fragment corresponding to the function body and a second string code fragment corresponding to the formula body. These first and second string code fragments are then converted into executable bytecode, resulting in executable dynamic calculation function classes and dynamic calculation formula classes, allowing direct invocation of these classes.
[0126] The intermediate result acquisition module 52 is used to acquire the dynamic proxy object of the call point of the dynamic class, and intercept the intermediate result of the dynamic class according to the dynamic proxy object; wherein, the intermediate result includes at least one of the function parameters, formula parameters or process data of the dynamic class.
[0127] The process of obtaining a dynamic proxy object for the call point of the dynamic class and intercepting the intermediate result of the dynamic class based on the dynamic proxy object includes: calling a calculation formula dynamic class in a preset calculation entry dynamic class; if a first calculation function is applied in the calculation formula dynamic class, then directly calling the first calculation function dynamic class corresponding to the first calculation function, so that the first intermediate result of the calculation formula dynamic class is intercepted based on the first dynamic proxy object corresponding to the first calculation function dynamic class; wherein the calculation dynamic class includes: the calculation formula dynamic class and the first calculation function dynamic class.
[0128] If the first calculation function is not applied in the dynamic class of the calculation formula, then the third call point corresponding to the dynamic class of the calculation formula is obtained, and at the third call point, the third dynamic proxy object corresponding to the dynamic class of the calculation formula is obtained; according to the third interceptor pre-declared in the third dynamic proxy object, the formula parameters and process data of the calculation formula are obtained, and the formula parameters and process data are encapsulated to obtain the third intermediate result; wherein, the process data includes the preprocessed original salary calculation data.
[0129] Directly calling the dynamic class of the first calculation function corresponding to the first calculation function, so that the first intermediate result of the calculation formula dynamic class is intercepted by the first dynamic proxy object corresponding to the first calculation function dynamic class, includes: obtaining the first call point corresponding to the first calculation function dynamic class, and at the first call point, obtaining the first dynamic proxy object corresponding to the first calculation function dynamic class; obtaining the first function parameter of the first calculation function according to the first interceptor declared in the first dynamic proxy object, and encapsulating the first function parameter to obtain the first intermediate result; wherein, the first function parameter includes: a first input parameter and a first output parameter. Before calling the calculation formula dynamic class in the preset calculation entry dynamic class, it includes:
[0130] The second calculation function dynamic class is directly called in the dynamic class of the calculation entry point, and the second dynamic proxy object corresponding to the second calculation function dynamic class is obtained at the second call point corresponding to the second calculation function dynamic class; wherein, the calculation dynamic class includes: the second calculation function dynamic class; according to the second interceptor pre-declared in the second dynamic proxy object, the second function parameter of the second calculation function is obtained, and the second function parameter is encapsulated to obtain the second intermediate result; wherein, the second function parameter includes: the second input parameter and the second output parameter.
[0131] The mapping module 53 is used to encapsulate at least one of the function parameters, the formula parameters, or the process data according to the calling point corresponding to the intermediate result, so as to obtain the intermediate result mapping relationship.
[0132] Specifically, based on the personnel information used for payroll calculation, at least one of the function parameters, formula parameters, or process data is stored in a cache to obtain an intermediate result mapping relationship; wherein, the original payroll data includes the personnel information.
[0133] The traceability module 54 is used to call the dynamic class to process the intermediate result mapping relationship and obtain a calculation result report so that traceability can be performed based on the calculation result report.
[0134] The process of calling the dynamic class to process the intermediate result mapping relationship to obtain a calculation result report includes: taking the data obtained from the intermediate result mapping relationship as the fourth intermediate result, and calling the calculation dynamic class to calculate the fourth intermediate result to obtain the first calculation result corresponding to the salary item; wherein, the calculation dynamic class includes the calculation dynamic class; if there is a difference between the first calculation result and the initial second calculation result, then according to the specific business, a corresponding calculation result report is generated based on the first calculation result, the second calculation result and the fourth intermediate result.
[0135] In addition, the process of calling the dynamic accounting class to handle the intermediate result mapping relationship also includes:
[0136] When the number of fourth intermediate results in the intermediate result mapping relationship reaches the recording threshold, the computation dynamic class is called to save the fourth intermediate results to the database in a single-threaded pool, and at the same time, the saved fourth intermediate results are released.
[0137] By calling the decoupled dynamic class of the accounting function in the calling module, which corresponds to a single function, formula, and calculation, it is possible to support the recording and tracking of intermediate results of complex calculations. In the intermediate result acquisition module, the intermediate results are obtained according to the calling point of the accounting dynamic class, which facilitates the location of abnormal node data, solves occasional problems, and makes every accounting traceable. Furthermore, the calculation result report facilitates the identification of the reasons for salary calculation failures, helps users locate abnormal problems, thereby improving system availability and increasing the efficiency of payroll accounting.
[0138] It is worth noting that if the aforementioned payroll calculation end-to-end data traceability system 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, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above.
[0139] Example 7: The present invention provides a computer-readable storage medium for end-to-end data traceability of payroll calculation, the computer-readable storage medium including a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the end-to-end data traceability method for payroll calculation as described above.
[0140] By using a computer-readable storage medium for end-to-end data traceability in payroll calculation, it is possible to easily call decoupled dynamic classes of calculation functions based on the computer-readable storage mechanism. These dynamic classes, which correspond to functions, formulas, and calculations with single functions, support the recording and tracking of intermediate results for complex calculations. By obtaining intermediate results based on the call points of the dynamic calculation classes, it is easier to locate abnormal data nodes, resolve intermittent problems, and ensure that every calculation is traceable. Furthermore, the calculation result reports facilitate the identification of reasons for payroll calculation failures, helping users locate anomalies, thereby improving system availability and increasing the efficiency of payroll calculation. In addition, based on the computer-readable storage medium for end-to-end data traceability in payroll calculation, this method can be applied to specific computer devices or terminal devices, further accelerating payroll calculation efficiency, handling more complex payroll calculations, and exhibiting greater applicability.
[0141] Example 8: The present invention also provides a computer device for full-link data traceability of payroll calculation, the computer device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor executing the full-link data traceability method of payroll calculation as described above.
[0142] By using a computer device for full-chain data traceability in payroll calculation, and calling decoupled dynamic classes of calculation functions, which correspond to single-function dynamic classes of functions, formulas, and calculations, it is possible to support the recording and tracking of intermediate results of complex calculations. Based on the call points of the dynamic classes of calculation, intermediate results can be obtained, making it easier to locate abnormal node data, solve occasional problems, and ensure that every calculation is traceable. Furthermore, the calculation result reports facilitate the identification of reasons for payroll calculation failures, helping users to locate abnormal problems, thereby improving system availability and increasing the efficiency of payroll calculation. Moreover, when integrated into specific devices, it can be applied to the calculation of more business operations, exhibiting greater adaptability.
[0143] Those skilled in the art will understand that embodiments of this application may also include computer program products. Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), devices, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0147] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for full-chain data traceability in payroll calculation, characterized in that, include: Obtain the raw salary calculation data, and call the corresponding dynamic accounting class based on the raw salary calculation data; wherein, the dynamic accounting class includes multiple decoupled dynamic classes; Based on the call point of the dynamic class, obtain the dynamic proxy object of the call point, and intercept the intermediate results of the dynamic class based on the dynamic proxy object; wherein, the intermediate results include at least one of the function parameters, formula parameters, or process data of the dynamic class; Based on the calling point corresponding to the intermediate result, at least one of the function parameters, the formula parameters, or the process data is stored to obtain the intermediate result mapping relationship; The dynamic class is invoked to process the intermediate result mapping relationship to obtain a calculation result report, which is then used for tracing. The accounting dynamic class includes multiple decoupled dynamic classes, including: decoupling the initial accounting dynamic class to obtain an accounting function class, an accounting formula class, and a calculation class, and generating corresponding dynamic classes for the accounting function class, accounting formula class, and calculation class respectively, to obtain the decoupled accounting dynamic class; wherein, the accounting dynamic class includes: an accounting function dynamic class, an accounting formula dynamic class, and a calculation dynamic class; Specifically, obtaining the dynamic classes corresponding to the calculation function class and the calculation formula class involves: parsing the calculation function and calculation formula in the initial calculation dynamic class to obtain the function body and formula body respectively, and converting the function body and the formula body into corresponding string code fragments to obtain the first string code fragment corresponding to the function body and the second string code fragment corresponding to the formula body; converting the first string code fragment and the second string code fragment into executable bytecode to obtain the executable calculation function dynamic class and calculation formula dynamic class, so as to directly call the calculation function dynamic class and the formula dynamic class.
2. The full-chain data traceability method for payroll calculation as described in claim 1, characterized in that, The step of obtaining the dynamic proxy object of the call point based on the call point of the dynamic class, and intercepting the intermediate results of the dynamic class based on the dynamic proxy object, includes: In the preset calculation entry dynamic class, the calculation formula dynamic class is called. If the calculation formula dynamic class applies a first calculation function, the first calculation function dynamic class corresponding to the first calculation function is directly called so that the first intermediate result of the calculation formula dynamic class is intercepted by the first dynamic proxy object corresponding to the first calculation function dynamic class. The calculation dynamic class includes the calculation formula dynamic class and the first calculation function dynamic class.
3. The full-chain data traceability method for payroll calculation as described in claim 2, characterized in that, The step of directly calling the dynamic class of the first calculation function corresponding to the first calculation function, so as to intercept the first intermediate result of the dynamic class of the calculation formula according to the first dynamic proxy object corresponding to the first calculation function dynamic class, includes: Obtain the first call point corresponding to the first dynamic class of the first accounting function, and at the first call point, obtain the first dynamic proxy object corresponding to the first dynamic class of the first accounting function; Based on the first interceptor pre-declared in the first dynamic proxy object, the first function parameter of the first calculation function is obtained, and the first function parameter is encapsulated to obtain the first intermediate result; wherein, the first function parameter includes: a first input parameter and a first output parameter.
4. The full-chain data traceability method for payroll calculation as described in claim 2, characterized in that, Before calling the dynamic class of the accounting formula in the preset calculation entry dynamic class, the following is included: The second accounting function dynamic class is directly called in the dynamic class of the calculation entry point, and the second dynamic proxy object corresponding to the accounting function dynamic class is obtained at the second call point corresponding to the second accounting function dynamic class; wherein, the accounting dynamic class includes: the second accounting function dynamic class; According to the second interceptor pre-declared in the second dynamic proxy object, the second function parameter of the second calculation function is obtained, and the second function parameter is encapsulated to obtain the second intermediate result; wherein, the second function parameter includes: a second input parameter and a second output parameter.
5. The full-chain data traceability method for payroll calculation as described in claim 2, characterized in that, Also includes: If the first calculation function is not applied in the dynamic class of the calculation formula, then the third call point corresponding to the dynamic class of the calculation formula is obtained, and at the third call point, the third dynamic proxy object corresponding to the dynamic class of the calculation formula is obtained; According to the third interceptor pre-declared in the third dynamic proxy object, the formula parameters and process data of the calculation formula are obtained, and the formula parameters and process data are encapsulated to obtain the third intermediate result; wherein, the process data includes the pre-processed original salary calculation data.
6. The full-chain data traceability method for payroll calculation as described in claim 1, characterized in that, The process of calling the dynamic class to process the intermediate result mapping relationship and obtain the calculation result report includes: The data obtained from the intermediate result mapping relationship is used as the fourth intermediate result, and the calculation dynamic class is called to calculate the fourth intermediate result to obtain the first calculation result corresponding to the salary item; wherein, the calculation dynamic class includes the calculation dynamic class; If the first calculation result differs from the initial second calculation result, a corresponding calculation result report is generated based on the first calculation result, the second calculation result, and the fourth intermediate result, according to the specific business requirements.
7. The full-chain data traceability method for payroll calculation as described in claim 6, characterized in that, The step of calling the dynamic accounting class to process the intermediate result mapping relationship also includes: When the number of fourth intermediate results in the intermediate result mapping relationship reaches the recording threshold, the computation dynamic class is called to save the fourth intermediate results to the database in a single-threaded pool, and at the same time, the saved fourth intermediate results are released.
8. The full-chain data traceability method for payroll calculation as described in any one of claims 1-7, characterized in that, After obtaining the raw salary calculation data, the method further includes: preprocessing the raw salary calculation data, specifically: The calculation logic of the dynamic class is sorted out, and the original salary calculation data is classified according to the calculation logic. The classification results are stored in the cache so that the preprocessed original salary calculation data can be read directly from the cache.
9. A full-chain data traceability system for payroll calculation, characterized in that, include: The calling module is used to obtain the original salary calculation data and call the corresponding dynamic accounting class based on the original salary calculation data; wherein, the dynamic accounting class includes multiple decoupled dynamic classes; The intermediate result acquisition module is used to acquire the dynamic proxy object of the call point of the dynamic class, and intercept the intermediate result of the dynamic class based on the dynamic proxy object; wherein, the intermediate result includes at least one of the function parameters, formula parameters or process data of the dynamic class; The mapping module is used to store at least one of the function parameters, the formula parameters, or the process data according to the calling point corresponding to the intermediate result, so as to obtain the intermediate result mapping relationship; The traceability module is used to call the dynamic class to process the intermediate result mapping relationship and obtain a calculation result report so that the user can trace the result based on the calculation result report. The accounting dynamic class includes multiple decoupled dynamic classes, including: decoupling the initial accounting dynamic class to obtain an accounting function class, an accounting formula class, and a calculation class, and generating corresponding dynamic classes for the accounting function class, accounting formula class, and calculation class respectively, to obtain the decoupled accounting dynamic class; wherein, the accounting dynamic class includes: an accounting function dynamic class, an accounting formula dynamic class, and a calculation dynamic class; Specifically, obtaining the dynamic classes corresponding to the calculation function class and the calculation formula class involves: parsing the calculation function and calculation formula in the initial calculation dynamic class to obtain the function body and formula body respectively, and converting the function body and the formula body into corresponding string code fragments to obtain the first string code fragment corresponding to the function body and the second string code fragment corresponding to the formula body; converting the first string code fragment and the second string code fragment into executable bytecode to obtain the executable calculation function dynamic class and calculation formula dynamic class, so as to directly call the calculation function dynamic class and the formula dynamic class.
Citation Information
Patent Citations
Transmission path analysis and gear fault tracing method based on in-situ measurement
CN115096582A
Method and system for realizing automatic calculation of takeout rider salary
CN116542642A