CN116664092B - Multi-user firewood calculating system and method - Google Patents

Multi-user firewood calculating system and method Download PDF

Info

Publication number
CN116664092B
CN116664092B CN202310919946.7A CN202310919946A CN116664092B CN 116664092 B CN116664092 B CN 116664092B CN 202310919946 A CN202310919946 A CN 202310919946A CN 116664092 B CN116664092 B CN 116664092B
Authority
CN
China
Prior art keywords
salary
calculation
user
task
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310919946.7A
Other languages
Chinese (zh)
Other versions
CN116664092A (en
Inventor
肖富海
韩士堃
秦溶蔓
赵学军
乔敬英
路永刚
程浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shuchang Information Technology Co ltd
Original Assignee
Beijing Shuchang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shuchang Information Technology Co ltd filed Critical Beijing Shuchang Information Technology Co ltd
Priority to CN202310919946.7A priority Critical patent/CN116664092B/en
Publication of CN116664092A publication Critical patent/CN116664092A/en
Application granted granted Critical
Publication of CN116664092B publication Critical patent/CN116664092B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/105Human resources
    • G06Q10/1057Benefits or employee welfare, e.g. insurance, holiday or retirement packages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/01Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a multi-user salary calculation system and a method, which relate to the technical field of intelligent management of human resources, wherein the system comprises: the salary calculation model is internally provided with a function library and an index library, a multi-user mixed arrangement algorithm is adopted, when a plurality of users submit salary calculation requests, a waiting execution queue is established for each user, a group is taken from the queue for queuing, and a multi-user salary calculation function is realized; the SaaS conversion salary calculation platform converts a salary calculation model into a SaaS version salary calculation component by adopting a public cloud deployment mode, the SaaS version salary calculation component is deployed on the Internet, salary calculation services are externally provided in a SaaS mode, the service modes comprise interface docking services and webpage services, the interface docking services are used for docking with a human resource system, and the webpage services are used for calculating salary in a data uploading mode. The invention develops a SaaS version salary calculating component, and a user can calculate salary through a webpage and can also provide interface call to be embedded into a human resource system of an enterprise.

Description

Multi-user firewood calculating system and method
Technical Field
The invention relates to the technical field of intelligent management of human resources, in particular to a multi-user salary calculation system and a multi-user salary calculation method.
Background
Employee payroll may be divided into a number of categories depending on the application, such as fixed payroll, performance payroll, attendance payroll, subsidy, bonus, etc. In turn, each major category is specifically divided into a number of items, for example, fixed payroll may include basic payroll, post payroll, etc., and performance work may include: piece count wages, timing wages, index wages, project wages, etc., the attendance wages may include: the algorithm of each payroll item may not be consistent, for example, the algorithm for raising payroll may be raised according to a fixed proportion of sales, may be raised in a sectional proportion, may be raised in a step proportion, etc., and the calculation mode may have many other limitations, for example, the limitation of capping amount, the limitation of trial period personnel not enjoying the payroll item, etc., so that it is the most important and complex job for the payroll departments of most enterprises. For enterprises with small scale, each enterprise has own regulation on salary calculation, and the reasonable salary calculation scheme can greatly improve the enthusiasm of staff work and reduce the manpower resource cost. The informatization of salary algorithm of a specific enterprise is not very difficult to realize, and the implementation can be realized through the processes of demand, design, development, test and online according to the construction mode of the traditional software project. Chinese invention patent name: salary assessment method and device, authorized bulletin number: CN108229908B, which proposes a salary checking method and device, the method includes splitting data to be calculated according to company division codes to obtain a plurality of data fragments; starting a plurality of parallel execution computing threads, and loading data in each data segment into a corresponding computing thread; calling each calculation thread, and calculating the data loaded on each calculation thread according to preset calculation logic to obtain a calculation result corresponding to each calculation thread; and integrating the calculation results corresponding to each calculation thread, and taking the result of the integration processing as an assessment result of salary assessment.
However, the existing project mode is too high in cost for realizing the calculation of the payroll of a specific enterprise, and in order to reduce the use cost, software deployed in a SaaS mode is required to simultaneously meet the requirements of the calculation of the payroll of a plurality of enterprises. At present, the mature human resource SaaS products are very many, and a salary calculation module is generally provided, but the salary calculation is really applied in a few cases, and most of the salary calculation is managed instead of calculated. The main reasons are as follows:
(1) For salary calculation software in SaaS mode, salary algorithms compatible with all users accessed are required. The payroll module of the common human resource management system software in the market at present only supports the common payroll formula configuration, but cannot accurately support the special algorithm of each family. After the human resource system is started, the user can only operate the system in a semi-system and semi-manual mode, and the salary calculation process is even more troublesome than that of using an excel table, so that a final enterprise can choose not to use a salary calculation module.
(2) To be able to realize support for most salary calculation methods, modeling of salary calculation needs to be performed in all directions, not only a rich salary calculation experience, but also a plurality of advanced technologies and algorithms need to be combined in an auxiliary manner, and difficulty is relatively high. Most human resource software developers are all involved in realizing full-module human resource management, business management and flow management, and are not good at modeling of a computing model and optimization of an algorithm.
(3) Some companies taking algorithms and modeling as main business generally concentrate on big data analysis directions and strong calculation business directions in the industry, and for non-main business of enterprises such as enterprise personnel calculation salaries, corresponding business accumulation and knowledge accumulation are lacked, and reasonable salary calculation models and algorithms cannot be constructed.
(4) Because the algorithm is complex, the operation efficiency is often low, the operation efficiency is also a pain point that the salary calculation service cannot achieve SaaS, the time point of the enterprise's salary calculation is generally concentrated in a few days before 10 days per month, the time is relatively concentrated, and if the algorithm time is long, a plurality of enterprises can not be supported at the same time, so that although some algorithms and models can support a plurality of salary calculation modes, the operation mode can not be really put into ground use.
(5) And finally, the security requirement is that salary data is the most sensitive data in an enterprise, and the data is stored on the SaaS cloud server and has strict security policies, such as leakage prevention, tamper prevention and loss prevention. More critical is that if the user is made to trust that his data is stored in the SaaS cloud server to be secure, this is one of the key factors that restrict salary software from being able to SaaS.
For the above reasons, there is no SaaS product specially serving the salary in the market at present, and the existing salary calculation module of the human resource product cannot support complex salary calculation. The payroll of most enterprises remains in the manual or semi-manual payroll stage.
Disclosure of Invention
Aiming at the problems existing in the prior art, the invention provides a multi-user salary calculation system and a multi-user salary calculation method, develops a salary calculation component of SaaS version, can calculate salary through a webpage, and also provides interface call to be embedded into a human resource system of an enterprise.
The technical scheme adopted by the invention is as follows:
a multi-user salary system comprising: a salary calculation model and a SaaS (software as a service) conversion calculation platform;
the system comprises a salary calculation model, a built-in function library and an index library, wherein the salary calculation model adopts a multi-user mixed arrangement algorithm, when a plurality of users submit salary calculation requests, a queue waiting for execution is established for each user, and a group is taken from the queue for queuing, so that the multi-user salary calculation function is realized;
the SaaS conversion salary calculation platform is used for converting a salary calculation model into a SaaS version salary calculation component, deploying the SaaS version salary calculation component on the Internet, and externally providing salary calculation service in a SaaS mode, wherein the service mode comprises interface docking service and webpage service, the interface docking service is used for docking with each human resource system, and the webpage service is used for calculating salary in a data uploading mode.
A multi-user salary calculation method comprising the steps of:
constructing a salary calculation model, generating a salary calculation rule, and setting parameters of the salary calculation model through a SaaS (software as a service) conversion salary calculation platform;
receiving a calculation salary task application submitted by a user, generating a calculation salary task to be executed after parameter analysis and verification are completed, submitting the calculation salary task to be executed to a task scheduling engine, dispatching and scheduling the calculation salary task to be executed by the task scheduling engine, and submitting the calculation salary task to an idle calculation salary thread for execution;
after the salary calculating thread receives the salary calculating task to be executed, calculating the value of each salary item according to the salary calculating data and the salary calculating model, and feeding back the calculation result to the user, wherein the salary calculating data is as follows: raw data submitted by the user for salary calculation.
The beneficial effects of the invention are as follows:
(1) A complete salary calculation model is formed by establishing a salary tree model, a salary influence element model, a salary dimension calculation model, a custom formula model, a formula disassembly model, a component safety model and a multi-line Cheng Yunsuan model, so that a salary algorithm of most scenes can be supported.
(2) The invention develops a SaaS version salary calculating component to provide salary calculating service for enterprises, realizes a salary calculating model as a set of independent components for salary calculation and is deployed on the Internet, and provides services to the outside in a SaaS mode, wherein the service modes comprise interface docking service and webpage service, the interface docking service is used for docking with each human resource system, and the webpage service is used for uploading data to calculate salary.
(3) The invention adopts a combination of a plurality of advanced technologies, improves the execution efficiency of multi-user concurrent salary calculation, and ensures that the salary calculation task of each user can be responded and processed in time by adopting key algorithms such as thread pool management, user queuing mechanism and the like for further improving the salary calculation efficiency.
(4) The security model of the system is established, the security and reliability of the data in the transmission process are ensured by combining various encryption modes, the original technology without database pay calculation and burn after calculation is adopted, the data of the user is not stored on the server for a long time, and the information is ensured not to be leaked.
Drawings
FIG. 1 is a schematic diagram of a multi-user salary calculation system according to the present invention;
FIG. 2 is a schematic diagram of a salary model structure according to the present invention;
FIG. 3 is a schematic diagram of a salary influencing element model structure according to the present invention;
FIG. 4 is a flow chart of a multi-user salary calculation method according to the present invention;
FIG. 5 is a schematic flow chart of a salary calculation model constructed according to the present invention;
FIG. 6 is a schematic flow chart of the salary model building method;
FIG. 7 is a schematic flow chart of a salary influencing element model setup according to the present invention;
FIG. 8 is a schematic diagram of a salary formula setting flow chart according to the present invention;
FIG. 9 is a schematic diagram of a flow chart for calculating a salary formula according to the present invention;
FIG. 10 is a schematic diagram of a task flow for scheduling salary tasks according to the present invention;
FIG. 11 is a flow chart of the invention for performing the salary calculation task.
Detailed Description
The invention is further illustrated by the following examples in conjunction with the accompanying drawings: in order to clearly illustrate the technical features of the present solution, the present invention will be described in detail below with reference to the following detailed description and the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different structures of the invention. In order to simplify the present disclosure, components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and processes are omitted so as to not unnecessarily obscure the present invention.
Salary items: also known as payroll, are components of employee payroll, some of which are relatively fixed parts, such as basic payroll, post payroll. These fixed parts are maintained in advance in the payroll system and typically need to be recalculated, but if the payroll month is encountered, the payroll month is away, and the payroll period is not from the first day.
Calculating firewood input items: the input item refers to raw data (i.e., salary data, also called salary item data) used in salary calculation, and these data need to be input into the system during salary calculation, such as attendance data, performance data, month fixed salary standards, and the like.
Calculating firewood configuration items: the configuration item is simply called as the configured parameter information for calculating the salary.
The process calculation item: in short, in the process of configuring a calculation salary formula, sometimes an algorithm cannot be directly configured by a relatively simple formula, in which case some temporary calculation terms need to be defined, and then the calculation formula is configured for the calculation terms. For example: the calculation mode of the overtime charge is as follows: employee daily payroll criteria x overtime days. Then the daily payroll criteria is a calculation item, the daily payroll criteria is not an entry (not raw data for salary) but a configuration item (his value cannot be processed by parameter configuration), and he can only calculate with a formula.
Note that: the above-mentioned input items, configuration items, and calculation items are collectively referred to as index items.
As shown in FIG. 1, the present invention provides a multi-user salary system comprising: a salary calculation model and a SaaS (software as a service) conversion calculation platform;
The system comprises a salary calculation model, a built-in function library and an index library, wherein the salary calculation model adopts a multi-user mixed arrangement algorithm, when a plurality of users submit salary calculation requests, a queue waiting for execution is established for each user, and a group is taken from the queue for queuing, so that the multi-user salary calculation function is realized;
the SaaS conversion salary calculation platform is used for converting a salary calculation model into a SaaS version salary calculation component, deploying the SaaS version salary calculation component on the Internet, and externally providing salary calculation service in a SaaS mode, wherein the service mode comprises interface docking service and webpage service, the interface docking service is used for docking with each human resource system, and the webpage service is used for calculating salary in a data uploading mode.
The salary calculation model includes: the salary calculation model comprises a salary tree model, a salary influence element model, a salary dimension calculation model, a custom formula model, a formula disassembly model, a component safety model and a multi-line Cheng Yunsuan model seven-big model, wherein a function library and an index library are built in the salary calculation model, and the salary calculation model and the seven-big model are combined to form a salary calculation model which can provide flexible configuration and efficient operation.
Fig. 2 is a schematic diagram of a payroll model structure according to the present invention.
For most enterprises, the salary consists of a plurality of salary items (i.e., payroll items), which in turn may consist of more finely categorized salary items (i.e., payroll items). Each payroll term may correspond to a different algorithm, or algorithms that are similar, but require different calculated payroll parameters and index terms for their calculation. From the perspective of the salary result, the sum of the items of the next-level salary items is equal to the corresponding upper-level salary item. Primary payroll items typically include: fixed payroll, performance payroll, attendance payroll, subsidy payroll, and the like.
The payroll items are refined step by step according to the requirements of the personnel on payroll management until classification is refined to the lowest layer capable of being calculated independently, so that a tree-shaped payroll structure is formed, a payroll model is obtained by further abstracting the tree-shaped diagram, and payroll of most enterprises can be calculated flexibly according to the payroll model.
Hierarchy of salary tree: how many levels of salary trees are at the bottom of an enterprise or whether a salary item is at the bottom of the next level of salary items depends on the salary composition and calculation method of the enterprise. For example, if the performance wages of all companies are the same algorithm, the performance wages need not be subdivided, if the market segments calculate wages according to sales volume, and the production segments calculate wages according to count, the performance wages need to be subdivided into count wages and count wages again.
Leaf nodes of payroll: each leaf node bears a respective specific algorithm, depending on the algorithm of the payroll, whether it is designed as a separate leaf node or split into two leaf nodes for some payroll. Take overtime payroll as an illustration: the overtime payroll can be divided into a working day overtime, a rest day overtime and a holiday overtime according to overtime types, three next-stage payroll items can be obtained, and if the rest day overtime and the holiday overtime are the same algorithm, the original data used in the process of calculating the payroll can be provided together, the rest day overtime and the holiday overtime can be combined into one payroll item, and calculation is performed.
FIG. 3 is a schematic diagram of a salary influencing element model structure according to the present invention.
The calculation of a payroll is affected not only by the algorithm itself and the raw data, but also by a number of other factors, mainly whether or not to enjoy the payroll, how to enjoy the payroll, including in particular the following aspects:
the parameter calculation method comprises the following steps: the reference mode comprises two modes of addition and subtraction. The addition means that after the calculation of the salary result is completed, the addition is added to the payroll as an addition. The term reduction means that after the calculation of the salary result is completed, the term reduction is taken as a deduction term to be deducted from the payroll to be sent out. When each salary item is calculated, the positive value is calculated according to the positive value without concern, after the calculation is completed, the positive and negative signs are configured and added according to the parameter mode, if the positive sign is configured, and if the negative sign is configured, the negative sign is configured.
Tax calculating mode: the influence element is mainly used for calculating whether a certain salary item participates in the individual tax calculation or not and whether the certain salary item is obtained for normal salary, and the influence element is set as 'participating in the individual tax calculation' by default.
Calculating firewood rules: the method is mainly divided into the following three cases: a fixed value per month, a formula, and an incoming value. The salary rule is salary item of 'calculating a fixed value by month', a calculation formula is not required to be configured, a fixed value by month is used as a salary calculating parameter to be input when the salary is calculated, and adjustment is carried out according to the salary adjustment condition, the job entering and leaving condition and the like of the month; the salary calculation rule is a salary item calculated according to a formula, a calculation formula is required to be configured, and calculation is performed according to the input parameters and the configured formula when the salary is calculated; the salary calculation rule is salary item of 'calculating according to the input value', and the system directly takes the salary parameter value input by the salary item as a calculation result.
Daily salary rules: the daily salary calculation mode is mainly used for calculating salary or buckling salary according to the daily salary standard. Such as the employee's month of entry and month of departure, need to be issued on the day of the month of work. The daily salary calculation mode is set in various modes, including: dividing the monthly salary by 27.15, dividing the monthly salary by 20.83, dividing the monthly salary by the number of attendance days on the month, dividing the monthly salary by the number of working days on the month+the legal holiday days, etc.
Dispensing month: the setting of the release month according to the invention comprises the following steps: full month distribution, appointed month distribution and one-time distribution. Most payroll items are issued monthly, but some payroll items remain issued for the given month. The disposable dispensing is used for processing the temporary dispensing or irregular dispensing, and after the dispensing is finished, the salary item can be logged off and can be reused when the next dispensing is performed.
The conversion mode is as follows: the method comprises three conditions of conversion according to the attendance days, conversion according to the attendance days and legal holidays, and no conversion. Because some payroll items are associated with attendance, such as meal subsidies, attendance subsidies, traffic subsidies, etc., these subsidies can be set using the above conditions if they are met.
Withholding rules: for setting withholding conditions, if the preset withholding conditions are satisfied, the payroll item is not calculated. For example, certain payroll regulations, trial period employees do not enjoy; some subsidies are not enjoyed in the month of job entry and month of job departure of staff; some subsidies are only issued to full-time employees, and the situations of part-time, outsourcing, practice, etc. are not enjoyed.
Sealing the top and protecting the bottom: for setting the maximum and minimum values of this payroll term.
Each salary item is calculated according to certain original data. There may be multiple lines of raw data required for some payroll items, such as attendance data, performance data, etc. For fine management, some payroll calculation methods may require multiple calculation accumulation in dimensions. The salary dimension calculation model of salary items refers to classification situations of original data required for calculating the salary items, and each employee may have multiple dimensions of original data at the same time every month. The dimension model commonly used in the computing salary includes: day (one piece of data per person per day), class (one piece of data per person per category), time (one piece of data per person per time), city level (mainly used to calculate the difference subsidy, one piece of data per city level per person), product name, etc. These dimensions are abstracted to get an algorithm salary dimension model. And when calculating salary, carrying out cyclic calculation on the original data according to the dimension, and adding the results to finally obtain the value of the required salary item.
The user-defined formula model can be used by a user according to the user-defined formula, and the most common user-defined formula comprises addition, subtraction, multiplication, division, brackets and the like. Somewhat more complex, may include: maximum value, minimum value, branch condition judgment, etc. The computational elements of the custom formula model include three parts: input items, configuration items, calculation items, note: some very special algorithms, such as exponentials, evolution, power functions, etc., are not supported in the custom formula model.
The custom formula model described in the present invention is divided into four types in total:
(1) A common four-rule operation formula model. I.e. a formula calculated by mixing the configuration item, the calculation item and the input item by a four-rule operation expression (including brackets).
Equation model: calculation item = four operations (input item, configuration item, calculation item).
(2) A piecewise formula model. I.e. based on a certain numerical calculation term or input term, the formula or configuration term is set in segments.
Equation model:
IFX1< specified calculation term < = X2 THEN calculation term = four-rule operation (input term, configuration term, calculation term);
ELSEIFX2< specified calculation term < = X3 th calculation term = four-rule operation (input term, configuration term, calculation term);
.....
ELSE calculation term = four-rule operation (input term, configuration term, calculation term).
(3) The ladder formula model, i.e., in the pattern of ladder calculations.
Equation model:
IFX1< specified calculation term < = X2 THEN calculation term = four-rule operation (input term, configuration term, calculation term);
ELSEIFX2< specified calculation term < = X3 th calculation term = four-rule operation (input term, configuration term, calculation term) -last level capping number;
......
ELSE calculation term = sum of N-level capping number on four operations (input term, configuration term, calculation term).
(4) A classification formula model, i.e., calculated in terms of classifications of computational terms or input terms.
Equation model:
IF specified calculation term= 'classification 1' THEN calculation term = four-rule operation (input term, configuration term, calculation term);
ELSEIF specified calculation term= 'classification 2' THEN calculation term = four-rule operation (input term, configuration term, calculation term);
......
ELSE calculation term = four-rule operation (input term, configuration term, calculation term).
The invention provides various custom formula models, but the above formula models can not solve all the calculation salary problems, and a plurality of complex calculation conditions can not be executed by using one formula. The purpose of the formula factoring model is to factor each payroll term into the ability to be expressed using the formula model above. The formula decomposition model can be divided into the following steps, and the formula is decomposed to be finest:
and finding out the input item, and finding out the data which need to be input when calculating the salary from the formula.
And (5) finding out the configuration items, and finding out places needing to configure parameters in advance from the formula.
Defining a calculation item: there is no description of other non-input items and configuration items in the look-up formula, and if this description also requires calculation, this description is defined as a calculation item. And checking the calculation formula of the calculation term, if the formula cannot be represented by the four models, further disassembly is needed.
In the SaaS deployment mode, most important is data security, in order to promote the security policy of the salary calculation component, the invention provides a component security model, which specifically comprises:
and the HTTPS+SSL/TLS protocol transmission encryption technology is adopted for transmission, and the transmitted data is encrypted by 2048 bit RSA+256 bit AES, so that the data cannot be leaked and tampered in the transmission process.
The system does not persistence any user calculation pay data, the database is not accessed in the whole calculation process, all calculation pay data are stored in redis and java memories, a mode of burning after calculation is adopted, the data are cleared according to the time set by the user after the calculation is completed, and the user does not need to worry about leakage of the data stored on the cloud.
The user does not need to upload sensitive information, and the user really worries about revealing basic information of staff and corresponding calculation pay data. If only salary data is calculated and no corresponding personnel basic information exists, worry is not needed, and even if the data is leaked, only a string of numbers is needed. Therefore, when the user only needs to upload the calculation salary data, each person needing to calculate the salary needs to be given a unique id, sensitive information such as names, identity cards, mobile phone numbers and the like do not need to be uploaded, after the calculation salary result is fed back to the user, the user can complement other information according to the id, and therefore the user does not need to worry about the safety of the data.
By adopting the mode, the invention truly realizes the anti-loss, anti-leakage and anti-tampering of data.
The invention provides a multi-line Cheng Yunsuan model, which is used for measuring whether a SaaS system can succeed or not by improving concurrency capability of the system and user experience in a SaaS deployment mode.
The invention adopts the algorithm without database and burn after calculation, all temporary data are placed in the redis and java memory, and can be cleaned immediately after calculation, and the database is not accessed in the process, so that the time of system calculation is greatly improved, and the calculation can be completed within 1 second by single-thread execution under the condition that the formula is not very complex in terms of 100 people's attendance calculation pay.
The invention adopts an automatic grouping parallel computing method, the system supports multithreading parallel execution computation, and the lateral expansion of the nodes can be provided through micro-service deployment. When a user submits calculation, the system creates a queue to be executed, if the number of people counting salaries exceeds 100 people, each 100 people can automatically split a component to be executed by a thread (the rest of people are used as a group to calculate if the number of people is less than 100 people), and after each group is executed, a response is provided for a front-end page or service, so that the user can see the progress of calculation in real time.
The invention adopts a multi-user mixed-arrangement algorithm to ensure the use experience of each user as much as possible. When a plurality of users submit the salary calculation requests, the later submitted users are also enabled to have faster use experience. Each user establishes a queue waiting for execution, and when threads are distributed, a group is taken from each pay user queue for queuing, so that the tasks of each user can be executed as soon as possible.
The salary calculation model is internally provided with a large number of function libraries, and the function libraries can greatly reduce the configuration time. For example:
f_max (numerical parameter 1, numerical parameter 2): obtaining a maximum value
F_min (numerical parameter 1, numerical parameter 2): obtaining a minimum value
F_getlength (date parameter): acquiring month to which date parameter belongs
F_getarea (date parameter): acquiring the year to which the date parameter belongs
F_getday (date parameter): acquiring the day to which the date parameter belongs
F_nonwmonth (): obtaining the month to which the current date belongs
F_nonwyear (): obtaining the year of the current date
F_notify (): obtaining the day to which the current date belongs
F_round (numerical parameter, reserved decimal): rounding to preserve decimal places
F_trunk (numerical parameter, reserved decimal): rounding
F_instr (character parameter, number of start bits, length): intercepting character strings
F_index (character parameter, find string): searching the character string in the character parameters, and returning to the first appearance position.
The salary calculation model provided by the invention is internally provided with the index library, a plurality of calculation salary indexes are arranged in the index library, so that a user can conveniently use the index library when carrying out salary item configuration, if no index is arranged in the index library, the user can add the index by self-definition, and the index library is shown in the following table as the common salary item names and classifications (see table 1), the common configuration items and configuration modes (see table 2) and the common calculation items and formulas (see table 3) of the invention.
As in Table 1, the present invention makes default settings for the attributes of each salary item.
TABLE 1 salary names and classifications commonly used in the present invention
In one embodiment of the invention, the performance payroll may further comprise: timing payroll; the attendance payroll may further include: asking for the false deduction, rewarding for whole service, helping for attendance and converting for non-holiday; the subsidized payroll may further include: solitary child, meal patch, span patch, post patch, job patch, birthday patch, medical patch, housing patch, support patch, high temperature patch, heating fee, and overhead fee; the commonly used payroll items may also include: prize money, money deduction, reimbursement and reimbursement, the prize money can be further distinguished into: monthly prizes, project prizes, quarterly prizes, the deduction of the risk can be further distinguished as: personal care insurance, personal loss insurance, personal medical insurance, personal accumulation, the hair and hair restocking can be further differentiated into: front tax reimbursement, rear tax reimbursement, and rear tax reimbursement.
Common inputs include: the basic wage standard of month, the post wage standard of month, the number of days of attendance of month, the cumulative number of minutes of early-stage withdrawal, the cumulative number of hours of open work, the number of hours of leave, the number of hours of overtime of holiday, the number of days of attendance of month, the month performance score, the month performance grade and the like.
TABLE 2 configuration items and modes commonly used in the present invention
TABLE 3 general calculation terms and formulas for the present invention
The SaaS conversion and calculation platform adopts a public cloud deployment mode to provide the calculation and calculation service for units in a mode of providing the SaaS service, and has the main functions that: user registration, salary setting, salary calculation, result feedback, message description and the like.
The user registers: the user registration function is used for registering login user information by a user, and the user is required to input information such as a mobile phone number, a verification code, a unit name, a user name and the like for registration. The salary setting: and the parameter information is used for setting various calculation salaries used by the unit salary calculation model. The function is also used for setting the number of days for which the salary result is reserved on the server, and the default setting is that the salary result is directly deleted after being downloaded, and the salary result can be reserved for three days at most. The salary calculation: and receiving the salary calculation file or the interface message uploaded by the user, and calculating salary items. The result feedback: and feeding back the firewood calculation result, and deleting the feedback history after finishing the feedback. The message illustrates: after the salary definition information is completed with the settings, the SaaS chemical salary platform is used to view the report Wen Moban of the interface in preparation for the user to develop the interface.
As shown in fig. 4, the present invention provides a multi-user salary calculation method, which includes the following steps:
constructing a salary calculation model, generating a salary calculation rule, and setting parameters of the salary calculation model through a SaaS (software as a service) conversion salary calculation platform;
receiving a calculation salary task application submitted by a user, generating a calculation salary task to be executed after parameter analysis and verification are completed, submitting the calculation salary task to be executed to a task scheduling engine, dispatching and scheduling the calculation salary task to be executed by the task scheduling engine, and submitting the calculation salary task to an idle calculation salary thread for execution;
after the salary calculation thread receives the salary calculation task to be executed, calculating the value of each salary item according to the salary calculation data and the salary calculation model, and feeding back the calculation result to the user.
The invention adopts a formula disassembling method to disassemble the calculation formula of each salary item into a simple operation formula, calculates the salary based on the original data input by the user, and feeds back the salary calculation result to the user, and the specific flow is as follows:
s100, constructing a salary calculation model
And constructing a salary calculation model of the user, and generating a salary calculation rule comprising various parameter information used in the salary calculation process, including salary tree, various influencing elements, calculation formula information and the like. The salary calculation model is persisted into the system after definition, and if the salary calculation rule changes, the user can adjust the salary calculation model.
S200, dispatching and calculating salary tasks
And receiving a calculation salary task application submitted by a user, generating a calculation salary task to be executed after parameter analysis and verification are completed, submitting the calculation salary task to a task scheduling engine, uniformly dispatching and scheduling all the calculation salary tasks to be executed by the task scheduling engine, and executing the calculation salary tasks by corresponding idle calculation salary threads.
S300 executing the salary calculation task
After the salary calculation thread receives the appointed salary calculation task, the system calculates the value of each salary item according to the salary calculation original data and a salary calculation model constructed in advance, and feeds back the calculation result to the user.
As shown in fig. 5, a flow chart of constructing a salary calculation model according to the present invention is shown, and the step S100 of constructing the salary calculation model specifically includes:
s110, constructing a salary tree model: and determining each salary item used by the calculated salary and the classification condition of the salary items. Analyzing and judging the calculated salary original data input by the user, finding out leaf nodes, and setting the attribute of each leaf node.
S120, setting a salary influence element model: setting parameters applicable to each payroll item, including: parameter mode, tax calculating mode, firewood calculating rule, month releasing, conversion mode, withholding rule, top-sealing and bottom-protecting, etc.
S130, setting a calculation salary formula: setting a calculation salary formula of salary items, and setting an input item, a configuration item and a calculation item by adopting a gradual disassembly mode, wherein the calculation salary formula of the salary items is one of the following four types: a common four-rule operation formula, a segmentation formula, a ladder formula and a classification formula. Since there may be a calculation term in the setup process, the setup may be disassembled several times for each formula to complete the setup.
S140 calculating a firewood formula: and (3) performing analog input on the value of the input item, measuring and calculating whether the salary item can feed back a correct salary calculation result (after the salary calculation formula is set, in order to verify whether the formula is set correctly, inputting some basic data for trial calculation, if the trial calculation result is inconsistent with the expected result, the problem of formula configuration is described, and readjustment is performed), wherein the basic data consists of the input item generated in the salary calculation formula.
S150, generating a calculation salary data description: according to the set salary items and the input item information, a salary data calculation description is automatically generated, and when a user submits a salary calculation task, data is provided by referring to the description.
In the embodiment of the present invention, steps S120, S130, S140 may be circularly calculated according to salary items.
As shown in fig. 6, for the flow chart of the salary model building of the present invention, S110 specifically includes:
the input parameters include: salary item array (SalaryList). The salary item array is composed of a plurality of salary item (SalaryItem) objects, and each salary item object comprises two attributes of a salary item name (itemName) and a superior salary item name (pantname);
the output parameters include: success flag (processflag), exception information (errText), payroll leaf node list (leaf list), payroll level list (salaryItemList).
The calculated salary parameters of the invention specifically refer to input parameters.
S111 checking the validity of the parameters
The loop detects for each object in the salary item array (SalaryList), detects if the salary item name (itemName) is repeated, and throws out the application exception if there is a repetition. It is detected whether the salary item name (itemName) and the upper salary item name (parenname) are repeated, and if there is a repetition, an application abnormality is thrown.
S112, establishing salary tree storage object
The method for creating the tree-shaped storage mechanism specifically comprises the following steps: the invention adopts String data to define payroll names, adopts int level to define payroll levels, adopts Treenode parent to define father nodes, adopts LinkedList < Treenode > child list to define child node list, and adopts Treenode () construction function.
The payroll tree generation method specifically comprises the following steps:
a tree is created where one node is a rootNode (data is "total salary item" and level is 0).
The ArrayList is recycled {
Fetching the parenName of the current ArrayItem
Detecting whether the pantName appears in the itemName in other ArrayItems
If not, a TreeNode object is created for the pantName (data is pantNamelevel 1) and the object is hung on the child node of the rootNode. }
The loop { is performed when ArrayList is not empty
Setting the initial value of the hierarchy temporary variable level temp to 2
The ArrayList is recycled {
level temp 1 is added once per cycle
Fetching the parenName of the current ArrayItem
Traversing the roottree from top to bottom to find out the object whose data is equal to the pantName
If so, a new TreeNode (data is itemName, level is level Temp) is created and the object is hanged on the current node of the tree.
Delete ArrayItem from ArrayList
If ArrayList is empty, exit the loop }
S113 top-down traversal of payroll tree
Traversing the payroll from top to bottom records the depth of each payroll item name (the depth of the root node is 0, the depth of the next level node is 1, and so on), storing the information of each node into a payroll table in a database, wherein the fields comprise: salary item name, superior salary item name, salary item level, whether it is a leaf node (yes/no).
S114 feeding back salary tree building result
And feeding back the salary tree establishment result in a tree structure, and feeding back all leaf nodes to the front end in the form of an array.
As shown in fig. 7, a flow chart of the salary influencing element model setting in the present invention is shown, and S120 sets the salary influencing element model specifically as follows:
setting parameters applicable to each salary item, wherein the parameters comprise: parameter mode, tax calculating mode, firewood calculating rule, month releasing, conversion mode, withholding rule, top-sealing and bottom-protecting, etc.
The input parameters include: a parameter mode (add/subtract term), a tax calculating mode (participation/non-participation), a calculation pay rule (release according to a month fixed standard/calculate according to a formula/manually calculate import), a daily pay rule (monthly pay divided by 27.15/divide by 20.83/divide by the current month attendance days/divide by the current month working days+legal holiday days according to the monthly pay), a release month (full month release/designated month release/one-time release), a conversion mode (conversion according to the attendance days/conversion according to the attendance days+legal holidays/non-conversion), a deduction rule (income from month, labor form, employee category), a cap value, a guarantee value;
The output parameters include: success flag (processflag), exception information (errText).
S121 setting salary item parameter calculation mode
The reference mode comprises two modes of addition and subtraction. According to the previous payroll model, the sum of all payroll items is equal to the payroll of the staff, but some payroll items are deductions, such as absent deduction payroll, and after the payroll items are calculated, the payroll items are deducted from the payroll. The payroll is added, the payroll is added to the payroll to be sent as an added item, the parameter mode is used for solving the problem, the payroll is not required to be concerned about deduction or not when being calculated, the payroll is uniformly calculated according to a positive value, and after the calculation is completed, positive and negative signs are added according to the parameter mode.
S122 setting tax calculating mode of payroll
This parameter is used mainly to calculate whether a payroll is involved in the individual tax calculation, e.g. some places will deduct a meal fee, a worker fee, etc. from the payroll. These deductions are post-tax deductions, which should be set to "do not participate in tax calculation", for normal payroll, the tax calculation mode described in the present invention defaults to "participate in individual tax calculation".
S123 setting salary item calculation salary rules
The calculation rules are mainly divided into the following three cases: a fixed value per month, a formula, and an incoming value. The salary rule is salary item of 'calculating a fixed value by month', a calculation formula is not required to be configured, a fixed value by month is used as a parameter to be input when the salary is calculated, and adjustment is carried out according to the adjustment of the salary condition by the month, the entering and leaving conditions and the like; the salary calculation rule is a salary item calculated according to a formula, a calculation formula is required to be configured, and calculation is performed according to the input parameters and the configured formula when the salary is calculated; the salary rule is salary item "calculate according to the value of input", the system directly uses the parameter value of the salary item as the calculation result.
S124 setting daily salary rules of salary items
The daily salary calculation mode is mainly used for setting a calculation salary or a deduction salary according to the daily salary standard. Such as the employee's month of entry and month of departure, need to be issued on the day of the month of work. The daily salary calculation mode has various modes: including division by 27.15 by monthly salary, division by 20.83 by monthly salary, division by the number of attendance days on the month, division by the number of working days on the month + legal holiday days, etc. The salary item calculation mode is only aimed at calculating salary rules: the situation of issuing a fixed value according to payroll is effective.
S125 setting salary item issuing month
The setting of the release month comprises three modes of full month release, appointed month release and one-time release. Most payroll items are issued monthly, but some payroll items are issued in the appointed month, for example, heating patches are issued in 11/12/01 three months, and then, for example, traffic assistance of teacher posts is not issued in two time periods of summer and summer holidays. The disposable dispensing is used for processing the temporary dispensing or irregular dispensing, and after the dispensing is finished, the salary item can be logged off and can be reused when the next dispensing is performed.
S126 setting salary item conversion mode
The method for setting salary item conversion mode comprises the following steps: the method is characterized in that three kinds of the method are selected according to the attendance days, the attendance days and legal holidays, and the method is not selected, part of payroll items are related to attendance, such as meal assistance, attendance assistance, traffic assistance and the like, and the conditions can be used for setting how the assistance meets the conditions. And (3) injection: if the salary rule is issued according to a salary month fixed value and imported externally, the salary rule is not effective, or can only be set as 'non-conversion'.
S127 setting payroll item issuing rules
For setting that a certain condition is met, the salary item is not calculated. For example, certain payroll regulations, the trial period staff is not enjoyed. Some patches are not enjoyed in the month of job entry and month of job departure, and some patches are only developed for full-time workers and are not enjoyed in the cases of part-time, outsourcing, practice and the like.
S128 setting salary item top-sealing bottom-protecting
For setting the maximum and minimum values of this payroll term.
As shown in fig. 8, for a schematic flow chart of setting the salary formula in the present invention, step S130 of setting the salary formula includes:
input parameters, including: formula type (formula type), formula string (formula string), formula dimension (formula dimension), input list (inputList), configuration list (configList), calculation list (calculelist).
Output parameters, including: success flag (processflag), exception information (errText).
S131 definition dimension model
According to the definition requirement of the dimension model, if the result calculated according to the formula is the amount of one month, the dimension of the formula is the month dimension. If the result calculated by the formula is the result of a certain day/time/class, the dimension of the formula is: day/times/class. After the dimension of the formula is determined, the dimension of all operation indexes is either a month dimension or is consistent with the dimension of the formula, and if the dimension is an emerging dimension, the dimension needs to be manually defined into the system.
S132 defines a formula model
According to the definition requirements of a custom formula model, the formula must be one of four types: a common four-rule operation formula, a segmentation formula, a ladder formula and a classification formula. For the input formula character string, firstly determining the formula type, and then checking according to different formula types.
For the general formula type: the index items in the formula are replaced by a common numerical value, and then a formula algorithm is called to check whether the formula is a legal formula (comprising matching brackets, matching operators and the like, the positions of parameter items in the expression, parameter information of functions and the like).
For other formula types: firstly, judging the matching conditions of the keywords such as IF, ELSEIF, THEN, comparing the matching conditions, analyzing all the ordinary formulas in the matching conditions, and checking one by one according to the types of the ordinary formulas.
S133 definition entry
According to the definition of the input item and the input item list (inputList) definition input item information, finding out which indexes are input items from the formula, detecting whether the indexes are completely matched with the input item information in the input item list (inputList), throwing out an exception if the indexes are not matched, and completing the definition of the input item if the matching is successful.
The input item list refers to data items to be input by the user at the current time of calculating salary. For example: the method is characterized in that payroll items such as overtime payroll items and attendance deduction items are calculated, two items of overtime days and absent days of each person are input by a user, and the two items are input items. And only if the input items exist, the input items need to be defined when the calculation salary model is defined and are associated with the calculation salary formula, so that the calculation salary can be ensured to be normally carried out.
S134 definition configuration item
According to the definition of the configuration items and the definition configuration item information of an incoming configuration item list (configList), finding out which indexes are the configuration items from the formula, detecting whether the indexes in the configuration item list (configList) are completely matched or not, throwing out an exception if the indexes are not matched, and completing the definition of the configuration items if the matching is successful.
S135 definition of calculation terms
Other index items are used as calculation items except configuration items and input items. If the calculation terms can be expressed by standard formulas, the standard formulas are replaced. If the calculation item cannot be configured by the standard formula, defining the calculation item and configuring the calculation formula for the salary item.
According to the definition of the calculation item and the definition calculation item information of an incoming calculation item list (cacutelist), finding out which indexes are calculation items from a formula, detecting whether index information in the calculation item list (cacutelist) is completely matched or not, throwing out an exception if the index information is not matched, and completing the definition of the calculation item if the index information is successfully matched.
For formulas with a very large number of layers, the above steps may be repeated multiple times to complete the definition of the formulas.
As shown in fig. 9, a flow chart of calculating the salary formula according to the present invention is shown, and S140, the calculation of the salary formula specifically includes:
after the setting of the calculation salary formula is completed, in order to verify whether the formula setting is correct, some basic data are required to be input for trial calculation, and if the trial calculation result is inconsistent with the expected result, the formula is configured to be problematic and is required to be readjusted. These basic data consist of entries generated in setting up the salary formula.
The input parameters include: the month dimension input item value list inputMap (key: value form), and the other dimension input item value list Multiinputmap (format is entered in the form of key: list (value)).
The output parameters include: success flag (processflag), exception information (errText), test result (result), process result (processResult).
S141 obtaining input parameters
Parameters required by the measurement and calculation of the salary item formula are recorded, the parameters are divided into two types of single-line data and multi-line data according to different dimensions, the single-line data is recorded for the lunar dimension index, the multi-line data is recorded for other dimension indexes, and the parameters are respectively stored in different storage units for standby after being acquired.
S142 analyzing the calculation formula
And (3) circularly analyzing the calculation formula, replacing the configuration items in the calculation formula with corresponding parameter values once, and replacing the input items in the calculation formula with corresponding parameter values. If the dimension of the formula is not the month dimension, then the accumulation is looped. And finally, sequencing each calculation formula according to the sequence to be operated, and putting the calculation formulas into a list.
The cyclic accumulation is specifically as follows: if the dimension is not a month dimension, it means that the calculation results of the payroll item are accumulated from the calculation results of different dimensions. Illustrating: late deduction is performed according to the following calculation rules: the payment is withheld for 20 yuan within 30 minutes, is withheld for 50 yuan within 30-60 minutes, is withheld for more than 60 minutes, and is deducted for half a day. Under the rule of calculating the payroll, the number of the tardy minutes of each person per day is required to be transmitted as a parameter, the dimension of calculating the payroll is "day", and when calculating the tardy deduction of a person, the deduction amount of each day is required to be calculated and accumulated together to obtain the tardy deduction amount of the month.
S143 calculating each formula value
Each formula is calculated sequentially from front to back. And after the calculation of the previous formula is finished, if the corresponding term is a calculation term, replacing the value of the calculation term into the subsequent formula, and if the dimension is not a month, accumulating and recording the calculation track.
S144 feedback calculation result
And feeding back the final calculation result and the calculation track of the intermediate process.
As shown in fig. 10, a flow chart of a salary task scheduling method according to the present invention is shown, and S200 specifically includes:
the system adopts a database-free salary calculation mode, all data transmitted by salary calculation tasks are placed in redis and java memories, the data are cleaned immediately after calculation, and the database is not accessed in the process, so that the system calculation efficiency is greatly improved, and the calculation time is shortened.
The input parameters include: the secondary salary calculation list (salary item list), the personnel list (personList) participating in the salary calculation, the month dimension input item list (inputList) calculating the salary, the other dimension input item list (inputdimension list) calculating the salary, and the salary calculation period (salary period).
In the multi-user mode, the system adopts thread pool technology and multi-user salary calculation flow to be executed concurrently. And receiving a salary calculation task application submitted by a user, and generating a salary calculation task to be executed after parameter analysis and verification are completed. And submitting the calculation salary task to a task scheduling engine. And the task scheduling engine uniformly dispatches all the salary calculation tasks, and searches idle threads in the thread pool to execute the salary calculation tasks.
The task scheduling engine consists of four parts: a payroll user queue (TenantQueue), a payroll task queue (TaskQueue), a payroll thread pool (ThreadPool), a payroll task distribution engine (taskdistngine). The method aims to ensure that each task is normally executed according to the sequence under the condition of multi-user concurrent execution of the calculation salary, threads cannot be idle, and the execution experience of each user is considered as much as possible. Factors to be considered for task scheduling include: first-come-first-serve, multi-user concurrent execution, abnormal task re-execution, abnormal suspension of threads, normal thread recovery, idle recovery after the execution of the tasks by the threads and the like.
Initializing a task scheduling engine when the system is started: at this time, the payroll task queue (TaskQueue) and the payroll user queue (TenantQueue) are empty, and the payroll thread pool (ThreadPool) initializes a plurality of independent threads according to the number of machines and parameter configuration information, and the state of each thread is idle.
Taking 3 threads for each salary micro-service, setting 4 salary servers as an example, and setting 12 salary threads in total in a thread pool, so that 12 users can simultaneously calculate salary in parallel.
The state of each thread of the thread pool is divided into three types: idle, busy, abnormal. Each thread corresponds to a queue to be executed in the system, when the queue to be executed is empty, the thread is in an idle state, when the queue to be executed is not empty, the thread is in a busy state, and when the thread cannot be connected, the thread is in an abnormal state.
When a user submits the salary calculation data, the task scheduling engine generates corresponding salary calculation tasks according to the salary calculation data, if the data submitted by the user is excessive at one time, the task scheduling engine can be split into a plurality of independent salary calculation tasks according to the number of people (the number of people exceeds 100 (the number of people is set by parameters), each 100 people automatically splits one salary calculation task, and the number of people is less than 100 people, and the rest people are taken as one salary calculation task and are submitted to an idle salary calculation thread for execution. The salary calculation data refers to raw data submitted by a user for calculating salary, and comprises a salary calculation period (namely, which month to calculate), salary calculation personnel, and basic information, attendance information, performance information and the like of each person.
And calculating the salary calculation task submitted by the user according to the defined salary calculation model. The salary calculation task is executed for multiple users in an asynchronous mode.
The task scheduling flow is specifically as follows:
s210 checking salary data (salary data is salary input item data)
And analyzing and checking the calculated salary data submitted by the user.
The key point of the verification is to check whether the required data of the calculated pay input item is legal, whether the personnel id in the input item is in the personnel list, and whether the dimension is consistent with the defined dimension. If the verification is problematic, the exception is thrown, and if no problem exists, the task scheduling engine is submitted to generate a calculation salary task.
S220 generating a salary calculation task
And after the task scheduling engine receives the salary calculation data, generating a salary calculation task according to the following method.
A1. Added to the payroll task queue (tenantTaskQueue)
Judging the number of people who calculate the salary this time:
if the number of people is less than or equal to 100, the calculated salary task is added to the calculated salary task queue as a calculated salary task.
If the number of people exceeds 100, splitting into a plurality of salary calculation tasks according to a group of people per 100, and sequentially adding the salary calculation tasks into a salary calculation task queue.
If the calculated salary number is greater than 100, grouping each group according to each 100, wherein each group corresponds to one calculated salary task, and if the residual number is less than 100, taking the residual number as one calculated salary task.
B1. Added to the payroll user queue (tenantQueue)
Whether the user exists in a waiting salary user queue (TenantQueue) or not is judged, if not, the user is added to the waiting salary user queue (TenantQueue) last.
S230 distributing a salary calculation task
The task scheduling engine adopts the following method to calculate the salary task in the queue:
A2. judging whether the salary task queue is not empty or not, if so, executing the step B2, if so, exiting, and executing the step again after waiting for 1 second;
B2. acquiring a thread in an idle state, setting the thread state to be in a busy state, executing the step C2 if the thread state is empty, exiting if the thread state is not empty, and executing the step again after waiting for 1 second;
C2. selecting a first user from the payroll user queue;
D2. removing the user from the payroll user queue;
E2. searching a first task to be executed of the user in a salary task queue according to the user id, submitting a salary task in the step, at least one salary task, if the salary task is completed, not having the user in the user queue, if the salary task is obtained, distributing the salary task to a salary thread, removing the task in the salary task queue, and executing the step F2.
F2. And C, judging whether the salary calculation task of the user is in the salary calculation task queue, if the user has other salary calculation tasks, continuing to hang the user on the tail part of the user task queue, and executing the step A2.
The task queue and thread pool are synchronously locked during the execution of the invention.
As shown in fig. 11, for a flow chart of the present invention for performing a salary calculation task, S300 specifically includes:
after the salary calculating thread receives the appointed salary calculating task, calculating the value of each salary item according to the salary calculating data and a predefined salary calculating model, and feeding back the calculation result to the user. And simultaneously, the thread is released, and the state is changed into an idle state. After the salary calculation task starts to be executed, the salary calculation is performed according to the following logic.
S310 salary initialization
Initializing salary parameter information, and acquiring influence element information of each salary item according to the configured salary item model and the input parameters. According to the input salary calculation period parameters, calculating the time period of the current salary calculation and parameter information such as days of working days, holidays, days of rest days and the like in the time period. And obtaining the influence element information of each salary item and putting the influence element information into the HashMap.
S320 salary counting for each salary item
And (3) cycling salary items one by one, calculating a salary formula according to an algorithm according to the influence factors and the input parameters of each employee, and generating each salary item amount of each employee. The results are placed in an ArrayList list.
S330, summarizing and feeding back the calculated firewood result
Collecting the calculated payroll results of each payroll item according to the person, calculating the total payroll amount of each person, calculating tax-containing income and tax-free income according to the tax calculating mode, and feeding back the calculated payroll results.
The feedback parameters include two arrays (arranlist): a salary result array and a salary process array, each element of the array being an object (HashMap) composed of key value pairs;
the contents contained in the salary result array comprise: personal id, payroll, tax-containing revenue, tax free revenue, payroll 1, payroll 2 …. Each person corresponds to a row of records and each payroll item corresponds to a column.
The salary process array contains contents including: personal id, payroll id, formula code, formula value. Each person may correspond to multiple rows of records.
S340 releasing the payroll thread
Changing the state of the payroll thread into idle, and changing the related parameter information of the thread pool.
Finally, it should be noted that: the above embodiments are only for illustrating the technical aspects of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those of ordinary skill in the art that: modifications and equivalents may be made to the specific embodiments of the invention without departing from the spirit and scope of the invention, which is intended to be covered by the claims.

Claims (9)

1. A multi-user payroll system, comprising: a salary calculation model and a SaaS (software as a service) conversion calculation platform;
the system comprises a salary calculation model, a built-in function library and an index library, wherein the salary calculation model adopts a multi-user mixed arrangement algorithm, when a plurality of users submit salary calculation requests, a queue waiting for execution is established for each user, and a group is taken from the queue for queuing, so that the multi-user salary calculation function is realized;
the salary calculation model includes:
the salary tree model refines salary items step by step according to the requirements of human resources on salary management, and refines classification to the lowest layer capable of being calculated independently;
the salary influence element model is used for recording salary calculation influence elements and storing calculation rules of the salary calculation influence elements;
calculating a salary dimension model, performing cyclic calculation on the original data according to the dimension, and adding calculation results to obtain a value of a required salary item;
a custom formula model comprising: the input item, the configuration item and the calculation item are used for the user to define the calculation firewood rule according to the requirement;
the formula disassembly model is used for disassembling each salary item to be capable of being expressed by adopting a custom formula model;
the assembly security model adopts a transmission encryption technology to ensure the data transmission security, stores the salary calculation data in the redis and java memory, does not access a database in the salary calculation process, and burns after calculation to prevent data leakage;
The multi-line Cheng Yunsuan model adopts a multi-user mixed queuing algorithm, when a plurality of users submit a salary calculation request, a queue waiting for execution is established for each user, a group is taken from the queue for queuing, and a multi-user salary calculation function is realized;
the SaaS conversion salary calculation platform is used for converting a salary calculation model into a SaaS version salary calculation component, deploying the SaaS version salary calculation component on the Internet, and externally providing salary calculation service in a SaaS mode, wherein the service mode comprises interface docking service and webpage service, the interface docking service is used for docking with each human resource system, and the webpage service is used for calculating salary in a data uploading mode.
2. The multi-user salary calculation system of claim 1 wherein the SaaS conversion salary calculation platform performs salary item calculation by receiving a salary calculation file or an interface message uploaded by a user, sets parameter information of a salary calculation model, and saves days of a salary calculation result.
3. A multi-user salary calculation method, comprising the steps of:
constructing a salary calculation model, generating a salary calculation rule, and setting parameters of the salary calculation model through a SaaS (software as a service) conversion salary calculation platform;
the salary calculation model includes:
The salary tree model refines salary items step by step according to the requirements of human resources on salary management, and refines classification to the lowest layer capable of being calculated independently;
the salary influence element model is used for recording salary calculation influence elements and storing calculation rules of the salary calculation influence elements;
calculating a salary dimension model, performing cyclic calculation on the original data according to the dimension, and adding calculation results to obtain a value of a required salary item;
a custom formula model comprising: the input item, the configuration item and the calculation item are used for the user to define the calculation firewood rule according to the requirement;
the formula disassembly model is used for disassembling each salary item to be capable of being expressed by adopting a custom formula model;
the assembly security model adopts a transmission encryption technology to ensure the data transmission security, stores the salary calculation data in the redis and java memory, does not access a database in the salary calculation process, and burns after calculation to prevent data leakage;
the multi-line Cheng Yunsuan model adopts a multi-user mixed queuing algorithm, when a plurality of users submit a salary calculation request, a queue waiting for execution is established for each user, a group is taken from the queue for queuing, and a multi-user salary calculation function is realized;
Receiving a calculation salary task application submitted by a user, generating a calculation salary task to be executed after parameter analysis and verification are completed, submitting the calculation salary task to be executed to a task scheduling engine, dispatching and scheduling the calculation salary task to be executed by the task scheduling engine, and submitting the calculation salary task to an idle calculation salary thread for execution;
after the salary calculating thread receives the salary calculating task to be executed, calculating the value of each salary item according to the salary calculating data and the salary calculating model, and feeding back the calculation result to the user, wherein the salary calculating data is as follows: raw data submitted by the user for salary calculation.
4. The multi-user salary calculation method of claim 3 wherein constructing a salary calculation model includes:
establishing a salary model, acquiring each salary item and classification conditions of the salary items, analyzing and judging original data input by a user, acquiring leaf nodes of the salary model, and setting attributes of each leaf node;
setting the influence element of each salary item through a salary influence element model;
setting a calculation formula of salary items, obtaining a calculation salary formula, and verifying the correctness of the calculation salary formula;
and automatically generating a calculated salary data description according to the set salary items and the input item information.
5. The multi-user salary calculation method of claim 3 wherein the task scheduling engine comprises: the system comprises a payroll user queue, a payroll task queue, a payroll thread pool and a payroll task distribution engine, wherein under the condition that multiple users concurrently execute payroll tasks, the task scheduling engine uniformly distributes and schedules the payroll tasks to be executed, and idle threads are searched in the thread pool to execute the payroll tasks, so that each payroll task is guaranteed to be normally executed according to the sequence.
6. The multi-user salary calculation method of claim 5 wherein the task scheduling engine uniformly dispatching salary calculation tasks to be performed comprises:
analyzing and checking the calculated salary data submitted by the user, checking whether the calculated salary data is legal, whether the personnel id is in a personnel list of the participant, whether the dimension is consistent with the defined dimension, if the checking is problematic, throwing out an exception, otherwise, submitting the calculated salary data to a task scheduling engine;
the task scheduling engine receives the salary calculation data and generates a salary calculation task;
judging whether the user is in a waiting salary user queue or not, and if not, distributing the salary calculation task to the salary calculation task queue by the task scheduling engine.
7. The multi-user salary calculation method of claim 6 wherein the task scheduling engine receives salary calculation data and generates a salary calculation task comprising:
Judging whether the salary number contained in the salary data exceeds 100 persons, if not, adding the salary number to a salary task queue as a salary task, and finally; if not, dividing the task into a plurality of salary calculation tasks according to a group of 100 persons, and sequentially adding the salary calculation tasks into a salary calculation task queue.
8. The multi-user salary calculation method of claim 7 wherein the number of salary calculation is greater than 100, a group corresponds to one salary calculation task per 100 groups, and if the number of remaining persons is less than 100, the remaining persons are taken as one salary calculation task.
9. The multi-user payroll method of claim 6 wherein the task scheduling engine assigns payroll tasks to payroll task queues comprising:
step one, judging whether a salary calculation task queue is empty, if so, waiting for 1 second and then executing the step again, and if not, executing the step two;
step two, acquiring a salary calculating thread in an idle state, setting the thread state as a busy state, continuing to execute the step three, and if the salary calculating thread in the idle state does not exist, waiting for 1 second and then executing the step again;
step three, selecting a first user submitting the calculated salary from the calculated salary user queue;
Step four, removing the user from the salary user queue;
step five, searching a first task to be executed of the user in a payroll task queue according to the user id, distributing the first task to be executed of the user to a payroll thread, removing the task in the payroll task queue, and executing step six;
step six, judging whether the user has the salary calculation task in the salary calculation task queue, if so, continuing to hang the user at the tail of the user queue, and continuing to execute the step one.
CN202310919946.7A 2023-07-26 2023-07-26 Multi-user firewood calculating system and method Active CN116664092B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310919946.7A CN116664092B (en) 2023-07-26 2023-07-26 Multi-user firewood calculating system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310919946.7A CN116664092B (en) 2023-07-26 2023-07-26 Multi-user firewood calculating system and method

Publications (2)

Publication Number Publication Date
CN116664092A CN116664092A (en) 2023-08-29
CN116664092B true CN116664092B (en) 2023-09-29

Family

ID=87724433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310919946.7A Active CN116664092B (en) 2023-07-26 2023-07-26 Multi-user firewood calculating system and method

Country Status (1)

Country Link
CN (1) CN116664092B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229908A (en) * 2017-12-08 2018-06-29 泰康保险集团股份有限公司 Reward appraisal method and apparatus
JP2019012367A (en) * 2017-06-29 2019-01-24 株式会社富士通マーケティング Salary data calculation device, salary data calculation program, and salary data calculation method
CN111369334A (en) * 2020-03-09 2020-07-03 阳光人寿保险股份有限公司 Salary calculation method and system
CN112651700A (en) * 2020-09-28 2021-04-13 北京中科云泮智能科技有限公司 Payroll bonus dispensing system based on blockchain technology and central bank digital currency
CN113763142A (en) * 2021-07-14 2021-12-07 望海康信(北京)科技股份公司 Payroll data calculation method, system, corresponding computer device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019012367A (en) * 2017-06-29 2019-01-24 株式会社富士通マーケティング Salary data calculation device, salary data calculation program, and salary data calculation method
CN108229908A (en) * 2017-12-08 2018-06-29 泰康保险集团股份有限公司 Reward appraisal method and apparatus
CN111369334A (en) * 2020-03-09 2020-07-03 阳光人寿保险股份有限公司 Salary calculation method and system
CN112651700A (en) * 2020-09-28 2021-04-13 北京中科云泮智能科技有限公司 Payroll bonus dispensing system based on blockchain technology and central bank digital currency
CN113763142A (en) * 2021-07-14 2021-12-07 望海康信(北京)科技股份公司 Payroll data calculation method, system, corresponding computer device and storage medium

Also Published As

Publication number Publication date
CN116664092A (en) 2023-08-29

Similar Documents

Publication Publication Date Title
CN109409633A (en) Business monitoring and Warning System
CN111192012B (en) Item processing method, item processing device, server and storage medium
CN111475513B (en) Form generation method and device, electronic equipment and medium
CN106371840A (en) Software development method and device based on crowdsourcing
CN107833009A (en) Personalized checking method, device, storage medium and the terminal of Claims Resolution order
CN109491642A (en) A kind of Requirements Modeling system and method based on scene, information data processing terminal
US11222073B2 (en) System and method of creating different relationships between various entities using a graph database
CN111695003A (en) Government affair shared material identification method and system based on item association network
CN116664092B (en) Multi-user firewood calculating system and method
CN112818028B (en) Data index screening method and device, computer equipment and storage medium
CN114022188A (en) Target crowd circling method, device, equipment and storage medium
CN116384724B (en) Employment patch center design method and employment patch center
CN114090634A (en) Hotel data management method and device based on data warehouse
CN116010941B (en) Multi-center medical queue construction system and method based on sandboxes
CN114611859A (en) Method and system for intelligent recruitment of software platform
CN111210324A (en) General invoice data processing method and system based on parallel computing
CN112667619B (en) Method, device, terminal equipment and storage medium for auxiliary checking data
US20200117822A1 (en) Dynamic authorization matrix and related systems, methods, and computer program products
Pratiwi et al. Analysis and Design Warning Letter Information System For Employees PT. Telkom Access
CN112365051A (en) Agent retention prediction method and device, computer equipment and storage medium
Suh et al. PCI Workplace: A decentralized collaboration framework for AI based problem-solving
US12001480B2 (en) System and method of creating different relationships between various entities using a graph database
CN113256270B (en) Data processing method, data processing device, data processing apparatus, and storage medium
CN111783103B (en) Maven-based dependency management method, device, electronic device and storage medium
Qamardin Analysis and design of accounting information system national health insurance acceptance cycle at Fatmawati Central General Hospital

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant