Salary calculation method and device, equipment, storage medium and program product
By identifying the amount of task data in payroll calculation and allocating it to different message queues, and using a distributed payroll calculation engine server for parallel computing, the problem of slow payroll calculation speed and low efficiency of large-scale data processing in existing technologies is solved, thus achieving efficient and accurate payroll calculation.
Patent Information
- Application Number
- CN202510750214.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2026-03-06
AI Technical Summary
Existing payroll calculation technologies are slow, inefficient, and struggle to handle large-scale data. They are prone to glitches or system crashes, and their complex architecture requires highly skilled operators. Expanding the scope of the technology is costly and has a long delivery cycle.
By identifying the amount of data to be processed in the payroll calculation task, the task is allocated to multiple message queues. Parallel computation is performed using a pre-built payroll calculation engine server. A rich text editing box is used to construct payroll calculation rule expressions, which are then allocated to different message queues and sub-tasks are split. Distributed computing resources are used to achieve efficient management and parallel computation.
It improves the speed of salary calculation, adapts to large-scale salary calculation scenarios, simplifies the operation process, reduces technical requirements, shortens the delivery cycle, optimizes resource utilization, and improves calculation efficiency and accuracy.
Smart Images

Figure CN121616253A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a salary calculation method, apparatus, device, storage medium, and program product. Background Technology
[0002] In enterprise management and operations, payroll calculation is a crucial yet highly challenging task. The complexities of payroll calculation make efficient and accurate calculation a major challenge for enterprise management.
[0003] However, existing payroll calculation technologies have many drawbacks. On the one hand, payroll calculation is slow and inefficient. Current payroll calculation methods, whether embedding complex logic in database scripts or relying on complex parameter configurations to implement business logic in code, consume a significant amount of time when processing payroll. On the other hand, existing technologies become less efficient when handling large-scale data. As companies expand and the number of employees increases, the volume of payroll data explodes. However, existing payroll technology architectures struggle to handle such massive amounts of data, easily experiencing lag or even system crashes during data reading, calculation, and storage. Summary of the Invention
[0004] This application provides a salary calculation method, apparatus, device, storage medium, and program product to solve the problems of slow salary calculation speed, low efficiency, and difficulty in handling large-scale data in related technologies.
[0005] The first aspect of this application provides a salary calculation method, comprising the following steps: obtaining multiple salary calculation tasks from a user, wherein each salary calculation task includes salary data to be processed; identifying the number of salary data to be processed in each salary calculation task; allocating the multiple salary calculation tasks to multiple message queues based on the number of salary data to be processed; wherein the message queues upload the salary calculation tasks in the queues to multiple pre-built salary calculation engine servers in a target order; the salary calculation engine servers calculate the corresponding salary results based on the salary data to be processed and the target salary calculation rules; and displaying the salary results to the user's target terminal.
[0006] Preferably, the construction process of the salary calculation engine server includes: constructing at least one salary calculation rule expression on the target edit box; binding the at least one salary calculation rule expression to at least one corresponding salary result item, and combining the at least one salary result item into a target salary calculation process; and constructing the salary calculation engine server based on the target salary calculation process and the at least one salary calculation rule expression.
[0007] Preferably, the multiple message queues include a first message queue and a second message queue. Multiple salary calculation tasks are allocated to the multiple message queues based on the number of salary data to be processed, including: if the number of salary data to be processed is greater than a preset number, the corresponding salary calculation task is allocated to the first message queue; if the number of salary data to be processed is less than or equal to the preset number, the corresponding salary calculation task is allocated to the second message queue.
[0008] Preferably, it further includes: if the number of salary data to be processed is greater than a preset number, the corresponding salary calculation task is split into multiple sub-tasks based on the preset number.
[0009] Preferably, after splitting the corresponding salary calculation task into multiple sub-tasks based on a preset number, the method further includes: uploading the multiple sub-tasks to multiple pre-built salary calculation engine servers; the salary calculation engine servers calculating the corresponding salary results based on the salary data to be processed corresponding to the sub-tasks and the target salary calculation rules; and merging the salary results from the multiple salary calculation engine servers to obtain the salary result of the salary calculation task.
[0010] Preferably, before constructing the salary calculation engine server based on the target salary calculation process and at least one salary calculation rule expression, the method further includes: verifying the calculation accuracy of the target salary calculation process and at least one salary calculation rule expression.
[0011] A second aspect of this application provides a salary calculation device, comprising: an acquisition module for acquiring multiple salary calculation tasks from a user, wherein each salary calculation task includes salary data to be processed; an allocation module for identifying the number of salary data to be processed in each salary calculation task, and allocating the multiple salary calculation tasks to multiple message queues based on the number of salary data to be processed, wherein the message queues upload the salary calculation tasks in the queues to multiple pre-built salary calculation engine servers in a target order, and the salary calculation engine servers calculate the corresponding salary results based on the salary data to be processed and target salary calculation rules; and a display module for displaying the salary results on a user's target terminal.
[0012] Preferably, the construction process of the salary calculation engine server includes: constructing at least one salary calculation rule expression on the target edit box; binding the at least one salary calculation rule expression to at least one corresponding salary result item, and combining the at least one salary result item into a target salary calculation process; and constructing the salary calculation engine server based on the target salary calculation process and the at least one salary calculation rule expression.
[0013] Preferably, the multiple message queues include a first message queue and a second message queue, and the allocation module is further configured to: if the number of salary data to be processed is greater than a preset number, allocate the corresponding salary calculation task to the first message queue; if the number of salary data to be processed is less than or equal to the preset number, allocate the corresponding salary calculation task to the second message queue.
[0014] Preferably, it further includes: a splitting module, used to split the corresponding salary calculation task into multiple sub-tasks based on the preset number if the number of salary data to be processed is greater than the preset number.
[0015] Preferably, it further includes: a merging module, used to split the corresponding salary calculation task into multiple sub-tasks based on a preset number, upload the multiple sub-tasks to multiple pre-built salary calculation engine servers, the salary calculation engine servers calculate the corresponding salary results based on the salary data to be processed corresponding to the sub-tasks and the target salary calculation rules; and merge the salary results of the multiple salary calculation engine servers to obtain the salary result of the salary calculation task.
[0016] Preferably, it further includes: a verification module, used to verify the calculation accuracy of the target salary calculation process and at least one salary calculation rule expression before constructing the salary calculation engine server based on the target salary calculation process and at least one salary calculation rule expression.
[0017] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the salary calculation method as described in the above embodiments.
[0018] A fourth aspect of this application provides a computer-readable storage medium having a computer program or instructions stored thereon, which are executed by a processor to implement the salary calculation method as described in the above embodiments.
[0019] The fifth aspect of this application provides a computer program product, including a computer program or instructions, which, when executed, implement the salary calculation method as described in the above embodiments.
[0020] Therefore, this application has at least the following beneficial effects: This application embodiment can acquire multiple salary calculation tasks submitted by users. By identifying the amount of salary data to be processed in each salary calculation task, the tasks are allocated to different message queues based on the amount. The message queues upload the salary calculation tasks to multiple pre-built salary calculation engine servers. The salary calculation engine servers calculate the corresponding salary results according to the salary calculation rules and processes. Through message queues and distributed salary calculation engine servers, efficient management and parallel computing of multiple salary calculation tasks can be achieved, improving the speed of salary calculation and thus adapting to large-scale salary calculation scenarios.
[0021] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0022] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a salary calculation method provided according to an embodiment of this application; Figure 2 This is a schematic diagram illustrating the calculation rules for the total tax payable on labor remuneration according to the embodiments of this application; Figure 3 This is a schematic diagram of the salary calculation process provided according to an embodiment of this application; Figure 4 This is a diagram illustrating the specific execution process of the salary calculation task provided in the embodiments of this application; Figure 5 This is a diagram illustrating a specific application of the salary calculation method provided in the embodiments of this application; Figure 6 This is an example diagram of a payroll calculation device according to an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0023] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0024] Due to the significant regional differences, complex business logic, frequent policy changes, short function delivery cycles, high accuracy requirements, and concentrated concurrent calculations with fast performance demands, most existing payroll calculation service providers either embed complex logic in database scripts or implement business logic in code through complex parameter configurations. While the former can be converted using pseudocode, it is often extremely complex, requires highly skilled operators, and is not user-friendly. The latter approach, once the expansion requirements exceed the configurable range, often necessitates system upgrades or even customization, frequently resulting in long delivery cycles and high costs.
[0025] Therefore, this application proposes a salary calculation method to solve at least one of the technical problems of the prior art.
[0026] Specifically, Figure 1 This is a flowchart illustrating a method for calculating guaranteed salary provided in an embodiment of this application.
[0027] like Figure 1 As shown, the salary calculation method includes the following steps: In step S101, multiple salary calculation tasks of the user are obtained, wherein each salary calculation task includes salary data to be processed.
[0028] The salary data to be processed includes the raw data required for salary calculation, such as employee attendance, performance, and basic salary.
[0029] It should be noted that the embodiments of this application can simultaneously acquire multiple salary calculation tasks from the user, that is, multiple salary calculation services can be executed simultaneously.
[0030] In step S102, the number of salary data to be processed for each salary calculation task is identified, and multiple salary calculation tasks are allocated to multiple message queues based on the number. The message queues upload the salary calculation tasks in the queues to multiple pre-built salary calculation engine servers in the target order. The salary calculation engine servers calculate the corresponding salary results based on salary calculation rules and salary calculation processes.
[0031] The message queue includes a first message queue and a second message queue. The first message queue is used to store salary calculation tasks with a large amount of data, which usually correspond to tasks that require more computing resources and time to process. The second message queue is used to store salary calculation tasks with a smaller amount of data, which are relatively faster to process. The target order can be first-in-first-out, that is, uploaded according to the allocation order of salary calculation tasks.
[0032] It is understood that the embodiments of this application can identify the number of salary data to be processed for each salary calculation task, and allocate multiple salary calculation tasks to multiple message queues based on the number. The message queues upload the salary calculation tasks in the queues to multiple pre-built salary calculation engine servers in the target order. The salary calculation engine servers calculate the corresponding salary results based on the built-in salary calculation rules and salary calculation processes. Through message queues and distributed salary calculation engine servers, efficient management and parallel computing of multiple salary calculation tasks can be achieved, improving the speed of salary calculation and the overall processing capacity of the system, thereby adapting to large-scale salary calculation scenarios.
[0033] In this embodiment of the application, the construction process of the salary calculation engine server includes: constructing at least one salary calculation rule expression on the target edit box; binding the at least one salary calculation rule expression to at least one corresponding salary result item, and combining the at least one salary result item into a salary calculation process; and constructing the salary calculation engine server based on the salary calculation process and the at least one salary calculation rule expression.
[0034] The target edit box can be a rich text edit box, and the salary calculation rule expression can be an expression composed of various conditional statements, data fields, operators, etc., used to define the logic of salary calculation, such as "basic salary + performance salary". Performance coefficient.
[0035] It is understood that the embodiments of this application can construct at least one salary calculation rule expression, bind the salary calculation rule expression to at least one corresponding salary result item, and combine at least one salary result item into a salary calculation process. Then, a salary calculation engine server is constructed based on the salary calculation process and at least one salary calculation rule expression. The salary calculation rules and processes can be flexibly configured to meet the diverse needs of different enterprises and different salary calculation scenarios, thereby improving the versatility and adaptability of the salary calculation engine server.
[0036] For example, when calculating sales staff salaries, you could create a "sales amount" field in the target editing box. The salary calculation rule expression of "commission rate + basic salary" is bound to the salary result item "gross salary". Then, multiple related salary result items, including attendance data processing and performance data processing, are combined into the target salary calculation process to build a salary calculation engine server suitable for the sales department.
[0037] In this embodiment of the application, before constructing the salary calculation engine server based on the target salary calculation process and at least one salary calculation rule expression, the method further includes: verifying the calculation accuracy of the salary calculation process and at least one salary calculation rule expression.
[0038] It is understood that, before constructing the payroll calculation engine server, this application embodiment verifies the accuracy of the payroll calculation process and the payroll calculation rule expression to ensure the calculation accuracy of the payroll calculation engine server.
[0039] Specifically, the construction process of the salary calculation rule expression and salary calculation procedure in this application includes: I. Editing and trial calculation of salary calculation rules (hereinafter referred to as the rules).
[0040] A rule is a combination of various arithmetic and logical expressions under multiple branching conditions. Based on this characteristic, a logically laid-out rule editing page is provided to the user. It includes various conditional statement structures, data fields participating in arithmetic and logical expressions, constants, nested rules, rule functions, and various operators and other expression factors. With simple mouse operations, rules can be built in readable text within a self-created rich text editor. The rich text editor provides rich editing functions, such as cut, copy, undo, placeholder updates, and intelligent parameter selection.
[0041] With simple mouse operations, you can quickly build highly readable rule expressions that meet the latest business needs; by extracting intermediate variables and function return values from the rule expressions through trial calculations, you can determine the accuracy of the calculation logic and results.
[0042] The rules for calculating the total taxable amount of labor remuneration, such as Figure 2 As shown, this is a rule used to calculate the total taxable amount of interns' labor remuneration from the beginning of the year to the previous month. The outermost layer of the rule is a rule function: Cumulative(Start Date, End Date, Cumulative Salary Item). The start date is the larger of the beginning date and the most recent change date of the employee's tax type that is earlier than the end date of the current salary month. If the change date is not available, the start date is used instead.
[0043] Click the "Trial Run" button to enter the trial calculation page, which displays the actual rule expression. After selecting the employees to be tested, click "Execute" to get the trial calculation list below. The list shows the values of each calculated element in the rule expression and the final result, categorized by the employee being tested.
[0044] II. Configuration and trial calculation of salary calculation process.
[0045] By binding rules to payroll result items, combining multiple result items into one or more calculation processes, and then passing the payroll calculation process and the scope of employees to be processed to the rule engine for handling, a process-oriented approach to payroll calculation is achieved. The advantages of this process-oriented approach are twofold: firstly, the calculation order can be configured as needed; secondly, result items can be categorized according to business needs—for example, social security-related items can be grouped into one process, while individual income tax-related calculations can be grouped into another. This facilitates configuration maintenance and result data verification, while also improving the engine's execution efficiency for a large number of result items. After configuring the calculation process, you can access the process trial calculation page to check if the trial calculation results meet expectations.
[0046] Salary calculation process as follows Figure 3 As shown, the details are as follows: 1. It includes multiple steps. The first eight steps can be seen from the screenshot: the first four steps process the input of HR master data and attendance data, the fifth and sixth steps further process the data, the seventh step performs the conversion of employee basic salary, and the eighth step obtains the basic income for this month, etc.
[0047] 2. Enter the [Payroll Calculation Trial] page, select a payroll group in region [A]. If the payroll group has already performed the payroll calculation for the current month in the payroll calculation module, you can continue to select one of the payroll calculation instances. After clicking [Execute], you will get a comparison list of the trial calculation results and the instance results.
[0048] 3. The trial calculation list can be exported, or you can click the [Messages / Logs] button to view the log content recorded during the trial calculation process.
[0049] In this embodiment of the application, multiple salary calculation tasks are allocated to multiple message queues based on the number of salary data to be processed, including: if the number of salary data to be processed is greater than a preset number, the corresponding salary calculation task is allocated to the first message queue; if the number of salary data to be processed is less than or equal to the preset number, the corresponding salary calculation task is allocated to the second message queue.
[0050] The preset quantity can be set according to specific circumstances, and there is no specific limit to it. It is used to distinguish between salary calculation tasks of different scales.
[0051] It is understood that, in processing salary generation tasks, this application embodiment can compare the number of salary data to be processed for each task with a preset number. If the number is greater than the preset number, the task is assigned to the first message queue. If the number is less than or equal to the preset number, it is assigned to the second message queue. By distinguishing and allocating the amount of task data, the task can be classified and processed, resource utilization can be optimized, overall computing efficiency can be improved, and small tasks can be prevented from being blocked by large tasks.
[0052] For example, if the preset number is 100 people, and a salary calculation task contains salary data for 150 people, then the task will be assigned to the first message queue. If another task only contains salary data for 80 people, then it will be assigned to the second message queue.
[0053] In this embodiment of the application, it further includes: if the number of salary data to be processed is greater than a preset number, the corresponding salary generation task is split into multiple sub-tasks based on the preset number.
[0054] The subtasks are derived from the original salary calculation task, and each subtask contains no more than a preset amount of salary data, which facilitates distributed processing.
[0055] It is understood that, in the embodiments of this application, when the number of salary data to be processed in a certain salary calculation task is greater than a preset number, the task can be split into multiple sub-tasks according to the preset number. By splitting the large task into small tasks, the computing resources of multiple servers in the distributed system can be fully utilized to process the sub-tasks in parallel and speed up the overall calculation speed.
[0056] In this embodiment of the application, after splitting the corresponding salary generation task into multiple sub-tasks based on a preset number, the method further includes: uploading the multiple sub-tasks to multiple pre-built salary calculation engine servers, the salary calculation engine servers calculating the corresponding salary results based on the salary data to be processed corresponding to the sub-tasks and the target salary calculation rules; and merging the salary results of the multiple salary calculation engine servers to obtain the salary result of the salary generation task.
[0057] It is understood that in this embodiment of the application, the multiple sub-tasks are uploaded to multiple pre-built salary calculation engine servers. Each server performs calculations based on the salary data to be processed and the target salary calculation rules corresponding to the sub-tasks, and obtains its own salary results. The calculation results of these servers are then merged to obtain the complete salary result of the original salary calculation task. Through distributed computing and result merging, the computing power of multiple servers is fully utilized, the computing time is shortened, and it is ensured that large-scale salary calculation tasks can be completed accurately and efficiently.
[0058] In step S103, the salary results are displayed to the user's target terminal.
[0059] The execution process of the salary calculation task of this application is described below through a specific embodiment, such as... Figure 4As shown, operators (i.e., users) submit payroll calculation tasks. A message queue is determined based on the amount of data in the payroll calculation task (i.e., a threshold number of employees). A dual-priority channel is provided to prevent payroll calculation tasks with a large number of employees from occupying the task queue due to the need to split into subtasks, thus avoiding longer waiting times for payroll calculation tasks with fewer employees. The payroll calculation task is then transmitted to the payroll calculation engine server for payroll calculation. By deploying multiple payroll engine servers, the calculation of payroll tasks in the dual-channel message queue is completed. To achieve the execution of the above payroll calculation task, the following technologies are specifically included: 1. Message queue management.
[0060] 1.1 Web server.
[0061] Configure the parameters SPLIT_HC and SMALL_HC (e.g., 1000 / 300). When the number of people requesting salary calculation exceeds SPLIT_HC, it will be split into multiple salary calculation sub-tasks according to this number and added to the NORMAL queue, while salary calculation tasks with fewer than SMALL_HC will be added to the SMALL queue.
[0062] Configure a payroll callback interface to complete tasks after the payroll calculation task is finished, such as merging payroll calculation logs and sending notification emails.
[0063] 1.2 Message Queue Server.
[0064] The RabbitMQ component is used, and it is deployed on the same local area network as the web server, requiring that it be accessible to the web server. The queue server creates two queues: NORMAL and SMALL.
[0065] 1.3 Message Queue Client.
[0066] The client is a background service program. First, configure the MQ service information (host, port, user, password) and the listening queues (NORMAL, SMALL), as well as the handler and concurrency limit for each queue. For NORMAL and SMALL queues, the handler is the address of the payroll engine service deployed in the environment; this can be the service address of an engine cluster or a single engine. The queue concurrency limit needs to be optimized according to server resource configuration; the default configuration is 10 / 20, meaning a server can handle a maximum of 10 concurrent queues. 1000+20 Payroll services are provided to 300 people, provided that the data cache is sufficient and the computing performance meets expectations.
[0067] The client needs to be able to access the web server, message queue server, and database server.
[0068] 2. Cache management.
[0069] Since payroll calculation requires a large amount of personnel master data and business data, and frequent database reads would affect normal system access, the engine focuses on establishing data cache during the startup phase and saving result data after the calculation is completed in database processing.
[0070] 3. Multi-currency processing.
[0071] Once a tenant has configured HOME CURRENCY and valid exchange rates with other currencies, the system will require the amount type data in each master data, input item, and result item to include the currency unit. When data in different currency units participate in payroll calculation under the same rule, the engine will automatically convert the payment currency in the result item bound to the rule to the same currency unit before performing the calculation.
[0072] 4. Back-to-back management.
[0073] Payroll recalculation is a typical application scenario for payroll calculation. The payroll engine has added an independent extended service for recalculation, which is used to determine the recalculation personnel, load historical recalculation data, initiate the recalculation process, record and sum the recalculation increment, etc.
[0074] 5. Quick calculation.
[0075] (1) Branches in IF... THEN... ELSE... ENDIF that do not meet the conditions will not be executed; (2) In CASE WHEN ... THEN ... ELSE ... ENDCASE, the THEN statement is not executed if the WHEN condition is not met, and subsequent branches are not executed if the WHEN condition is met; (3) 0 In expressions of the form ..., 0 / ..., true or ..., false and ..., the ... part is not executed; (4) When the same nested rule is used multiple times in a rule, the nested rule is executed only once, etc.
[0076] 6. Log and exception management.
[0077] The log records the current payroll group number, task number, workflow number, personnel range, and the results, rules, and number of people processed at each step; when multiple currencies are involved, it records the currency exchange rate; when an anomaly occurs, it records the employee involved, the result item, and the rule. After receiving the anomaly information, the operator can go to the rule calculation page, select the employee, and perform a calculation to discover the cause of the anomaly.
[0078] The salary calculation method in this application is described in the following process: Figure 5 As shown, the rapid iteration of the salary structure is accomplished through daily upgrade processes; the extended deployment of the salary engine server is achieved through the installation of the standard message queue client and the salary engine server: the site configuration file specifies the address of the salary engine server, the message queue client configuration file specifies the queue server address and the message queue to be processed, and the salary engine server configuration file specifies the address of the bound company database and the services provided for external access.
[0079] In summary, the salary calculation method of this application specifically designs and implements a set of easy-to-use, simple-to-configure, debuggable, and easily scalable rule parsing and calculation engine and salary calculation engine server based on salary rules and message queues, achieving a balance between rapid iteration and performance requirements. First, a self-built rich text editing box suitable for readable rules allows operators to quickly adjust rules according to business requirements and publish them to all clients via templates. Then, a unique process-oriented approach breaks down the entire salary calculation process, presenting the complex calculation process step-by-step to the user. A self-created rule parser and calculator fully utilize all processor resources of the engine server through parallel computing. Finally, through the expansion of the queue server, tasks with a large number of employees are split and distributed across different engine servers for calculation, while tasks with fewer employees are concentrated in a separate channel for rapid calculation and response.
[0080] Specifically, the salary calculation method in this application includes: I. Configurable and Debuggable Rules. Through web pages or desktop widgets, salary calculation rule expressions can be quickly built or adjusted using descriptive language based on the latest business logic. By testing the rules, intermediate variables and function results can be extracted, showcasing the complete calculation process to configuration personnel. Rule templates can be quickly packaged and updated for all online clients, providing default standard rules for newly established companies.
[0081] Second, the payroll calculation process is broken down into its components through streamlined and step-by-step configuration, enabling configurability and visualization of the calculation process. During trial runs, the payroll results for each stage are displayed sequentially. Comparison allows for quick identification of discrepancies and anomalies. A template-based workflow is then quickly updated for all deployed clients, providing a default standard workflow for future new companies.
[0082] Third, by using configurable dual-priority channels for payroll calculation and subtask splitting, and leveraging third-party load balancing and message queue services, distributed deployment and task scheduling of payroll calculation tasks can be achieved.
[0083] According to the salary calculation method proposed in this application, multiple salary calculation tasks submitted by users can be obtained. By identifying the number of salary data to be processed in each salary calculation task, the tasks are allocated to different message queues based on the number. The message queues upload the salary calculation tasks to multiple pre-built salary calculation engine servers. The salary calculation engine servers calculate the corresponding salary results according to the salary calculation rules and salary calculation process. Through message queues and distributed salary calculation engine servers, efficient management and parallel computing of multiple salary calculation tasks can be achieved, improving the speed of salary calculation and thus adapting to large-scale salary calculation scenarios. Next, the salary calculation device proposed according to the embodiments of this application is described with reference to the accompanying drawings.
[0084] Figure 6 This is a block diagram of a salary calculation device according to an embodiment of this application.
[0085] like Figure 6 As shown, the salary calculation device 10 includes: an acquisition module 100, an allocation module 200, and a display module 300.
[0086] The acquisition module 100 is used to acquire multiple salary calculation tasks from the user, each of which includes salary data to be processed. The allocation module 200 is used to identify the number of salary data to be processed in each salary calculation task and allocate the multiple salary calculation tasks to multiple message queues based on the number of salary data to be processed. The message queues upload the salary calculation tasks in the queues to multiple pre-built salary calculation engine servers in a target order. The salary calculation engine servers calculate the corresponding salary results based on the salary data to be processed and the target salary calculation rules. The display module 300 is used to display the salary results on the user's target terminal.
[0087] In this embodiment of the application, the construction process of the salary calculation engine server includes: constructing at least one salary calculation rule expression on the target edit box; binding the at least one salary calculation rule expression to at least one corresponding salary result item, and combining the at least one salary result item into a target salary calculation process; and constructing the salary calculation engine server based on the target salary calculation process and the at least one salary calculation rule expression.
[0088] In this embodiment of the application, the multiple message queues include a first message queue and a second message queue.
[0089] In this embodiment of the application, the allocation module 200 is further configured to: if the number of salary data to be processed is greater than a preset number, allocate the corresponding salary calculation task to the first message queue; if the number of salary data to be processed is less than or equal to the preset number, allocate the corresponding salary calculation task to the second message queue.
[0090] In this embodiment of the application, the apparatus 10 further includes a splitting module.
[0091] The splitting module is used to split the corresponding salary calculation task into multiple sub-tasks based on the preset number if the amount of salary data to be processed is greater than the preset number.
[0092] In this embodiment of the application, the apparatus 10 further includes a merging module.
[0093] The merging module is used to split the corresponding salary calculation task into multiple sub-tasks based on a preset number, upload the multiple sub-tasks to multiple pre-built salary calculation engine servers, and calculate the corresponding salary results based on the salary data to be processed and the target salary calculation rules corresponding to the sub-tasks. The salary results from multiple salary calculation engine servers are merged to obtain the salary result of the salary calculation task.
[0094] In this embodiment of the application, the apparatus 10 further includes a verification module.
[0095] The verification module is used to verify the accuracy of the target salary calculation process and at least one salary calculation rule expression before building the salary calculation engine server based on the target salary calculation process and at least one salary calculation rule expression.
[0096] It should be noted that the foregoing explanation of the salary calculation method embodiment also applies to the salary calculation device of this embodiment, and will not be repeated here.
[0097] According to the salary calculation device proposed in the embodiments of this application, it can obtain multiple salary calculation tasks submitted by users. By identifying the number of salary data to be processed in each salary calculation task, the task is allocated to different message queues based on the number. The message queues upload the salary calculation tasks to multiple pre-built salary calculation engine servers. The salary calculation engine servers calculate the corresponding salary results according to the salary calculation rules and salary calculation process. Through the message queues and distributed salary calculation engine servers, efficient management and parallel computing of multiple salary calculation tasks can be achieved, improving the speed of salary calculation and thus adapting to large-scale salary calculation scenarios. Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: The memory 701, the processor 702, and the computer program stored on the memory 701 and executable on the processor 702.
[0098] When the processor 702 executes the program, it implements the salary calculation method provided in the above embodiments.
[0099] Furthermore, electronic devices also include: Communication interface 703 is used for communication between memory 701 and processor 702.
[0100] The memory 701 is used to store computer programs that can run on the processor 702.
[0101] The memory 701 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0102] If the memory 701, processor 702, and communication interface 703 are implemented independently, then the communication interface 703, memory 701, and processor 702 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0103] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.
[0104] The processor 702 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.
[0105] This application also provides a computer-readable storage medium storing a computer program or instructions thereon, which, when executed by a processor, implements the above-described salary calculation method.
[0106] This application also provides a computer program product, including a computer program or instructions, which, when executed, implement the above-described salary calculation method.
[0107] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0108] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0109] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0110] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or more of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.
[0111] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0112] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A method of calculating payroll, characterized by, The method comprises the following steps: obtaining a plurality of salary calculation tasks of a user, wherein each salary calculation task comprises to-be-processed salary data; identifying the quantity of to-be-processed salary data of each salary calculation task, and distributing the plurality of salary calculation tasks to a plurality of message queues based on the quantity of to-be-processed salary data, wherein the message queues upload the salary calculation tasks in the queues to a plurality of pre-constructed salary calculation engine servers in a target order, and the salary calculation engine servers calculate corresponding salary results based on salary calculation rules and a salary calculation process; displaying the salary results to a target terminal of the user.
2. The payroll calculation method according to claim 1, wherein, The construction process of the salary calculation engine server comprises: constructing at least one salary calculation rule expression on a target editing box; binding the at least one salary calculation rule expression to corresponding at least one salary result item, and combining the at least one salary result item into a salary calculation process; constructing the salary calculation engine server based on the salary calculation process and the at least one salary calculation rule expression.
3. The payroll calculation method of claim 1, wherein, The plurality of message queues comprise a first message queue and a second message queue, and the distribution of the plurality of salary calculation tasks to the plurality of message queues based on the quantity of to-be-processed salary data comprises: if the quantity of to-be-processed salary data is greater than a preset quantity, distributing the corresponding salary calculation task to the first message queue; if the quantity of to-be-processed salary data is less than or equal to the preset quantity, distributing the corresponding salary calculation task to the second message queue.
4. The payroll calculation method of claim 3, wherein, Further comprising: if the quantity of to-be-processed salary data is greater than the preset quantity, splitting the corresponding salary generation task into a plurality of subtasks based on the preset quantity.
5. The payroll calculation method of claim 4, wherein, After splitting the corresponding salary calculation task into a plurality of subtasks based on the preset quantity, further comprising: uploading the plurality of subtasks to a plurality of pre-constructed salary calculation engine servers, and the salary calculation engine servers calculate corresponding salary results based on the to-be-processed salary data corresponding to the subtasks and target salary calculation rules; merging the salary results of the plurality of salary calculation engine servers to obtain the salary result of the salary calculation task.
6. The payroll calculation method of claim 2, wherein, Before constructing the salary calculation engine server based on the target salary calculation process and the at least one salary calculation rule expression, further comprising: verifying the calculation accuracy of the salary calculation process and the at least one salary calculation rule expression.
7. A payroll calculating apparatus characterized by comprising: Comprise: an obtaining module, configured to obtain a plurality of salary calculation tasks of a user, wherein each salary calculation task comprises to-be-processed salary data; a distribution module, configured to identify the quantity of to-be-processed salary data of each salary calculation task, and distribute the plurality of salary calculation tasks to a plurality of message queues based on the quantity of to-be-processed salary data, wherein the message queues upload the salary calculation tasks in the queues to a plurality of pre-constructed salary calculation engine servers in a target order, and the salary calculation engine servers calculate corresponding salary results based on the to-be-processed salary data and target salary calculation rules; a display module, configured to display the salary results to a target terminal of the user.
8. An electronic device, comprising: Comprise: A memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the method of any of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program or instructions, characterized in that, The computer program or instructions are executed by a processor for implementing the method of any of claims 1-6.
10. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions, when executed, implement the method of any of claims 1-6.