Method and device for determining salary of employee and electronic equipment

Through distributed computing architecture and parallel processing technology, the problem of inefficient computing efficiency of the existing salary assessment system is solved, and efficient salary calculation and payment is realized, which is suitable for a large number of employees in multiple enterprises and multiple regions.

CN119168603APending Publication Date: 2024-12-20SHANGHAI PEIQI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411187785.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing salary assessment system adopts a single-type serial computing system model, resulting in low computing efficiency, especially when the data volume is large, it takes 24 hours or even longer, and cannot meet the salary calculation and distribution of a large number of employees in multiple enterprises and regions. .

Method used

Adopting a distributed computing architecture, splitting salary data into multiple data fragments according to the pre-design calculation rules. Each data fragment starts a computing thread for parallel processing, and merges the calculation results, and using distributed cache and Flink computing framework to improve computing efficiency.

Benefits of technology

It significantly improves the efficiency and processing speed of salary calculation, can meet the salary calculation and distribution needs of a large number of employees in multiple enterprises and regions, and has the flexibility to meet the specific needs of different corporate customers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168603A_ABST
    Figure CN119168603A_ABST
Patent Text Reader

Abstract

The invention discloses an employee salary determination method and apparatus, and an electronic device. The method comprises the steps of obtaining a plurality of to-be-calculated first salary data under each target object; creating a target salary template according to the first salary data; wherein each target salary template corresponds to each target object; obtaining imported second type of salary data according to each target salary template and the plurality of pieces of to-be-calculated first type of salary data under each target object; splitting the second type of salary data according to a preset calculation rule to obtain a plurality of data fragments; wherein each data fragment is provided with a unique fragment identifier; each data fragment is stored in a distributed cache; starting a calculation thread according to each data slot, and calculating the second type of salary data in each data slot according to a preset calculation rule to obtain a corresponding calculation result; and combining the corresponding calculation results according to the fragment identifiers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computers and the Internet, and in particular to a method, device and electronic device for determining employee salaries. Background Art

[0002] The current salary assessment system uses a single serial calculation system mode, which makes the system calculation efficiency low. Especially as the amount of data increases, a complete calculation will take 24 hours or even longer, which is time-consuming. Therefore, it cannot meet the needs of a large number of employees in multiple companies and regions, such as salary calculation and payment of more than 10,000 people. Summary of the invention

[0003] The purpose of this application is to provide a method, device and electronic equipment for determining employee salary.

[0004] The embodiment of the present application provides a method for determining an employee's salary, comprising: obtaining a plurality of first salary data to be calculated under each target object; creating a target salary template according to the first salary data; wherein each target salary template corresponds to each target object; obtaining imported second salary data according to each target salary template and the plurality of first salary data to be calculated under each target object; splitting the second salary data according to a preset calculation rule to obtain a plurality of data fragments; wherein each data fragment is provided with a unique fragment identifier; storing each data fragment in a distributed cache; starting a calculation thread according to each data fragment, calculating the second salary data in each data fragment according to the preset calculation rule to obtain a corresponding calculation result; and merging the corresponding calculation results according to the fragment identifier.

[0005] Furthermore, before obtaining the plurality of first salary data to be calculated for each target object, the method further includes:

[0006] Parsing the original salary data into the first type of salary data; wherein the first type of salary data is in XML format; the original salary data is in Excel data format;

[0007] Multiple first-type salary data to be calculated are cached in segments.

[0008] Further, the creating a target salary template according to the first type of salary data includes:

[0009] Map and extract the header fields in the original salary data to obtain corresponding template items; wherein the template items include salary items and employee information;

[0010] Sort each template item;

[0011] Parsing and defining the salary items to obtain salary calculation items and salary display items;

[0012] A preset calculation formula is configured for the salary calculation item.

[0013] Further, after obtaining the imported second salary data according to each target salary template and the plurality of first salary data to be calculated under each target object, the method further includes:

[0014] Obtain the social security payment data of employees under each target object in the current period; wherein the social security payment data is calculated using the social security calculation model;

[0015] Calculate individual tax deductions based on the second type of salary data; individual tax deductions include individual tax on wages, individual tax on bonuses, individual tax on compensation and individual tax on labor fees;

[0016] The actual salary is calculated based on the second type of salary data, social security payment data and personal tax deductions.

[0017] Furthermore, the second type of salary data is split according to a preset calculation rule to obtain multiple data segments, including:

[0018] The second type of salary data is dynamically split according to the number of employees under each target object and the number of preset calculation formulas to obtain multiple data fragments; among which,

[0019] The number of employees corresponding to the second salary data contained in each data segment is no more than a set first threshold and no less than a set second threshold.

[0020] Furthermore, starting a calculation thread according to each data segment and calculating the second type of salary data in each data segment according to a preset calculation rule to obtain a corresponding calculation result includes:

[0021] The preset calculation formula configured in each salary template is used to calculate each salary calculation item of the employee;

[0022] If the current preset calculation formula contains uncalculated dependent formulas, the dependent formulas will be calculated first;

[0023] The calculation results include actual wages and personal tax deductions.

[0024] Furthermore, the method further comprises:

[0025] The calculation results of the same employee in the current period are compared with the calculation results in the historical period; if the data of the two are greatly changed, an alarm is issued and it is checked whether there is any calculation error.

[0026] The present application embodiment provides a device for determining employee salary, including:

[0027] An acquisition module, which is used to acquire a plurality of first-type salary data to be calculated under each target object;

[0028] A creation module, which is used to create a target salary template according to the first salary data; wherein each target salary template corresponds to each target object;

[0029] An import module, which is used to obtain imported second salary data according to each target salary template and a plurality of first salary data to be calculated under each target object;

[0030] A splitting module, which is used to split the second type of salary data according to a preset calculation rule to obtain multiple data segments; wherein each data segment is provided with a unique segment identifier;

[0031] A storage module, which is used to store each data fragment in a distributed cache;

[0032] A calculation module, which is used to start a calculation thread according to each data segment, and calculate the second type of salary data in each data segment according to a preset calculation rule to obtain a corresponding calculation result;

[0033] The merging module is used to merge the corresponding calculation results according to the fragment identifiers.

[0034] An embodiment of the present application provides an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the method described above are implemented.

[0035] An embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the method described above are implemented.

[0036] An embodiment of the present application provides a computer program product, wherein the computer program product includes computer program instructions, and when the computer program instructions are executed by a processor, the steps of the method described above are implemented.

[0037] The above technical solution of the present application has the following beneficial technical effects:

[0038] In an embodiment of the present application, a large number of employee salary data and calculation-related data of corporate customers are imported using a corresponding target salary template, the imported salary data is dynamically split according to certain sharding rules to obtain multiple data segments, and each data segment is processed in parallel to improve calculation efficiency and processing speed; different target salary templates are created according to the different salary structures of each corporate customer, which is flexible and can also meet the specific needs of different corporate customers; even if there are labor employment in different regions under the same corporate customer, the labor employment in different regions can be classified and processed by setting corresponding salary items in the target salary template, which can meet the salary calculation and payment of a large number of employees in multiple companies and regions. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.

[0040] Figure 1 It is a schematic diagram of the system architecture of an embodiment of the present application.

[0041] Figure 2 It is a flowchart of a method for determining employee salary in an embodiment of the present application.

[0042] Figure 3 It is a structural block diagram of a device for determining employee salary according to an embodiment of the present application.

[0043] Figure 4 It is a schematic diagram of an electronic device used to implement a method for determining employee salary according to an embodiment of the present application. DETAILED DESCRIPTION

[0044] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present application clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present application. The exemplary embodiments provided herein are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians of the art without creative work are within the scope of protection of this application.

[0045] Embodiments of the present application relate to terminal devices and / or servers. Those skilled in the art will appreciate that the embodiments of the present application may be implemented as a system, apparatus, device, method, computer-readable storage medium, or computer program product. Therefore, the present disclosure may be specifically implemented in at least one of the following forms: complete hardware, complete software, or a combination of hardware and software. According to the embodiments of the present application, the present application claims protection for a method, apparatus, electronic device, computer-readable storage medium, and computer program product for determining employee salaries. Figure 1 A schematic diagram of a system architecture of an embodiment of the present application is shown. Figure 1 As shown, the system includes a terminal device 102 and a server 104. Among them, the terminal device 102 may include at least one of the following: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, various wearable devices, an augmented reality AR device, a virtual reality VR device, etc. A client can be installed on the terminal device 102. For example, the client can be a client that specifically performs a specific function (such as an application app), or a client with multiple application applets (different functions) embedded in it, or a client logged in through a browser. The user can operate on the terminal device 102. For example, the user can open the client installed on the terminal device 102 and input instructions through the client operation, or the user can open the browser installed on the terminal device 102 and input instructions through the browser operation. After the terminal device 102 receives the instruction input by the user, the request information containing the instruction is sent to the server 104. After receiving the request information, the server 104 performs corresponding processing and then returns the processing result information to the terminal device 102. The user instruction is completed through a series of data processing and information interaction.

[0046] In this document, terms such as first, second, third, etc. are only used to distinguish one entity (or operation) from another entity (or operation), but not to require or imply any order or relationship between these entities (or operations).

[0047] Figure 2 A flow chart of a method for determining employee salary according to an embodiment of the present application is shown, and the method includes the following specific steps:

[0048] S110: Acquire a plurality of first type salary data to be calculated for each target object.

[0049] Specifically, the target object in the embodiment of the present application is, for example, a corporate customer, which is the employer of the employee; each corporate customer can send original salary data to the server 104 regularly (for example, according to each tax month), and the server 104 parses and stores the received original salary data; therefore, the salary data to be calculated for each corporate customer stored in the server 104 can be obtained from the server 104, and the salary data can include, for example, employee information and salary items; the employee information can include name, identity ID and mobile phone number, etc., and the salary item can be a monetary type or a non-monetary type. For example, the salary item is "payment place", that is, the salary item is a non-monetary type, and the salary item can be described using a text field. Depending on the "payment place", the social security contribution base and special deduction number applicable to the employee may be different; for example, the salary item is "payable wages", that is, the salary item is a monetary type, and the salary item is described using a computable numerical field.

[0050] S120: Creating a target salary template according to the first type of salary data; wherein each target salary template corresponds to each target object.

[0051] Specifically, standard salary items and customer-specific salary items can be set according to the different salary structures of each corporate customer. Therefore, a corresponding target salary template is created based on the salary data to be calculated for each corporate customer obtained from the server 104, which is flexible and can also meet the specific needs of corporate customers.

[0052] S130: Obtaining imported second salary data according to each target salary template and a plurality of first salary data to be calculated under each target object.

[0053] Specifically, multiple first-type salary data to be calculated under each target object are imported using the corresponding target salary template to obtain second-type salary data; wherein, the second-type salary data may include calculation items such as basic salary, salary pre-tax additions, salary pre-tax deductions, salary post-tax additions, salary post-tax deductions and special deductions, and calculation formulas may be configured in corresponding calculation items; in this way, regular expressions and rule engines may be used to verify the validity of salary data.

[0054] S140: Splitting the second type of salary data according to a preset calculation rule to obtain a plurality of data segments; wherein each data segment is provided with a unique segment identifier.

[0055] Specifically, corresponding calculation rules can be set according to different conditions such as the salary structure and location of corporate customers to dynamically calculate salaries. The corresponding calculation amount can be determined according to the preset calculation rules. For example, each employee has a corresponding salary data. Therefore, when the second type of salary data is split, multiple data fragments are obtained, and each data fragment can include multiple salary data; for example, multiple salary data can be paged first, and then the page numbers can be counted, and the data can be fragmented according to the page numbers. Then, a unique fragment identifier can be set for each data fragment. Combined with the identity ID in the employee information, the second type of salary data can be quickly and accurately split and identified.

[0056] S150: Store each data segment in a distributed cache.

[0057] Specifically, storing the sharded data in the Redis distributed cache system can improve data access speed.

[0058] S160: starting a calculation thread according to each data segment, and calculating the second type of salary data in each data segment according to a preset calculation rule to obtain a corresponding calculation result.

[0059] Specifically, the Flink distributed computing framework can be used to decompose computing tasks into multiple subtasks, and multiple computers and multi-threading technology can be used to process the data of each shard in parallel. Therefore, the Flink distributed computing framework can effectively distribute large-scale computing tasks to multiple nodes in the cluster, realize multi-task parallel processing, and thus improve computing efficiency and processing speed.

[0060] S170: Merge corresponding calculation results according to the segment identifiers.

[0061] Specifically, a large amount of employee salary data and calculation-related data of corporate customers are first loaded into the distributed cache according to certain sharding rules. A unique fragment identifier (ID) is set for each data fragment, and each fragment ID is pushed into the calculation queue. Then each computing machine listens to the data in the queue, starts multiple threads according to the current remaining computing power of the machine, and performs distributed parallel data processing and dynamic formula calculation according to the data fragment ID. After the processing and calculation are completed, the calculation results are pushed into the result queue, and finally the calculation results are summarized and written to the database. For example, when corporate customer A has 50,000 salary data that need to be calculated, 20 salary data can be set on each page, and every 25 pages can be set as a data segment. A unique segment identifier is set for each data segment, and a calculation thread is started for each data segment. In this case, 100 calculation threads need to be started for parallel processing to obtain the corresponding calculation results, and then the corresponding calculation results are merged according to the segment identifier; similarly, when corporate customer B has 100,000 salary data that need to be calculated, 20 salary data can be set on each page according to the different calculation amounts, and every 50 pages can be set as a data segment. A calculation thread is started for each data segment. It is necessary to open 25 computing threads for parallel processing; therefore, the 100 computing threads can process the salary data of corporate customers A and B in sequence, which can balance the processing capacity of each computing thread and improve the computing efficiency and processing speed; since different target salary templates are created according to the different salary structures of each corporate customer, it is flexible and can meet the specific needs of different corporate customers; even if there are labor services in different regions under the same corporate customer, the labor services in different regions can be classified by setting corresponding salary items in the target salary template, which can meet the salary calculation and payment of a large number of employees in multiple companies and regions.

[0062] In some embodiments, before step S110: obtaining a plurality of first salary data to be calculated for each target object, the method for determining employee salary further includes the following specific steps:

[0063] S108: parsing the original salary data into first type of salary data; wherein the first type of salary data is in XML format; the original salary data is in Excel data format;

[0064] S109: Cache the plurality of first-type salary data to be calculated in segments.

[0065] Specifically, corporate customers can input a large number of employees' salary data and related information through Excel on the terminal device 102, such as wages, wage deductions, wage additions, etc. Each corporate customer can send the original salary data to the server 104 regularly (for example, according to each tax month). In order to solve the problems of computer performance freeze caused by importing a large amount of data (for example, millions of salary data) through Excel, the traditional POI standard technology is no longer used. By parsing the Excel data format into the XML data format, it can be loaded in batches and read into the cache, which can improve the efficiency of importing salary data into the system and prevent the computer from freezing. When importing the system, the original salary data can be cleaned to check and correct errors or incomplete information in the data; the salary data can be pre-processed, and the data can be formatted, converted and standardized according to the calculation requirements.

[0066] In some embodiments, step S120: creating a target salary template according to the first salary data includes:

[0067] S121: Mapping and extracting the header fields in the original salary data to obtain corresponding template items; wherein the template items include salary items and employee information;

[0068] S122: sorting each template item;

[0069] S123: parsing and defining the salary items to obtain salary calculation items and salary display items;

[0070] S124: configuring a preset calculation formula for the salary calculation item.

[0071] Specifically, the template items in the target salary template may include employee information and salary items, etc.; employee information may include employee name, identity ID and mobile phone number, etc.; salary items may include salary payment location, payable wages, salary personal tax, year-end bonus and year-end bonus personal tax, etc. These template items may be numbered for sorting; for example, "payment location" may be defined as a salary display item, so that the salary data of employees may be classified according to different "payment locations"; for example, "payable wages" may be defined as a salary calculation item. A preset calculation formula can be configured for the salary calculation item "payable wages", and the preset calculation formula can be designed according to the composition of "payable wages", for example, payable wages = basic salary + pre-tax added items - pre-tax deductions - special deductions, such as overtime pay and performance wages are pre-tax added items, attendance deductions are pre-tax deductions, etc., and each item in the preset calculation formula is judged whether it is a pre-tax added item or a post-tax added item, and is defined to obtain pre-tax added items, pre-tax deductions, post-tax added items, post-tax deductions and special deductions.

[0072] In some embodiments, in step S130: after obtaining the imported second salary data according to each target salary template and the plurality of first salary data to be calculated under each target object, the method for determining the employee salary further includes the following specific steps:

[0073] S1301: obtaining the social security payment data of each target employee in the current period; wherein the social security payment data is calculated using a social security calculation model;

[0074] S1302: Calculate individual tax deduction items based on the second type of salary data; individual tax deduction items include individual tax on wages, individual tax on bonuses, individual tax on compensation, and individual tax on labor fees;

[0075] S1303: Calculate based on the second type of salary data, social security payment data and individual tax deduction items to obtain actual wages.

[0076] Specifically, the imported second type of salary data is presented as a visual data structure. For example, when the salary calculation item is configured with a preset calculation formula, a hidden button can be set on the salary calculation item; the social security payment data of employees under each target object in the current tax calculation month can be obtained through interface communication; the newly added or reduced employees in the current tax calculation month can be manually input, and the corresponding items in the social security payment data can be defined as pre-tax deduction items for wages; personal tax deduction items can include, for example, personal tax on wages, personal tax on bonuses, personal tax on compensation, and personal tax on labor fees. For each tax deduction item, a corresponding preset calculation formula can be configured to obtain a specific calculation amount; when calculating wages, the personal tax deduction items can be deducted from the wages payable to obtain the actual wages paid.

[0077] In some embodiments, step S140: splitting the second type of salary data according to a preset calculation rule to obtain multiple data segments includes the following specific steps:

[0078] The second type of salary data is dynamically split according to the number of employees under each target object and the number of preset calculation formulas to obtain multiple data fragments; among which,

[0079] The number of employees corresponding to the second salary data contained in each data segment is no more than a set first threshold and no less than a set second threshold.

[0080] Specifically, when the number of employees of a certain enterprise customer is lower than the set threshold, the salary data of the enterprise customer may not be divided into data segments; if the number of employees corresponding to the second salary data contained in each data segment is set too low, the processing capacity of the allocated calculation thread may be excessive, which is not conducive to improving the utilization rate of the equipment; if the number of employees corresponding to the second salary data contained in each data segment is set too high, the processing capacity of the allocated calculation thread will be affected, which is not conducive to improving the processing speed and efficiency. The more the number of preset calculation formulas, the more the amount of calculation. The second type of salary data is dynamically split by comprehensively considering the nested calculation formulas configured by the salary structure set by each enterprise customer, the number of employees, etc., to obtain multiple data segments.

[0081] In some embodiments, step S160: starting a calculation thread according to each data segment, and calculating the second type of salary data in each data segment according to a preset calculation rule to obtain a corresponding calculation result, includes the following specific steps:

[0082] The preset calculation formula configured in each salary template is used to calculate each salary calculation item of the employee; wherein, if the current preset calculation formula contains an uncalculated dependent formula, the dependent formula is calculated first; the calculation result includes the actual salary and personal tax deduction items.

[0083] Specifically, for example, the pre-tax wage items include performance wages, overtime pay and attendance bonuses. Among them, a calculation formula R is set for the calculation of performance wages, and the dependent formula R is calculated first.

[0084] In some embodiments, the method further comprises the following specific steps:

[0085] S180: Compare the calculation result of the same employee in the current period with the calculation result in the historical period; if the data of the two are greatly changed, an alarm is issued and it is checked whether there is a calculation error.

[0086] Specifically, if the wage tax in the personal tax deduction item of the current tax month is significantly greater than the amount of the previous tax month, an alarm will be issued and a check will be made to see if there is any calculation error, so as to ensure the accuracy of the calculation when processing massive data.

[0087] The above describes the implementation methods and advantages of the embodiments of the present application through multiple embodiments. The following describes the specific processing process of the embodiments of the present application in detail with reference to specific examples.

[0088] 1. Data reading:

[0089] When the original salary data of corporate customers is stored in Excel data format, when reading Excel data reaches hundreds of thousands or even millions of rows, if traditional POI and other technologies are used to directly read all the files into the memory, the performance will not only be slow, but also memory overflow will easily occur. For example, when 500,000 rows of data need to be imported, the SAXS parser can be used to read the Excel file and parse it into XML format, which can greatly improve the performance and avoid memory overflow.

[0090] 2. Cache processing:

[0091] The salary template information is loaded from the Redis cache into the memory, and it is determined whether there is a formula in the salary template information that needs to be pre-parsed. If there is no formula that needs to be pre-parsed, the pre-parsed formula information is cached in Redis.

[0092] After the original salary data is read, a batch ID is generated for the entire batch of data. According to the configured salary template, the data in each column can be identified as name, certificate type, certificate number, mobile phone number, basic salary, attendance days, department, performance ratio, etc. according to the column number. The data of the batch ID is sharded according to the rules configured in the salary template, and the data, shard page number, and total number of shards are stored in the Redis cache according to the batch ID and shard ID; finally, the job can be submitted to the Flink cluster according to the batch ID and shard ID.

[0093] 3. Start the job in the Flink cluster:

[0094] First, the data is loaded into the memory according to the batch ID and fragment ID. Then, according to the certificate type and certificate number, the employee's employment date, personal tax personnel attributes, salary payment location, tax payment location, salary payment entity, tax account, social security base, provident fund base are loaded from the Redis cache of the employee-related contract information, employee information and other master data and merged into the current employee data.

[0095] Use the rule engine (for example, the underlying layer of the rule engine uses QLExpress) to perform recursive calculations on the configured formula. When "@0" appears in the formula, it means that the calculation is empty and the default value is 0.

[0096] Calculate the cumulative number of months based on the employee's start date;

[0097] When calculating the current payable wages, for example, the formula configured in the salary template is if(${tax calculation method}=="positive calculation"||${tax calculation method}==null,${this payable wages},if(${tax calculation method}=="reverse calculation"&&(${individual tax personnel attributes}==null||{individual tax personnel attributes}=="resident"),${accumulated payable wages}-${maximum accumulated payable wages for the previous service month of this year}@0-${total of other payable wages this month}@0,if(${tax calculation method}=="reverse calculation"&&${individual tax personnel attributes}=="non-resident",${accumulated payable wages}-${total of other payable wages this month}@0,null))), where 1) when the tax calculation method is positive calculation or null , it means there is no built-in formula; 2) When the tax calculation method is reverse calculation, and the individual tax personnel attribute is empty or resident, the current payable wages = cumulative payable wages - the maximum cumulative payable wages of the current tax account in the previous service year and month of the current year - the total of other payable wages in the current tax account in the current service year and month; 3) When the tax calculation method is reverse calculation, and the individual tax personnel attribute is non-resident, the current payable wages = cumulative payable wages - the total of other payable wages in the current tax account in the current service year and month; among them, ${cumulative payable wages of the previous service month of this year}, ${maximum cumulative payable wages of the previous service month of this year} and ${total of other payable wages this month} are built-in rules configured in the salary template, which can be used to find the specific values ​​of the employee's historical salary data.

[0098] When calculating the accumulated payable wages, for example, the formula configured in the salary template is if((${tax calculation method}=="positive calculation"||${tax calculation method}==null)&&(${individual tax personnel attribute}==null||${individual tax personnel attribute}=="resident"),${the maximum accumulated payable wages for the previous service month of this year}@0+${the total payable wages for other payments this month}@0+${the payable wages for this time},if((${tax calculation method}=="positive calculation"||${tax calculation method}==null)&&(${individual tax personnel attribute}==null||${individual tax personnel attribute}=="resident"),${the maximum accumulated payable wages for the previous service month of this year}@0+${the total payable wages for other payments this month}@0+${the payable wages for this time}, method}==null)&&${Individual tax personnel attributes}=="non-resident"),${Total of other wages payable this month}@0+${wages payable this time},if(${Tax calculation method}=="reverse calculation"&&(${Individual tax personnel attributes}==null||{Individual tax personnel attributes}=="resident"),${Cumulative taxable wages}+${Cumulative social security deductions}+${Cumulative enterprise annuity}+${Cumulative special additional deductions},if(${Tax calculation method}=="reverse calculation "&&${Individual Tax Personnel Attribute}=="Non-resident",${Cumulative Taxable Wages}+${Cumulative Social Security Deductions}+${Cumulative Enterprise Annuity}))), where 1) When the tax calculation method is positive calculation or empty, and the individual tax personnel attribute is empty or resident, the cumulative payable wages = the maximum cumulative payable wages of the current tax account in the previous service year and month of the current year + the total of other payable wages of the current tax account in the current service year and month + the current payable wages; 2) When the tax calculation method is positive calculation or empty, and the individual If the tax personnel attribute is non-resident, the cumulative payable wages = the total of other payable wages in the current tax account of the current service year and month + the current payable wages; 3) When the tax calculation method is reverse calculation, and the individual tax personnel attribute is empty or resident, the cumulative payable wages = cumulative taxable wages + cumulative social security deductions + cumulative enterprise annuities + cumulative special additional deductions; 4) When the tax calculation method is reverse calculation, and the individual tax personnel attribute is non-resident, the cumulative payable wages = cumulative taxable wages + cumulative social security deductions + cumulative enterprise annuities. Among them, ${the maximum cumulative payable wages in the previous service month of this year}, {the total of other payable wages this month}, {the current payable wages}, ${accumulated taxable wages}, ${accumulated social security deductions}, ${accumulated enterprise annuities} and ${accumulated special additional deductions} are built-in rules configured in the salary template, which can be used to find the specific values ​​of the employee's historical salary data.

[0099] According to the above rules, the configuration formula of the salary template may include the following calculation items, for example: cumulative taxable wages, current social security deductions, cumulative social security deductions, cumulative enterprise annuities, cumulative children's education, cumulative continuing education, cumulative housing loan interest, cumulative housing rent, cumulative support for the elderly, cumulative special additional deductions, current pre-tax labor costs, cumulative pre-tax labor costs, current pre-tax year-end bonus, cumulative pre-tax year-end bonus, cumulative wage tax, cumulative deducted wage tax, current wage tax, cumulative deducted labor cost tax, current labor cost tax, cumulative year-end bonus tax, cumulative deducted year-end bonus tax, current year-end bonus tax, cumulative after-tax wages, current after-tax wages, current actual wages, cumulative after-tax year-end bonus, current after-tax year-end bonus, cumulative after-tax labor costs, current after-tax labor costs, etc.

[0100] The calculation process and input values ​​of each calculation formula are recorded, and the current calculation result is compared with the calculation result of the previous month. If the calculation result exceeds the floating range of the calculation result configured for each calculation formula item, the calculation result can be marked as abnormal. If an abnormal calculation result occurs during the calculation process, the abnormal situation can be recorded and the job can be restarted. The upper limit of automatic restart for each job is 3 times.

[0101] When all the configured calculation formulas are calculated, the calculation operation of this shard data is terminated. If there is an abnormality, the abnormal data can be displayed to the staff of the salary and performance department through the station message. After checking the data, the staff of the salary and performance department can choose to recalculate and save the calculation results; when recalculation is selected, the recalculation of the shard data can be started. When saving the calculation results, the next step can be performed. The calculation results of this time are updated to the Redis cache according to the batch ID + fragment ID for the final extraction of the result set.

[0102] When all the shard data jobs of the same batch are completed, after the data calculation of the last fragment ID is completed, that is, after the completed counter of this batch is equal to the total number of shards, the calculation results of all completed batch IDs can be pushed into the Kafka queue of completed calculations.

[0103] The task merger program listens to the completed queue. When there is a completed batch, all the completed calculated data can be extracted from the Redis cache, merged, and stored in the Postgresql database. The user is notified through an internal message that the calculation of this batch has been completed. The user can view the calculation results and calculation process through the link of the internal message.

[0104] Among them, multiple preset calculation formulas, salary items and employee information under each salary template can be mapped or extracted from the header in the Excel data, and the header fields in these tables can be parsed for further definition.

[0105] When the salary item is of amount type, you can determine whether this field is a salary calculation item or an ordinary display item. If it is a salary calculation item, you can further specify the corresponding calculation formula, which is equivalent to matching a formula expression.

[0106] A method for determining an employee's salary in an embodiment of the present application may also include the following specific processing steps:

[0107] A. Salary template management: create and maintain general or customer-specific salary templates, set salary structure, set standard salary items and customer-specific salary items, set calculation rules, sorting and bill output rules, and configure mobile pay slip templates.

[0108] Salary item type: text, amount. Used to distinguish whether the salary item is an amount type or a non-amount type;

[0109] Wage item calculation types may include: pre-tax additions, pre-tax subtractions, post-tax additions, post-tax subtractions, non-wage calculation items, and special deductions, which are used to define whether the wage calculation is pre-tax or post-tax, additions or deductions (for example, overtime pay is an addition, attendance deductions are subtractions, etc.), special deductions, etc.

[0110] B. Salary calculation: Through the algorithm of the above preset salary template, each employee's payable salary, social security and provident fund deductions, various personal taxes, etc. are automatically calculated in large quantities.

[0111] C. Salary payment: Apply for and pay the calculated actual wages in batches, submit them to the bank-enterprise direct link for real-time payment, track the situation, and manage payment batches for refund and resend based on payment feedback.

[0112] Corresponding to the method embodiment of the present application, the present application also provides a device for determining employee salary, such as Figure 3 As shown, including:

[0113] An acquisition module 510 is used to acquire a plurality of first type salary data to be calculated for each target object;

[0114] A creation module 520, which is used to create a target salary template according to the first salary data; wherein each target salary template corresponds to each target object;

[0115] An import module 530, which is used to obtain imported second salary data according to each target salary template and a plurality of first salary data to be calculated under each target object;

[0116] A splitting module 540 is used to split the second type of salary data according to a preset calculation rule to obtain a plurality of data segments, wherein each data segment is provided with a unique segment identifier;

[0117] A storage module 550, which is used to store each data segment in a distributed cache;

[0118] A calculation module 560 is used to start a calculation thread according to each data segment, and calculate the second type of salary data in each data segment according to a preset calculation rule to obtain a corresponding calculation result;

[0119] The merging module 570 is used to merge the corresponding calculation results according to the segment identifiers.

[0120] The electronic device in the embodiment of the present application may be a user terminal device, a server, other computing devices, or a cloud server. Figure 4 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application is shown. The electronic device may include a processor 601 and a memory 602 storing computer program instructions. When the processor 601 executes the computer program instructions, the process or function of any of the above-mentioned embodiments of the method is implemented.

[0121] Specifically, the processor 601 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application. The memory 602 may include a large-capacity memory for data or instructions. For example, the memory 602 may be at least one of the following: a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, a universal serial bus (USB) drive or other physical / tangible memory storage device. For another example, the memory 602 may include a removable or non-removable (or fixed) medium. For another example, the memory 602 may be inside or outside the integrated gateway disaster recovery device. The memory 602 may be a non-volatile solid-state memory. In other words, the memory 602 usually includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with computer-executable instructions, and when the software is executed (such as executed by one or more processors), the operation described in the method of the embodiment of the present application can be performed. The processor 601 implements the process or function of any method in the above embodiments by reading and executing the computer program instructions stored in the memory 602.

[0122] In one example, Figure 4The electronic device shown may also include a communication interface 603 and a bus 610. Among them, the processor 601, the memory 602, and the communication interface 603 are connected through the bus 610 and complete the communication between each other. The communication interface 603 is mainly used to realize the communication between each module, device, unit and / or device in the embodiment of the present application. The bus 610 includes hardware, software or both, and can couple the components of the online data traffic billing device to each other. For example, the bus may include at least one of the following: an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-end bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a micro channel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable buses. The bus 610 may include one or more buses. Although the embodiments of the present application describe or illustrate a specific bus, the embodiments of the present application may consider any suitable bus or interconnection method.

[0123] In combination with the method in the above embodiments, an embodiment of the present application also provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the process or function of any method in the above embodiments is implemented.

[0124] In addition, an embodiment of the present application further provides a computer program product, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the process or function of any one of the methods in the above embodiments is implemented.

