Attendance accounting method, device, computer equipment and storage medium
By loading accounting plans and creating accounting chains, the problem of poor flexibility of traditional attendance accounting systems is solved, flexible attendance accounting and customized accounting results are achieved, and the adaptability and efficiency of the system are improved.
Patent Information
- Application Number
- CN202210887504.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-07-26
Smart Images

Figure CN115147087B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an attendance accounting method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the development of computer technology, attendance accounting has become an important part of human resources management. Due to the large amount of data and complex calculation process of attendance accounting, the traditional solution has fixed accounting steps for specific attendance entities. Therefore, when the attendance accounting rules change, the entire accounting system may need to be replaced, which has poor flexibility and high costs. Summary of the Invention
[0003] Based on this, it is necessary to provide a customizable attendance accounting method, device, computer equipment, computer-readable storage medium and computer program product to address the above technical problems.
[0004] In a first aspect, the present application provides an attendance accounting method. The method comprises:
[0005] Load the calculation plan corresponding to the calculation task and obtain the calculation parameters corresponding to the calculation plan;
[0006] Creating an accounting chain based on the accounting scheme;
[0007] The calculation parameters are calculated in sequence through the step nodes of each calculation stage in the calculation chain to obtain calculation result data.
[0008] In a second aspect, the present application also provides an attendance accounting device. The device comprises:
[0009] A loading module is used to load the accounting plan corresponding to the accounting task and obtain the accounting parameters corresponding to the accounting plan;
[0010] A creation module, configured to create an accounting chain based on the accounting scheme;
[0011] The calculation module is used to calculate the calculation parameters in sequence through the step nodes of each calculation stage in the calculation chain to obtain calculation result data.
[0012] In one embodiment, the apparatus further comprises:
[0013] A display module, configured to display an accounting plan configuration page in response to an accounting plan configuration instruction;
[0014] a determination module, configured to determine a placement position of each page element in the accounting plan configuration page based on a drag operation on each page element; the page element is an element in the accounting plan configuration page used to represent an accounting step;
[0015] A combining module, configured to combine the page elements according to the placement positions;
[0016] The generating module is further configured to generate the accounting solution based on the combined page elements.
[0017] In one embodiment, the computing module is further configured to:
[0018] Generate a target data node as a root node according to the calculation parameters through the first step node in the calculation chain;
[0019] Sequentially expand the target data node through the other step nodes in the calculation chain layer by layer to obtain the data node corresponding to each step node;
[0020] Generate accounting result data according to the data nodes corresponding to each step node in the accounting chain.
[0021] In one embodiment, the computing module is further configured to:
[0022] For a target step node among the other step nodes, a target data node set is calculated to obtain an item value of the attendance item corresponding to the target step node; the target data node set is a set of data nodes selected from the target data node and the step nodes before the target step node;
[0023] Based on the item identifier and the item value of the attendance item, a data node corresponding to the target step node is generated.
[0024] In one embodiment, the apparatus further comprises:
[0025] A determination module, configured to determine a target step node among the step nodes of the accounting chain based on an accounting step viewing operation;
[0026] An acquisition module, configured to acquire a target data node corresponding to the target step node;
[0027] An extraction module, configured to extract a parent node identifier of the target data node from the target data node;
[0028] a tracing module, configured to trace back the parent node of the target data node based on the parent node identifier;
[0029] The display module is further used to display the attendance item identifiers, item values and calculation rules corresponding to the attendance item identifiers extracted from each parent node.
[0030] In one embodiment, the apparatus further comprises:
[0031] A storage module, configured to store the calculation result data in a cache area through the calculation service and send a result notification message to the storage service;
[0032] an extraction module, configured to extract the calculation result data from the cache area according to the shard identifier extracted from the result notification message when the storage service receives the result notification message;
[0033] The storage module is further configured to store the extracted calculation result data into a data table through the storage service.
[0034] In one embodiment, the generating module is further configured to:
[0035] In the attendance accounting request, extract the characteristic identifier of the attendance subject to be accounted for;
[0036] According to the characteristic identifier, obtain the accounting scheme identifier and sharding condition corresponding to each attendance subject to be accounted for;
[0037] Grouping the attendance subjects to be calculated according to the accounting scheme identifier and the sharding condition to obtain attendance groups;
[0038] Generate a corresponding accounting task slice for each attendance group.
[0039] In one embodiment, the loading module is further configured to:
[0040] Obtaining accounting parameters from an external system according to an accounting plan and a parameter configuration file, and storing the accounting parameters in a parameter storage area;
[0041] According to the parameter entry provided by the accounting chain context, the accounting parameters are obtained from the parameter storage area.
[0042] In one embodiment, the apparatus further comprises:
[0043] The generation module is used to generate accounting task slices according to attendance accounting requests;
[0044] The loading module is further used to load the accounting plan corresponding to the accounting task in the accounting task slice.
[0045] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0046] Generate accounting task slices based on attendance accounting requests;
[0047] Load the calculation plan corresponding to the calculation task in the calculation task slice, and obtain the calculation parameters corresponding to the calculation plan;
[0048] If the calculation parameters pass the verification, a calculation chain is created based on the calculation plan;
[0049] The calculation parameters are calculated in sequence through the step nodes of each calculation stage in the calculation chain to obtain calculation result data.
[0050] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0051] Load the calculation plan corresponding to the calculation task and obtain the calculation parameters corresponding to the calculation plan;
[0052] Creating an accounting chain based on the accounting scheme;
[0053] The calculation parameters are calculated in sequence through the step nodes of each calculation stage in the calculation chain to obtain calculation result data.
[0054] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0055] Load the calculation plan corresponding to the calculation task and obtain the calculation parameters corresponding to the calculation plan;
[0056] Creating an accounting chain based on the accounting scheme;
[0057] The calculation parameters are calculated in sequence through the step nodes of each calculation stage in the calculation chain to obtain calculation result data.
[0058] The above-mentioned attendance accounting method, device, computer equipment, storage medium and computer program product load the accounting scheme corresponding to the accounting task, so that the corresponding version of the accounting scheme can be configured for the accounting tasks of different attendance subjects, thereby improving the flexibility of the accounting scheme configuration. The accounting parameters corresponding to the accounting scheme are obtained, and an accounting chain is created based on the accounting scheme; the accounting parameters are calculated in sequence through the step nodes of each accounting stage in the accounting chain to obtain the accounting result data. Since the accounting chain is created according to the accounting scheme, and the user can customize the accounting scheme based on the actual attendance needs, the accounting stages and step nodes in the accounting chain can be customized according to the attendance needs, which realizes the customization of each step in the attendance accounting and improves the flexibility of the attendance accounting. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1This is an application environment diagram of an attendance accounting method in one embodiment;
[0060] Figure 2 Schematic diagram of a flow chart of an attendance accounting method in one embodiment;
[0061] Figure 3 A schematic diagram of a calculation scheme in one embodiment;
[0062] Figure 4 Schematic diagram of a calculation chain in one embodiment;
[0063] Figure 5 A schematic diagram of calculation steps and calculation stages in one embodiment;
[0064] Figure 6 A schematic diagram of a flow chart of a method for generating a calculation plan in one embodiment;
[0065] Figure 7 A schematic diagram of a calculation plan configuration page in one embodiment;
[0066] Figure 8 A schematic diagram of a flow chart of a method for generating calculation result data in one embodiment;
[0067] Figure 9 A schematic diagram of data nodes corresponding to each step node in an embodiment;
[0068] Figure 10 A schematic diagram of attendance record details in one embodiment;
[0069] Figure 11 A schematic diagram of the accounting steps of tracing back in one embodiment;
[0070] Figure 12 1. A flow chart of a method for storing calculation result data in one embodiment;
[0071] Figure 13 A schematic diagram of a distributed attendance accounting system in one embodiment;
[0072] Figure 14a A schematic diagram of a flow chart of a method for loading a calculation plan in one embodiment;
[0073] Figure 14b A schematic diagram of the slicing of accounting tasks in one embodiment;
[0074] Figure 14c 1. A flowchart of a method for slicing accounting tasks in one embodiment;
[0075] Figure 15 A schematic diagram of an attendance accounting method executed through an accounting pipeline in one embodiment;
[0076] Figure 16 A flowchart of an attendance accounting method in another embodiment;
[0077] Figure 17 A structural block diagram of an attendance accounting device in one embodiment;
[0078] Figure 18 A structural block diagram of an attendance accounting device in another embodiment;
[0079] Figure 19 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0081] The attendance accounting method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the computer device 102 generates a calculation task slice based on the attendance calculation request, then loads the calculation plan corresponding to the calculation task in the calculation task slice and obtains the calculation parameters corresponding to the calculation plan. If the calculation parameters pass the verification, a calculation chain is created based on the calculation plan, and the calculation parameters are calculated in sequence through the step nodes of each calculation stage in the calculation chain to obtain the calculation result data.
[0082] Among them, the computer device 102 can be a terminal or a server. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers. The embodiment of the present application can be applied to a human resources (HR) system, and can also be applied to an enterprise resource planning (ERP) system that integrates HR functions.
[0083] In one embodiment, Figure 2 As shown, a method for attendance accounting is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the terminal in the figure:
[0084] S202: Load the accounting plan corresponding to the accounting task, and obtain the accounting parameters corresponding to the accounting plan.
[0085] Among them, the accounting task is the task of performing attendance accounting on the attendance subject. For example, the accounting task is the task of calculating the attendance subject's overtime hours, overtime time, vacation time, absence days, etc. The accounting plan is a plan configured according to the attendance method, rules, etc., which consists of multiple accounting stages, and each accounting stage includes one or more accounting steps. For example, Figure 3 As shown, the accounting scheme includes the calculation of original time pairs, the overtime accounting stage, and the leave accounting stage. The overtime accounting stage includes multiple steps such as overtime calculation, overtime compensation, overtime deductions, and overtime rounding. The leave accounting stage includes multiple steps such as leave type, leave deductions, and leave rounding. Accounting parameters are parameters defined in the accounting scheme and are used for attendance accounting. They can be read from the memory or obtained from an external system. The computer device can obtain the accounting parameters from the attendance records obtained by the attendance subject. For example, the computer device may obtain the accounting parameters of the attendance period: 9:00-18:00, the check-in time: 9:10, or the leave date: 2022.04.05-2022.04.08, etc.
[0086] S206: Create an accounting chain based on the accounting plan.
[0087] Among them, the accounting chain is used to represent the accounting stages and accounting steps in the attendance accounting process, and is the specific embodiment of the accounting scheme on the configuration end in the accounting process. The accounting chain is composed of accounting stages connected in series, and each accounting stage is composed of step nodes connected in series. The step node is the smallest unit of calculation node in the accounting chain, including input, accounting logic and output, and is used to calculate the input data according to the accounting logic to obtain output data. The accounting stages and step nodes in the accounting chain are determined according to the accounting scheme. Each accounting stage in the accounting scheme corresponds to the accounting stage in the accounting chain, and the accounting steps in the accounting scheme correspond to the step nodes in the accounting chain. The order between the accounting stages and the order of the step nodes in each accounting stage can be adjusted by configuring the accounting scheme, or accounting stages or step nodes can be added or deleted. For example, Figure 4 As shown, the accounting chain includes the overtime accounting stage and the leave accounting stage. The overtime accounting stage includes multiple steps such as overtime calculation, overtime compensation, overtime deductions, and overtime rounding. The leave accounting stage includes multiple steps such as leave type, leave deductions, and leave rounding.
[0088] In one embodiment, Figure 5As shown, the step nodes calculate the input data based on the step codes and step formulas defined in the accounting step. N (N ≥ 1) step nodes constitute an accounting stage, and N accounting stages constitute an accounting chain. The terminal determines the accounting scheme corresponding to the attendance subject based on the characteristic identifier recorded in the attendance subject's attendance file. Based on the accounting scheme, it creates a corresponding accounting chain to perform attendance accounting and obtain an attendance record.
[0089] In one embodiment, the steps prior to S206 also include: verifying the integrity of the accounting parameters; if the accounting parameters pass the integrity check, performing a constraint check on the accounting parameters according to the parameter constraint rules. If the accounting parameters pass the constraint check, it is determined that the accounting parameters have passed the check and the step S206 is executed. By performing integrity and constraint checks on the accounting parameters, it can be ensured that the accounting parameters obtained by the terminal are complete and not missing, and that the accounting parameters meet the constraint rules, thereby ensuring the accuracy of the attendance accounting results. If the accounting parameters fail the integrity or constraint check, a prompt message is generated to prompt the management personnel to take timely action.
[0090] S208, calculating the calculation parameters in sequence through the step nodes of each calculation stage in the calculation chain to obtain calculation result data.
[0091] The accounting result data is data used to represent the attendance results, and may include attendance item identifiers, item values, attendance attribution dates, or attendance shifts, etc. For example, the accounting result data may include "vacation duration: 48 hours; attendance attribution date: 2022.03.15; attendance shift: flexible shift."
[0092] The terminal calculates the calculation parameters in turn through the step nodes of each calculation stage in the calculation chain, for example, Figure 3 As shown, the terminal first calculates the accounting parameters through the "Overtime Calculation" step node in the accounting chain, and then calculates the data calculated by the "Overtime Calculation" step node and the accounting parameters through the "Overtime Compensation" step node, and so on, until the last step node of the accounting chain, to obtain the accounting result data.
[0093] In one embodiment, the calculation result data may be in various formats such as JSON (JavaScript Object Notation) or XML (Extensible Markup Language).
[0094] In the above embodiment, an accounting task slice is generated according to the attendance accounting request, and the accounting scheme corresponding to the accounting task in the accounting task slice is loaded, so that the corresponding version of the accounting scheme can be configured for the accounting tasks of different attendance subjects, thereby improving the flexibility of the configuration of the accounting scheme. The accounting parameters corresponding to the accounting scheme are obtained. If the accounting parameters pass the verification, an accounting chain is created based on the accounting scheme; the accounting parameters are calculated in turn through the step nodes of each accounting stage in the accounting chain to obtain the accounting result data. Since the accounting chain is created according to the accounting scheme, and the user can customize the accounting scheme based on the actual attendance needs, the accounting stages and step nodes in the accounting chain can be customized according to the attendance needs, realizing the customization of each step in the attendance accounting and improving the flexibility of the attendance accounting.
[0095] In one embodiment, Figure 6 As shown, before S204, the following steps are also included:
[0096] S602: In response to the accounting plan configuration instruction, display an accounting plan configuration page.
[0097] The accounting scheme configuration instruction is an instruction for triggering the accounting scheme configuration, which can be an instruction triggered by clicking, dragging, sliding the page or triggering a control. The accounting scheme configuration page is a page for configuring the accounting scheme, which includes multiple movable page elements. For example, Figure 7 As shown, the accounting plan configuration page includes multiple page elements such as "Overtime Calculation Start Date".
[0098] S604: Determine the placement position of each page element based on the drag operation on each page element in the accounting plan configuration page.
[0099] Among them, the page elements are elements used to represent the accounting steps in the accounting plan configuration page, which can be graphics, text, symbols, etc., or a combination of one or more of graphics, text or symbols. The drag operation is an operation for moving page elements. For example, it can be an operation of clicking on a page element and moving the page element through a touch screen. The drag operation can be used to drag in new page elements, remove the dragged page elements, or adjust the placement of page elements. For example, Figure 7 As shown, you can drag "Overtime Compensation" to before the start of overtime calculation, remove "Overtime Compensation" from the accounting plan configuration page, or drag in the "Vacation Compensation" page element. The placement position is the location of the page element within the accounting plan configuration page. The placement position determines which page elements are present on the accounting plan configuration page and their order.
[0100] S606: Combine the page elements according to the placement positions.
[0101] Since the placement positions can determine which page elements exist in the accounting plan configuration page and the order in which the page elements are arranged, the terminal can combine the page elements in the accounting plan configuration page according to the order determined by the placement positions.
[0102] S608: Generate a calculation plan based on the combined page elements.
[0103] The terminal generates a calculation plan based on the combined page elements. The generated calculation plan consists of calculation steps represented by the page elements, and the order of the calculation steps is consistent with the arrangement order of the page elements.
[0104] In the above embodiment, in response to the accounting scheme configuration instruction, the accounting scheme configuration page is displayed. Based on the drag operation on each page element in the accounting scheme configuration page, the placement position of the page element is determined. The page elements are combined according to the placement position, and the accounting scheme is generated based on the combined page elements. Therefore, according to the attendance requirements, accounting steps can be added or deleted in the accounting scheme, or the order of each accounting step can be adjusted, and the accounting scheme can be flexibly customized in a visual manner, which is equivalent to flexibly customizing the accounting chain in a visual manner. Compared with the attendance accounting method with fixed accounting steps, it has greater flexibility and scalability.
[0105] In one embodiment, Figure 8 As shown, S208 specifically includes the following steps:
[0106] S802, through the first step node in the accounting chain, generate a target data node as a root node according to the accounting parameters.
[0107] Among them, the data node is data of a specific data structure, including node identifier, parent node identifier, accounting rules, attendance attribution date, time pair, attendance subject information, attendance item identifier or item value, etc. The accounting rule is the calculation rule used when generating the data node, including which data to calculate and the calculation algorithm, etc. The time pair is an attendance time unit consisting of the start time and the end time. The attendance subject information includes the attendance subject's position, job title, department, accounting plan, etc. Attendance items are entries used to define attendance content, including business trip items, overtime items, leave items, night shift items, abnormal items or normal attendance items, etc. Each attendance item can include content such as duration, number of times or days.
[0108] In one embodiment, S802 specifically includes: calculating the accounting parameters according to the attendance algorithm corresponding to the first step node in the accounting scheme through the first step node in the accounting chain to obtain the target data node as the root node.
[0109] S804, sequentially expanding the target data node through the other step nodes in the calculation chain to obtain the data node corresponding to each step node.
[0110] The terminal sequentially expands the target data node through other step nodes in the accounting chain, for example, Figure 9 As shown, data node 1 is the root node. Data node 1 is expanded through step node 2 to obtain data node 2 and data node 3 corresponding to step node 2; data node 2 and data node 3 are expanded through step node 3 to obtain data node 4 corresponding to step node 3, and so on, to obtain the data node corresponding to each step node.
[0111] In one embodiment, S804 specifically includes: calculating the target data node set for the target step node in other step nodes to obtain the project value of the attendance item corresponding to the target step node; the target data node set is a set of data nodes selected from the data nodes expanded from the target data node and the step node before the target step node; based on the project identifier and project value of the attendance item, generating the data node corresponding to the target step node.
[0112] The target step node is any other step node except the first step node in the accounting chain. Each target step node calculates the item value of a specific attendance item based on the generated data node, and generates the data node corresponding to the step node based on the calculation result. The data node used in the calculation is the parent node of the currently generated data node. For example, Figure 9 As shown, step 3 of the accounting phase 1 calculates the item value of attendance item C based on data node 2 and data node 3, and generates data node 4 based on the calculation result. Data node 2 and data node 3 are parent nodes of data node 4.
[0113] The target data node set is a set of data nodes selected from the data nodes expanded from the target data node and the step node before the target step node. Figure 9 As shown, if the target step node is step node 1 in the second calculation phase, the target data node set can be a set consisting of any one or more data nodes among data nodes 1, 2, 3, 4, and 10.
[0114] In one embodiment, each step node in the calculation chain outputs a data node set consisting of multiple data nodes after calculation. The multiple data nodes output by each calculation stage also constitute a data node set. During calculation, the step nodes in the calculation chain can access the data node sets output by each step node and the data node sets output by each calculation stage through the calculation chain context. The calculation chain context can be used to traverse, sort, or filter each data node set.
[0115] S806: Generate accounting result data according to the data nodes corresponding to each step node in the accounting chain.
[0116] In one embodiment, S806 specifically includes: for each data node in the same accounting stage, for data nodes with the same attendance item, according to the parent-child relationship between the data nodes, causing the child node to overwrite the parent node, and generating accounting result data based on the overwritten data node. Alternatively, for each data node in the same accounting stage, for data nodes with the same attendance item, according to the parent-child relationship between the data nodes, calculating the data nodes at the same level to obtain the accounting result data.
[0117] In the above embodiment, the target data node as the root node is generated according to the accounting parameters through the first step node in the accounting chain; the target data node is expanded layer by layer through the other step nodes in the accounting chain to obtain the data node corresponding to each step node; and the accounting result data is generated according to the data nodes corresponding to each step node in the accounting chain. Since the data nodes corresponding to each step node in the accounting chain are obtained by layer-by-layer expansion of the root node, there is a parent-child relationship between the data nodes. According to the parent-child relationship between the data nodes, the parent node of any data node can be traced back, and the accounting rules used when locating and generating each data node can be based on the project identifier, project value, and accounting rules contained in the traced data node. This ensures that the entire process of attendance accounting can be traced, improves the management efficiency of the attendance accounting process, and can quickly locate the cause of the error when an error occurs in the accounting result.
[0118] In one embodiment, S208 also includes: based on the accounting step viewing operation, determining the target step node in the step node of the accounting chain; obtaining the target data node corresponding to the target step node; extracting the parent node identifier of the target data node in the target data node; tracing the parent node of the target data node based on the parent node identifier; displaying the attendance item identifier, item value and accounting rules corresponding to the attendance item identifier extracted from each parent node.
[0119] The accounting step viewing operation is used to trace the attendance accounting process and view each accounting step. Figure 10As shown, the accounting step viewing operation can be an operation triggered by clicking on the "Accounting Step" in the attendance accounting details page. The terminal determines the accounting step to be viewed based on the triggered accounting step viewing operation, thereby determining the target step node to be viewed in the step node of the accounting chain. Then, the target data node corresponding to the target step node is obtained, and tracing is started from the target data node. Since each data node stores the node identifier and the parent node identifier, the terminal traces the parent node of the target data node based on the parent node identifier in the target data node. For example, Figure 9 As shown, the terminal can trace back the parent node of data node 10 to data node 4 based on the parent node identifier stored in data node 10, and the parent node of data node 4 can be traced back to data node 2 based on the parent node identifier stored in data node 4, and so on, until the root node is traced back.
[0120] When the terminal traces back to each parent node, it displays the attendance item ID, item value and the accounting rules corresponding to the attendance item ID extracted from each parent node. Figure 11 As shown, when the terminal traces back to the data node according to the parent node identifier, it displays the attendance item identifier, item value and the accounting rule corresponding to the attendance item identifier in the data node.
[0121] In the above embodiment, the terminal traces the parent node of each data node according to the parent node identifier stored in the data node, thereby achieving traceability of the entire attendance accounting process, improving the management efficiency of the attendance accounting process, and quickly locating the cause of the error when an error occurs in the accounting result.
[0122] In one embodiment, Figure 12 As shown, after S208, the following steps are also included:
[0123] S1202: The accounting service stores the accounting result data in a cache area, and sends a result notification message to the storage service.
[0124] Among them, accounting service is a service used for attendance accounting in a distributed system. Storage service is a service used for data storage in a distributed system. Accounting service and storage service support multi-node distributed deployment, and the number of nodes can be adjusted according to the amount of calculation and data volume to support large-scale accounting scenarios of large enterprises. The cache area is a storage area for temporarily storing accounting result data, which can be a storage area in Redis (Remote Dictionary Server). Figure 13 As shown, when the accounting service calculates the accounting result data, it stores the accounting result data in the Redis cache area, and then sends a result notification message to the storage service in the form of a message queue (MQ).
[0125] S1204: When the storage service receives the result notification message, it extracts the calculation result data from the cache area according to the shard identifier extracted from the result notification message.
[0126] The shard ID identifies the calculation task shard and can consist of one or more of numbers, letters, characters, or special symbols. When the storage service receives the result notification message, it extracts the shard ID from the message and then retrieves the calculation result data for the calculation task shard based on the shard ID.
[0127] S1206: Store the extracted accounting result data into a data table through the storage service.
[0128] When the storage service extracts the accounting result data from the cache, it parses the accounting result data to obtain the data of each field and stores the data of each field into the data table according to the field identifier.
[0129] In the above embodiment, the accounting service calculates the accounting result data, and then stores the accounting result data in the storage service, thereby decoupling the accounting service and the storage service, improving the computing performance of the accounting service. In addition, the accounting service and the storage service can be performed simultaneously, improving the efficiency of attendance accounting.
[0130] In one embodiment, Figure 14a As shown, S202 includes S1402 before S202, and S202 specifically includes S1404a:
[0131] S1402a: Generate accounting task slices according to the attendance accounting request.
[0132] Among them, the attendance accounting request is an instruction to instruct attendance accounting for an attendance subject, and can be used to instruct attendance accounting for one or more attendance subjects. The attendance accounting request can be a request instruction triggered for attendance subjects in different departments, positions, posts, or work shifts. For example, the attendance accounting request is an instruction to instruct attendance accounting for 1,000 on-the-job attendance subjects; for another example, the attendance accounting request is an instruction to instruct attendance accounting for all employees in Department A; for another example, the attendance accounting request is an instruction to instruct attendance accounting for attendance subjects in production positions.
[0133] A calculation task shard is a set of tasks that is created by sharding all calculation tasks based on the distributed principle. For example, a calculation task shard may include the calculation task of performing attendance calculations on 100 attendance entities.
[0134] In one embodiment, the terminal can slice the accounting tasks corresponding to all attendance entities in the attendance accounting request according to the slicing strategy to obtain accounting task slices. Figure 14b As shown, the attendance accounting request instructs attendance accounting for 1,000 attendance entities in Department A. Based on the sharding strategy, the accounting task for these 1,000 attendance entities is sharded, resulting in three accounting task shards. The terminal performs task sharding based on the attendance accounting request, dividing the accounting task for a large number of attendance entities, triggered by the attendance accounting request, into multiple accounting task shards. This allows multiple accounting services in the distributed system to process each accounting task shard in parallel, improving the processing efficiency of accounting tasks.
[0135] S1404a, loading the calculation plan corresponding to the calculation task in the calculation task slice.
[0136] In one embodiment, Figure 14c As shown, S1402a specifically includes the following steps:
[0137] S1402c: In the attendance accounting request, extract the characteristic identifier of the attendance subject to be accounted for.
[0138] The feature identifier is an identifier of the attendance subject's related features, including the attendance subject identification number, organization identifier, position identifier, and job identifier. For example, if an attendance accounting request indicates that attendance accounting should be performed for all employees in Department A, and the attendance subjects to be accounted for are all employees in Department A, the terminal extracts the feature identifier of each attendance subject.
[0139] S1404c: According to the characteristic identifier, obtain the accounting scheme identifier and sharding condition corresponding to each attendance subject to be accounted for.
[0140] The sharding condition is a condition used to shard the accounting task. For example, the sharding condition can be that the attendance subjects in the same accounting task shard have the same position; another example is that the attendance subjects in the same accounting task shard are from the same department; another example is that the attendance subjects in the same accounting task shard have the same job position.
[0141] S1406c: Group the attendance subjects to be calculated according to the accounting scheme identifier and the sharding condition to obtain attendance groups.
[0142] The terminal groups the accounting subjects according to the accounting scheme ID and sharding conditions. The accounting scheme IDs corresponding to the attendance subjects in the same attendance group are the same and the sharding conditions are met. For example, for Department A, where attendance subjects 1-15 are production positions, attendance subjects 16-30 are technical positions, and the accounting scheme for attendance subjects 1-30 is Accounting Scheme 1; attendance subjects 31-50 are administrative positions, attendance subjects 51-70 are accounting positions, and the accounting scheme for attendance subjects 31-70 is Accounting Scheme 2, the terminal can divide all attendance subjects in Department A into four attendance groups based on their positions: attendance subjects 1-15, 16-30, 31-50, and 51-70. The attendance subjects in each attendance group share the same accounting scheme and positions.
[0143] S1408c: Generate corresponding accounting task slices for each attendance group.
[0144] The terminal generates a corresponding accounting task slice for each attendance group. Each accounting task slice is used to perform attendance accounting for the attendance subjects in the corresponding attendance group.
[0145] In one embodiment, S1408c specifically includes: generating corresponding accounting task slices for each attendance group through the slice service. S1408c also includes: the slice service stores the slice records corresponding to each accounting task slice, and then sends the slice task message to the accounting service. Figure 13 As shown, when the terminal receives an attendance accounting request, the sharding service is used to perform task sharding processing on the attendance subject in the attendance accounting request to obtain multiple accounting task shards. The sharding service then stores the sharding records corresponding to each accounting task shard, and then sends a sharding task message to the accounting service. When the accounting service receives the sharding task message, it performs idempotence and business rule verification on the accounting task in the accounting task shard, and then submits the verified accounting task shard to the thread pool. If the thread pool receives the accounting task shard, a "received" mark is added to the shard record corresponding to the accounting task shard, thereby avoiding the thread pool from repeatedly receiving the accounting task shard. If the thread pool rejects the accounting task shard, the number of rejections is increased by one in the shard record corresponding to the accounting task shard, and the sharding task message is forwarded to other accounting services. Before the accounting service starts processing the accounting task, the idempotence and business rules of the accounting task are checked again. After the verification passes, the "processing" mark is added to the shard record corresponding to the accounting task, thereby preventing the accounting service from repeatedly processing the accounting task shard.
[0146] In the above embodiment, in the attendance accounting request, the characteristic identifier of the attendance subject to be accounted for is extracted, and then the accounting scheme identifier and sharding condition corresponding to each attendance subject to be accounted for are obtained based on the characteristic identifier. The attendance subjects to be accounted for are grouped according to the accounting scheme identifier and the sharding condition to obtain attendance groups, and corresponding accounting task shards are generated for each attendance group. Thus, each accounting task shard can be processed in parallel by multiple accounting services in the distributed system, thereby improving the processing efficiency of the accounting tasks. Moreover, since the accounting schemes of the attendance subjects in the same accounting task shard can be made the same through task sharding, the accounting service can process the accounting tasks in the accounting task shards according to the same accounting chain, thereby reducing the computational complexity and improving the efficiency of attendance accounting.
[0147] In one embodiment, S204 specifically includes: obtaining accounting parameters from an external system according to an accounting plan and a parameter configuration file, and storing the accounting parameters in a parameter storage area; obtaining accounting parameters from the parameter storage area according to a parameter entry provided by the accounting chain context.
[0148] Accounting parameters can be stored in memory or in an external system. External systems are business systems other than the attendance accounting system, such as sign-in systems, human resources systems, enterprise management systems, or production management systems. If accounting parameters are stored in an external system, if the terminal directly extracts the accounting parameters from the external system during attendance accounting, it will not only take a long time to extract, but also require data interaction with the external system, and the interaction process is easily restricted by the network environment. Therefore, before the terminal executes attendance accounting through the accounting chain, the accounting parameters are first initialized, the accounting parameters are extracted from the external system to the local system, and the accounting chain context is used to ensure that the terminal obtains the required accounting parameters in a timely manner, thereby improving the execution performance of the accounting chain.
[0149] Among them, the parameter configuration file is used to store the loading address of the accounting parameters. The accounting chain context is used to provide an execution environment for the execution process of the accounting chain and save the status information of the accounting chain execution process, including the parameter entry for providing accounting parameters, the data nodes calculated by each step node, the attendance attribution date related information (for example, attendance subject, attribution date or date type, etc.) and accounting variables. The terminal determines the accounting parameters required for the execution process of the accounting chain through the accounting plan, and then searches the parameter configuration file for the loading address of each accounting parameter, and loads the accounting parameters from the external system according to the loading address.
[0150] In the above embodiment, the terminal obtains accounting parameters from an external system based on the accounting plan and parameter configuration file, stores the accounting parameters in a parameter storage area, and then retrieves the accounting parameters from the parameter storage area based on the parameter entry provided by the accounting chain context. This allows the terminal to directly obtain the accounting parameters locally when executing the accounting chain, avoiding interaction with external systems during execution and improving the execution performance of the accounting chain.
[0151] In one embodiment, Figure 15 As shown, the terminal receives an attendance accounting request from the front-end, which includes attendance entities for multiple different accounting schemes. The terminal verifies the parameters contained in the attendance accounting request. After verification, the sharding service in the distributed sharding service cluster generates accounting task shards based on the attendance accounting request, caches the shards, and sends sharding task messages to the accounting service. Upon receiving the sharding task message, the accounting service extracts the shards from the cache based on the task identifier contained in the sharding task message and performs idempotence and business rule validation on the shards. If the shards pass validation, the accounting service submits the shards to the accounting task thread pool, which then processes the shards through the accounting threads created within the sharding thread pool. When the sharding thread runs, it first loads the accounting scheme corresponding to the task, verifies the scheme's integrity, and performs constraint validation on the scheme according to the constraint rules. If the calculation plan passes verification, the calculation parameters are initialized and their integrity and constraints are checked. The parameter initialization process can be performed in parallel to improve initialization efficiency. After parameter initialization and parameter verification are completed, a calculation pipeline is created in the calculation thread. The calculation pipeline creates a calculation chain and drives the execution of the calculation chain.
[0152] The accounting chain creates a stage executor based on the accounting plan and drives its execution. The stage executor creates a step executor and drives its execution. The step executor consists of a filtering unit, a calculation unit, and a result detection unit. The filtering unit filters the data nodes in the accounting chain context according to the accounting plan to obtain the data nodes required for the step executor to run. The calculation unit performs calculations based on the filtered data nodes and accounting parameters to obtain new data nodes. The filtering unit and calculation unit can be implemented using the filtering class and the calculation class. The result detection unit is specified in the backend configuration file and is used to verify the integrity and legitimacy of the data nodes calculated by the calculation unit.
[0153] Before the operation of the accounting pipeline, accounting chain, and stage executor, the terminal verifies the relevant data required for the operation through the corresponding verifier. The terminal assigns a unified accounting chain verifier to each accounting chain created, which is mainly used to verify the existence of necessary initialization parameters related to the attendance attribution date and to perform business rule verification. The stage verifier is bound to a specific accounting stage. The verification rules for different accounting stages are different, and it is used to verify the pre-business rules of the bound accounting stage. The accounting chain verifier and the stage verifier pre-process the verification process required to ensure the correct operation of the calculation unit. If the verification fails, there is no need to perform calculations through the calculation unit to avoid unnecessary waste of computing resources.
[0154] The accounting chain context provides accounting variables for communication between accounting services, accounting pipelines, stage executors, and step executors. Accounting variables have visibility and a lifecycle. Visibility includes visibility to the accounting service, accounting pipeline, accounting chain, stage executor, and step executor. Accounting variables are automatically cleared after the accounting service, accounting pipeline, accounting chain, stage executor, and step executor complete their operations.
[0155] The accounting service controls the execution of the accounting pipeline, which in turn controls the execution of the accounting chain, which in turn controls the execution of the stage executors. Based on the execution status of the step executors, the stage executors determine whether to proceed to the next accounting step, whether to exit the current accounting stage, whether the current accounting step terminated abnormally, and whether to retain the execution results of the current accounting step. When the accounting pipeline for all accounting tasks completes, the callback method is executed. The callback method returns the accounting result data and updates the task record of the accounting task shard. Based on the execution result, the task status in the task record is updated to "successful," "partially successful," or "failed."
[0156] The calculation pipeline packages the calculation results obtained by executing the calculation chain into data packets and submits them to the packet router. One packet router stores the data packets in Redis and counts the data packets, while another packet router disassembles the data packets and stores them in a data table.
[0157] In one embodiment, Figure 16 As shown, the attendance accounting method includes the following steps:
[0158] S1602: In response to the accounting plan configuration instruction, display the accounting plan configuration page, and determine the placement position of each page element based on the drag operation on each page element in the accounting plan configuration page.
[0159] S1604: Combine the page elements according to the placement positions, and generate a calculation plan based on the combined page elements.
[0160] S1606: Extract the characteristic identifier of the attendance subject to be accounted in the attendance accounting request, and obtain the accounting scheme identifier and sharding condition corresponding to each attendance subject to be accounted according to the characteristic identifier.
[0161] S1608: Group the subjects to be accounted for attendance according to the accounting scheme identifier and the sharding condition to obtain attendance groups.
[0162] S1610: Generate a corresponding accounting task slice for each attendance group, load the accounting plan corresponding to the accounting task in the accounting task slice, and obtain accounting parameters corresponding to the accounting plan.
[0163] S1612: If the calculation parameters pass verification, a calculation chain is created based on the calculation plan. Through the first step node in the calculation chain, a target data node is generated as a root node according to the calculation parameters.
[0164] S1614, sequentially expand the target data node through the other step nodes in the accounting chain, obtain the data node corresponding to each step node, and generate accounting result data based on the data nodes corresponding to each step node in the accounting chain.
[0165] S1616: The accounting service stores the accounting result data in a cache and sends a result notification message to the storage service. When the storage service receives the result notification message, it extracts the accounting result data from the cache according to the shard identifier extracted from the result notification message.
[0166] S1618: The extracted accounting result data is stored in a data table through the storage service.
[0167] S1620, based on the accounting step viewing operation, determine the target step node in the step nodes of the accounting chain.
[0168] S1622: Obtain the target data node corresponding to the target step node, extract the parent node identifier of the target data node from the target data node, and trace back the parent node of the target data node based on the parent node identifier.
[0169] S1624, displaying the attendance item identifier, item value, and calculation rules corresponding to the attendance item identifier extracted from each parent node.
[0170] For the specific contents of S1602 to S1624 above, please refer to the specific implementation process above.
[0171] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0172] Based on the same inventive concept, embodiments of the present application also provide an attendance accounting device for implementing the aforementioned attendance accounting method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more of the following embodiments of the attendance accounting device can be found in the above-mentioned limitations on the attendance accounting method and will not be further elaborated here.
[0173] In one embodiment, Figure 17 As shown, an attendance accounting device is provided, including: a loading module 1702, a creation module 1704 and a calculation module 1706, wherein:
[0174] The loading module 1702 is used to load the accounting plan corresponding to the accounting task in the accounting task slice and obtain the accounting parameters corresponding to the accounting plan;
[0175] A creation module 1704 is configured to create a calculation chain based on the calculation plan if the calculation parameters pass verification;
[0176] The calculation module 1706 is used to calculate the calculation parameters in sequence through the step nodes of each calculation stage in the calculation chain to obtain calculation result data.
[0177] In the above embodiment, the accounting scheme corresponding to the accounting task is loaded, so that the corresponding version of the accounting scheme can be configured for the accounting tasks of different attendance entities, thereby improving the flexibility of the accounting scheme configuration. The accounting parameters corresponding to the accounting scheme are obtained, and an accounting chain is created based on the accounting scheme; the accounting parameters are calculated in sequence through the step nodes of each accounting stage in the accounting chain to obtain the accounting result data. Since the accounting chain is created based on the accounting scheme, and the user can customize the accounting scheme based on the actual attendance needs, the accounting stages and step nodes in the accounting chain can be customized according to the attendance needs, realizing the customization of each step in the attendance accounting and improving the flexibility of the attendance accounting.
[0178] In one embodiment, Figure 18 As shown, the device also includes:
[0179] A display module 1708 is configured to display an accounting plan configuration page in response to an accounting plan configuration instruction;
[0180] Determining module 1710, for determining the placement of page elements based on a drag operation on each page element in the accounting plan configuration page; the page elements are elements in the accounting plan configuration page used to represent accounting steps;
[0181] A combination module 1712 is used to combine the page elements according to the placement position;
[0182] The generating module 1714 is further configured to generate a calculation plan based on the combined page elements.
[0183] In one embodiment, the calculation module 1706 is further configured to:
[0184] Through the first step node in the accounting chain, a target data node as the root node is generated according to the accounting parameters;
[0185] By sequentially expanding the target data node through the other step nodes in the accounting chain, the child nodes are expanded layer by layer to obtain the data nodes corresponding to each step node;
[0186] Generate accounting result data based on the data nodes corresponding to each step node in the accounting chain.
[0187] In one embodiment, the calculation module 1706 is further configured to:
[0188] For the target step node among other step nodes, the target data node set is calculated to obtain the item value of the attendance item corresponding to the target step node; the target data node set is a set of data nodes selected from the target data node and the step nodes before the target step node;
[0189] Based on the item ID and item value of the attendance item, a data node corresponding to the target step node is generated.
[0190] In one embodiment, the apparatus further comprises:
[0191] A determination module 1710 is configured to determine a target step node among the step nodes of the accounting chain based on the accounting step viewing operation;
[0192] An acquisition module 1716 is used to acquire a target data node corresponding to a target step node;
[0193] Extraction module 1718, used to extract the parent node identifier of the target data node from the target data node;
[0194] A tracing module 1720 is configured to trace the parent node of the target data node based on the parent node identifier;
[0195] The display module 1708 is further used to display the attendance item identifiers, item values, and calculation rules corresponding to the attendance item identifiers extracted from each parent node.
[0196] In one embodiment, the apparatus further comprises:
[0197] The storage module 1722 is used to store the calculation result data in the cache area through the calculation service and send a result notification message to the storage service;
[0198] Extraction module 1718, configured to extract the calculation result data from the cache according to the shard identifier extracted from the result notification message when the storage service receives the result notification message;
[0199] The storage module 1722 is further configured to store the extracted calculation result data into a data table through a storage service.
[0200] In one embodiment, the generating module 1714 is further configured to:
[0201] In the attendance accounting request, extract the characteristic identifier of the attendance subject to be accounted for;
[0202] According to the characteristic identifier, obtain the accounting scheme identifier and sharding conditions corresponding to each attendance subject to be accounted for;
[0203] Group the accounting attendance subjects according to the accounting scheme identifier and sharding conditions to obtain attendance groups;
[0204] Generate corresponding accounting task slices for each attendance group.
[0205] In one embodiment, the loading module 1702 is further configured to:
[0206] Obtain accounting parameters from the external system according to the accounting plan and parameter configuration file, and store the accounting parameters in the parameter storage area;
[0207] According to the parameter entry provided by the accounting chain context, the accounting parameters are obtained from the parameter storage area.
[0208] Each module in the attendance accounting device described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0209] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 19 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, it implements a method for attendance accounting. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0210] Those skilled in the art will understand that Figure 19 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0211] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0212] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0213] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0214] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0215] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0216] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0217] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for attendance accounting, characterized in that: The method comprises: Loading a calculation plan corresponding to a calculation task for performing attendance accounting on an attendance subject, wherein the calculation plan is determined based on a characteristic identifier recorded in the attendance file of the attendance subject. The calculation plan is composed of multiple calculation stages, each of which includes one or more calculation steps. The order of the calculation stages in the calculation plan and the calculation steps in each calculation node are determined by configuration; Obtaining the accounting parameters corresponding to the accounting scheme from the attendance records obtained by checking the attendance of the attendance subject; Creating an accounting chain based on the accounting plan, wherein each accounting stage in the accounting plan corresponds to an accounting stage in the accounting chain, and each accounting step in the accounting plan corresponds to a step node in the accounting chain; Generate a target data node as a root node according to the calculation parameters through the first step node in the calculation chain; Sequentially expand the target data node through the other step nodes in the calculation chain layer by layer to obtain the data node corresponding to each step node; Generate accounting result data according to the data nodes corresponding to each step node in the accounting chain.
2. The method according to claim 1, characterized in that The method further comprises: In response to the accounting plan configuration instruction, displaying the accounting plan configuration page; Determining the placement of each page element in the accounting plan configuration page based on a drag operation on the page element; the page element is an element in the accounting plan configuration page used to represent an accounting step; combining the page elements according to the placement positions; The accounting plan is generated based on the combined page elements.
3. The method according to claim 1, characterized in that The target data node is expanded layer by layer through the other step nodes in the calculation chain to obtain the data nodes corresponding to each step node. For a target step node among the other step nodes, a target data node set is calculated to obtain an item value of the attendance item corresponding to the target step node; the target data node set is a set of data nodes selected from the target data node and the step nodes before the target step node; Based on the item identifier and the item value of the attendance item, a data node corresponding to the target step node is generated.
4. The method according to claim 1, wherein The method further comprises: Based on the calculation step viewing operation, determining a target step node among the step nodes of the calculation chain; Obtain the target data node corresponding to the target step node; Extracting the parent node identifier of the target data node from the target data node; Tracing back the parent node of the target data node based on the parent node identifier; The attendance item identifier, item value and calculation rules corresponding to the attendance item identifier extracted from each parent node are displayed.
5. The method according to claim 1, wherein The method further comprises: The calculation result data is stored in the cache area through the calculation service, and a result notification message is sent to the storage service; When the storage service receives the result notification message, the storage service extracts the calculation result data from the cache area according to the shard identifier extracted from the result notification message; The extracted calculation result data is stored in a data table through the storage service.
6. The method according to claim 1, characterized in that The method further comprises: Generate accounting task slices based on attendance accounting requests; The calculation scheme corresponding to the loading calculation task includes: Load the calculation plan corresponding to the calculation task in the calculation task slice.
7. The method according to claim 6, characterized in that Generating accounting task slices according to the attendance accounting request includes: In the attendance accounting request, extract the characteristic identifier of the attendance subject to be accounted for; According to the characteristic identifier, obtain the accounting scheme identifier and sharding condition corresponding to each attendance subject to be accounted for; Grouping the attendance subjects to be calculated according to the accounting scheme identifier and the sharding condition to obtain attendance groups; Generate a corresponding accounting task slice for each attendance group.
8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Obtaining accounting parameters from an external system according to an accounting plan and a parameter configuration file, and storing the accounting parameters in a parameter storage area; According to the parameter entry provided by the accounting chain context, the accounting parameters are obtained from the parameter storage area.
9. An attendance accounting device, characterized in that: The device comprises: The generation module is used to generate accounting task slices according to attendance accounting requests; A loading module is used to load a calculation scheme corresponding to a calculation task in the calculation task slice for performing attendance calculation on an attendance subject, wherein the calculation scheme is determined based on a characteristic identifier recorded in the attendance file of the attendance subject, the calculation scheme is composed of a plurality of calculation stages, each of which includes one or more calculation steps, the order between the calculation stages in the calculation scheme and the calculation steps in each calculation node are determined by configuration, and the calculation parameters corresponding to the calculation scheme are obtained from the attendance record obtained by performing attendance calculation on the attendance subject; a creation module, configured to create a calculation chain based on the calculation plan if the calculation parameters pass verification, wherein each calculation stage in the calculation plan corresponds to an accounting stage in the calculation chain, and each calculation step in the calculation plan corresponds to a step node in the calculation chain; The calculation module is used to generate a target data node as a root node according to the calculation parameters through the first step node in the calculation chain; expand the target data node layer by layer through other step nodes in the calculation chain to obtain the data node corresponding to each step node; and generate calculation result data according to the data nodes corresponding to each step node in the calculation chain.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Attendance statistical method and equipment
CN111680960A
Salary business processing method and system
CN114626817A