[0125] The above exemplarily describes the flowcharts and / or block diagrams of the methods, devices, systems and computer program products of the embodiments of the present application, and describes the relevant various aspects. It should be understood that each box or combination thereof in the flowchart and / or block diagram can be implemented by computer program instructions, or by dedicated hardware that performs a specified function or action, or by a combination of dedicated hardware and computer instructions. For example, these computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to form a machine that enables these instructions executed by such a processor to enable the implementation of the functions / actions specified in each box or combination thereof in the flowchart and / or block diagram. Such a processor can be a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.

[0126] The functional blocks shown in the structured block diagram of the embodiment of the present application can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required task. The program or code segment can be stored in a memory, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0127] It should be noted that the present application is not limited to the specific configurations and processes described above or shown in the figures. The above is only a specific implementation mode of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the described system, device, module or unit can refer to the corresponding process in the method embodiment without further description. It should be understood that the scope of protection of the present application is not limited to this. Any technician familiar with the technical field can think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the scope of protection of the present application.

Claims

1. A method for determining employee salary, characterized in that: include: Obtain multiple first-type salary data to be calculated under each target object; Creating a target salary template according to the first type of salary data; wherein each target salary template corresponds to each target object; According to each target salary template and a plurality of first salary data to be calculated under each target object, the imported second salary data is obtained; The second type of salary data is split according to a preset calculation rule to obtain a plurality of data segments, wherein each data segment is provided with a unique segment identifier; Store each data fragment in a distributed cache; A calculation thread is started according to each data segment, and the second type of salary data in each data segment is calculated according to a preset calculation rule to obtain a corresponding calculation result; The corresponding calculation results are merged according to the fragment identifiers.

2. The method according to claim 1, characterized in that Before obtaining the plurality of first salary data to be calculated for each target object, the method further includes: Parse the original salary data into the first type of salary data; wherein the first type of salary data is in XML format; the original salary data is in Excel data format; Multiple first-type salary data to be calculated are cached in segments.

3. The method according to claim 2, characterized in that The step of creating a target salary template according to the first type of salary data includes: Map and extract the header fields in the original salary data to obtain corresponding template items; wherein the template items include salary items and employee information; Sort each template item; Parsing and defining the salary items to obtain salary calculation items and salary display items; A preset calculation formula is configured for the salary calculation item.

4. The method according to claim 1, characterized in that: After obtaining the imported second salary data according to each target salary template and the plurality of first salary data to be calculated under each target object, the method further includes: Obtain the social security payment data of employees under each target object in the current period; wherein the social security payment data is calculated using the social security calculation model; Calculate individual tax deductions based on the second type of salary data; individual tax deductions include individual tax on wages, individual tax on bonuses, individual tax on compensation and individual tax on labor fees; The actual salary is calculated based on the second type of salary data, social security payment data and personal tax deductions.

5. The method according to claim 1, characterized in that The second type of salary data is split according to the preset calculation rule to obtain multiple data segments, including: The second type of salary data is dynamically split according to the number of employees under each target object and the number of preset calculation formulas to obtain multiple data fragments; among them, The number of employees corresponding to the second type of salary data contained in each data segment is no more than a set first threshold and no less than a set second threshold.

6. The method according to claim 1, characterized in that The method of starting a calculation thread according to each data segment and calculating the second type of salary data in each data segment according to a preset calculation rule to obtain a corresponding calculation result includes: The preset calculation formula configured in each target salary template is used to calculate each salary calculation item of the employee; If the current preset calculation formula contains uncalculated dependent formulas, the dependent formulas will be calculated first; The calculation results include actual wages and personal tax deductions.

7. The method according to any one of claims 1 to 6, characterized in that: Also includes: Compare said calculations for the same employee in the current period with said calculations for historical periods; If the data of the two change greatly, an alarm will be issued and a check will be made to see if there is any calculation error.

8. A device for determining employee salary, characterized in that: include: An acquisition module, which is used to acquire a plurality of first-type salary data to be calculated under each target object; A creation module, which is used to create a target salary template according to the first salary data; wherein each target salary template corresponds to each target object; An import module, which is used to obtain imported second salary data according to each target salary template and a plurality of first salary data to be calculated under each target object; A splitting module, which is used to split the second type of salary data according to a preset calculation rule to obtain multiple data segments; wherein each data segment is provided with a unique segment identifier; A storage module, which is used to store each data fragment in a distributed cache; A calculation module, which is used to start a calculation thread according to each data segment, and calculate the second type of salary data in each data segment according to a preset calculation rule to obtain a corresponding calculation result; The merging module is used to merge the corresponding calculation results according to the fragment identifiers.

9. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the electronic device executes the computer program instructions, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.