CN114862270A - Attendance data processing method and system - Google Patents

Attendance data processing method and system Download PDF

Info

Publication number
CN114862270A
CN114862270A CN202210630980.8A CN202210630980A CN114862270A CN 114862270 A CN114862270 A CN 114862270A CN 202210630980 A CN202210630980 A CN 202210630980A CN 114862270 A CN114862270 A CN 114862270A
Authority
CN
China
Prior art keywords
attendance
data
employee
time
complete
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.)
Pending
Application number
CN202210630980.8A
Other languages
Chinese (zh)
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.)
Tianyi Digital Life Technology Co Ltd
Original Assignee
Tianyi Digital Life 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 Tianyi Digital Life Technology Co Ltd filed Critical Tianyi Digital Life Technology Co Ltd
Priority to CN202210630980.8A priority Critical patent/CN114862270A/en
Publication of CN114862270A publication Critical patent/CN114862270A/en
Pending legal-status Critical Current

Links

Images

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/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • 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/103Workflow collaboration or project management

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Physics & Mathematics (AREA)
  • Economics (AREA)
  • Databases & Information Systems (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Tourism & Hospitality (AREA)
  • Marketing (AREA)
  • Evolutionary Biology (AREA)
  • Game Theory and Decision Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Time Recorders, Dirve Recorders, Access Control (AREA)

Abstract

The application discloses an attendance data processing method and system, and the method comprises the following steps: establishing a complete attendance record table; configuring a trigger in a database of the external attendance system to gather card punching data of the external attendance system into an attendance recording table in real time; acquiring attendance event data from the OA system by configuring a trigger in the OA system, and converging the attendance event data into a complete attendance record table according to employee identification and event occurrence date in the attendance event data; when the staff inquires the attendance result, the corresponding data is obtained from the complete attendance record table according to the staff identification of the staff and the calculation is carried out according to the preset calculation strategy to obtain the attendance calculation result of the staff, so that the technical problems that in the prior art, the fact that which records need to be extracted from a database are difficult to determine, the accurate calculation is difficult, and the manual processing by staff is needed, the time consumption is long, the efficiency is low, and errors are easy to occur are solved.

Description

Attendance data processing method and system
Technical Field
The application relates to the technical field of data processing, in particular to an attendance data processing method and system.
Background
Attendance data is an important index for reflecting working time of staff, quantitative measurement research and development, quality workload and cost. Staff attendance has the characteristics of various types, complex calculation rules and the like, custom requirements of enterprises and public institutions are often required to be realized through OA systems and the like, and outsourcing attendance systems cannot be completely met. Some enterprises adopt different attendance terminals, which records need to be extracted from a database are difficult to determine, and accurate calculation is difficult, so that manual collection, manual examination and analysis by workers are required, the time consumption is long, the efficiency is low, and errors are easy to occur. These conditions not only result in continuous cost, but also cause adverse effects on daily work due to wrong attendance data calculation results.
Disclosure of Invention
The application provides an attendance data processing method and system, which are used for improving the technical problems that in the prior art, attendance data of different attendance terminals are manually collected, manually examined and analyzed by workers, the time consumption is long, the efficiency is low, and errors are easy to occur.
In view of this, a first aspect of the present application provides an attendance data processing method, including:
establishing a complete attendance record table;
configuring a trigger in a database of the external attendance system to gather card punching data of the external attendance system into the attendance recording table in real time;
acquiring attendance event data from an OA system by configuring a trigger in the OA system, and converging the attendance event data into the complete attendance record table according to employee identification and event occurrence date in the attendance event data;
and when the employee inquires the attendance result, acquiring corresponding data from the complete attendance record table according to the employee identification of the employee and calculating according to a preset calculation strategy to obtain the attendance calculation result of the employee.
Optionally, when the external attendance system and the complete attendance record table belong to the same type of database, the process of aggregating the card punching data in the external attendance system into the complete attendance record table in real time is as follows:
when a trigger of a relational database table in the external attendance system intercepts a card punch event, acquiring identity information of a card punch from the relational database table according to an identifier of the card punch through the trigger;
inquiring records of the cardholder on the corresponding date from the complete attendance record table through a trigger of the relational database table according to the card punching date and the identifier of the cardholder;
if the query result is null, adding a new record in the complete attendance record table through a trigger in the relational database table, storing the identity information of the cardholder into a corresponding identity field in the new record, and storing the current time of the cardholder into two fields of the start time and the end time of the card punching in the new record;
and if the query result is not null, storing the current card punching time of the card punch and the maximum value of the card punching end time field in the query result into the card punching end time field in the query result through a trigger in the relational database table.
Optionally, when the external attendance system and the complete attendance record table belong to different types of databases, the process of aggregating the card punching data in the external attendance system into the complete attendance record table in real time is as follows:
when a trigger of a relational database table in the external attendance system intercepts a card punch event, acquiring identity information of a card punch from the relational database table according to an identifier of the card punch through the trigger of the relational database table;
initiating HTTP or HTTPS calling through a trigger of the relational database table to send the identifier, the identity information and the card punching data of a card punch to an HTTP server, wherein the card punching data comprise card punching date and card punching time;
and writing the identity information of the cardholder and the card punching data into the complete attendance record table through the HTTP server according to the identification of the cardholder.
Optionally, the method further includes:
when new card punching data exist, inserting the identifier of the card punching person into a queue through the HTTP server, taking out the data in the queue through queue consumer service, and removing the same continuously appeared card punching records;
and inquiring the identity data of the card punch through the queue consumer service according to the identification of the card punch, and sending the identity data of the card punch to a page of display equipment for displaying, wherein the identity data comprises a name, a department and a photo path.
Optionally, the acquiring attendance event data from the OA system by configuring a trigger in the OA system, and aggregating the attendance event data into the complete attendance record table according to the employee identifier and the event occurrence date in the attendance event data includes:
configuring a trigger in an OA system, and when the trigger in the OA system acquires an approved attendance event, acquiring attendance event data corresponding to the approved attendance event from the OA system through the trigger in the OA system, wherein the attendance event data comprises leave data, field data, overtime data and/or non-card data;
inquiring corresponding records from the complete attendance record table through a trigger in the OA system according to the employee identification and the event occurrence date in the attendance data;
when the query result corresponding to the employee identifier is empty, adding a new record in the complete attendance record table through a trigger in the OA system, and writing attendance event data corresponding to the employee identifier into a corresponding field of the new record;
and when the query result corresponding to the employee identifier is not empty, writing attendance event data corresponding to the employee identifier into a corresponding field of the query result through a trigger in the OA system.
Optionally, when the employee queries the attendance result, acquiring corresponding data from the complete attendance record table according to the employee identifier of the employee, and performing calculation according to a preset calculation policy to obtain an attendance calculation result of the employee, where the attendance calculation result includes:
when the employee inquires the attendance result, inquiring the attendance data in the current month from the complete attendance record table according to the employee identification of the employee to obtain an inquiry result set;
determining whether the inquiry result set has missing attendance data according to the date, if so, generating an empty record according to the employee identification and the missing working date and adding the empty record to the inquiry result set, wherein the date comprises the date of the current inquiry day;
if the query result set does not contain the scheduling data, acquiring all the scheduling data from the scheduling data table and caching the scheduling data into a memory;
and establishing an attendance summary object in the current month, and calculating the state data and the time data of the complete attendance record in the query result set according to a preset calculation strategy to obtain the attendance calculation result of the employee in the current month.
Optionally, the calculating, according to a preset calculation policy, the state data and the time data of the complete attendance record in the query result set to obtain the attendance calculation result of the employee in the current month includes:
if the complete attendance record in the query result set is scheduling data and the attendance data are in a time-span state, setting the attendance data as the attendance time of the complete attendance record of the attendance date;
loading a working day setting, and setting the working day type of the complete attendance record according to the working day setting;
initializing the attendance summary object, and determining a calculation strategy corresponding to the complete attendance record according to the attendance type and the workday type of the complete attendance record and whether to arrange the shift or not;
calculating the attendance state and attendance time of the complete attendance record according to a calculation strategy corresponding to the complete attendance record, and storing the attendance state and the attendance time into the attendance summary object, wherein the attendance state comprises whether a working day is late, early quit, spacious working and overtime, and whether a non-working day is overtime, and the attendance time comprises working duration and working lack duration;
when the value of a vacation field in the complete attendance record is not null, calculating a vacation state and vacation time data of the complete attendance record, wherein the vacation time data comprises residual rest data and annual vacation data;
and summarizing the attendance state, the attendance time, the vacation state and the vacation time data to obtain an attendance calculation result.
Optionally, the method further includes:
acquiring characteristic parameters of the attendance time and the working time of each department, and the late arrival times, the late arrival time, the early departure times, the early departure time, the overtime times, various leave-asking times and leave-asking times of each employee according to the attendance calculation result corresponding to each employee;
judging whether the human resource input of each department needs to be increased or not according to the characteristic parameters of the commuting time and the working duration of each department;
and sending the mails to the staff with the late arrival times, the late arrival time, the early return times, the early return time, the overtime times, the overtime time, various leave-asking times and/or leave-asking time exceeding the corresponding threshold.
Optionally, the method further includes:
training a classifier through historical attendance data to obtain a classification model;
and extracting the characteristics of the new attendance data, and inputting the extracted characteristics into the classification model for identifying abnormal behaviors.
A second aspect of the present application provides an attendance data processing system, comprising:
the establishing unit is used for establishing a complete attendance record table;
the data aggregation unit is used for aggregating the card punching data of the external attendance system into the attendance recording table in real time by configuring a trigger in a database of the external attendance system, acquiring attendance event data from an OA system by configuring the trigger in the OA system, and aggregating the attendance event data into the complete attendance recording table according to the employee identification and the event occurrence date in the attendance event data;
and the computing unit is used for acquiring corresponding data from the complete attendance record table according to the employee identification of the employee and computing according to a preset computing strategy to obtain the attendance computing result of the employee when the employee queries the attendance computing result.
According to the technical scheme, the method has the following advantages:
the application provides an attendance data processing method, which comprises the following steps: establishing a complete attendance record table;
configuring a trigger in a database of the external attendance system to gather card punching data of the external attendance system into an attendance recording table in real time; acquiring attendance event data from the OA system by configuring a trigger in the OA system, and converging the attendance event data into a complete attendance record table according to employee identification and event occurrence date in the attendance event data; and when the employee inquires the attendance result, acquiring corresponding data from the complete attendance record table according to the employee identification of the employee and calculating according to a preset calculation strategy to obtain the attendance calculation result of the employee.
In the application, an independent complete attendance record table is established for gathering various attendance data from different sources, the various attendance data are gathered into the complete attendance record table in real time by configuring triggers in an external attendance system and an OA system, the manual gathering of the attendance data from various sources is avoided, the attendance data can be quickly acquired from the complete attendance record table when the attendance result calculation is carried out, the data record number is fixed, the problems that the data are gathered from various attendance terminals only when the attendance statistics is carried out and the data record number is indefinite are avoided, when an employee inquires the attendance result, the corresponding data are acquired from the complete attendance record table according to the employee identification of the employee, the attendance result of the employee is automatically calculated according to a preset calculation strategy, and the problem that in the prior art, the records which need to be extracted from a database and are difficult to be accurately calculated so as to be manually processed by the employee is solved, the technical problems of long time consumption, low efficiency and easy error are caused.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and for a person of ordinary skill in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of an attendance data processing method according to an embodiment of the present application;
fig. 2 is a schematic illustration showing a result of attendance calculation provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an attendance data processing system according to an embodiment of the present application;
fig. 4 is another schematic view of an attendance data processing system according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by the staff in the technical field, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments obtained by workers of ordinary skill in the art without creative efforts based on the embodiments in the present application belong to the protection scope of the present application.
In the prior art, after an external card swiping, fingerprint or human face attendance system is purchased and installed, special personnel are arranged every month to check attendance data of each employee of an enterprise in sequence, or a technician is arranged to develop another software to output attendance reports of all employees after primary attendance data is subjected to secondary processing. A similar flexible way is to meet daily office demands of enterprise attendance and the like by developing comprehensive enterprise services including card punching and mobile office, and realize storage and analysis of related data through technologies such as a distributed system and big data and the like on the technical scheme. The technology has the following defects: because the card swiping times of one employee per day are not fixed, and the processing of various holidays, outages, overtime, absent duty and other conditions is overlapped, the attendance record number of each person is easy to be inconsistent, the specific calculation rules of the data of different persons are not completely the same, so that the attendance record number is too large, a database needs to be repeatedly inquired in the calculation process, calculation errors easily occur, and the integration with an OA system is difficult to support the user-defined attendance requirement. The functions of developing the self attendance checking and office systems which need to be researched, developed and maintained are more, the resource investment is long, and most enterprises except special enterprise service providers cannot implement the method. Service use units often need to provide continuous service use fees or tool purchase and maintenance upgrade fees, and important customization requirements may not be met.
In the prior art, the summary and statistical analysis of attendance data are realized in a matrix processing mode by introducing the attendance data in an Excel form and then calling the MATLAB function. The disadvantages of this scheme include: the Excel application is insufficient: the real-time property cannot be guaranteed, and the attendance checking state cannot be seen immediately after the user punches the card; secondly, the data processing capacity and the capacity of the Excel are weaker than those of a relational database, and data loss or repetition can be caused by failure, file damage and the like in related links; secondly, the scheme depends heavily on commercial software MATLAB, and the application of the scheme not only can generate purchase cost, but also is difficult to customize and cannot obtain a detailed calculation scheme for fastening attendance service requirements, and the scheme comprises high-performance real-time calculation, rich display and the like for respectively processing different attendance types and a large amount of data.
The method and the device consider that the card swiping times of one person per day are different, and the card swiping times of different persons on the same day are different; vacation (the vacation type has a plurality of conditions such as a fact, a sick and a vacation, a year and a legal vacation), outwork, overtime and missed attendance may occur in attendance data of a person in one day, the time sequence is considered, the actually existing combined conditions exceed 100, the logic of specific calculation is complex, and calculation errors are easy to occur; under the condition of large attendance data volume, how to realize the challenges of efficiently calculating and detecting abnormal data which possibly occur with certain or less calculation resources; under different enterprise culture and system, the related policies and regulations for attendance checking are different, and the method supports effective management of related events according to the self-defined requirements of enterprises and public institutions and uniformly, efficiently and accurately processes attendance checking data.
In order to solve the above problem, please refer to fig. 1, an embodiment of the present application provides an attendance data processing method, including:
step 101, establishing a complete attendance record table.
In the application, an independent database table is adopted to store various attendance data of an attendance person in an unlimited number in one day, the various attendance data comprises records of unlimited number of attendance, outwork, vacation and the like, the database table is a complete attendance record table work _ complete, and a unique record can be determined by an employee identifier (which can be an employee number) and a card-punching date (namely an attendance date). And taking the complete attendance record table as a main destination of the aggregated data, and a main data source and an important intermediate point of multi-dimensional analysis of business departments, personnel and the like. The data for the table may be derived from a number of external systems, such as user swipe data, vacation, field, overtime, unpark, business trip, etc. data generated by OA-like systems. The fields of the full attendance record table may refer to table 1.
TABLE 1 complete attendance record table
Figure BDA0003679698570000071
Figure BDA0003679698570000081
In consideration of business, auxiliary tables are needed to cover various conditions which may occur in an enterprise within one attendance year and are used as the basis for the calculation and analysis of subsequent attendance data, wherein the auxiliary tables comprise an employee table, an attendance summary history table, a working date setting table, a sequencing type table and a scheduling schedule table. The employee table is used for storing employee identification (which can be employee number), name, initial annual leave, rest data and attendance type (determined by data in the attendance type table for storing the type of work, the starting time and the ending time of the type of work and used for judging whether the specific time standard of late arrival and early departure exists); the attendance summary history table stores the attendance data analysis results of employees, departments and units according to months; the working date setting table is a table used for storing which dates are specified as holidays or special attendance dates and is used for controlling specific data calculation rules of partial dates; the scheduling type table is used for storing a scheduling name, a scheduling type, and the starting time and the ending time of scheduling; the shift schedule is used to keep the dates on which employees are scheduled to be required to go to work according to which working hours.
And step 102, configuring a trigger in a database of the external attendance system to gather the card punching data of the external attendance system into an attendance recording table in real time.
The external attendance system usually uses a relational database table to store the data, and in order to realize real-time automatic convergence of the card punching data, a trigger for inserting the newly added data can be established aiming at the relational database table for storing the card punching time of each external attendance system. When a record is newly added to the relational database table due to the fact that someone punches a card, the trigger can automatically intercept the card punching event, the trigger can inquire data such as staff names and departments from a database of an external attendance system through correlation among tables according to the identification (namely staff numbers) of the current card punch, and then the data are written into a complete attendance record table together with the instant card punching time. Through the complete attendance record table, no matter how many times a person punches the card in one day, the trigger can be combined with historical card swiping data and latest card swiping data of the same day to be gathered into one line of record in the complete attendance record table. When the external attendance system and the complete attendance record table belong to the same type of database, the process that the card punching data in the external attendance system are gathered into the complete attendance record table in real time is as follows:
a1, when a trigger of a relational database table in an external attendance system intercepts a card punch event, acquiring identity information of a card punch from the relational database table according to the identifier of the card punch through the trigger, wherein the identity information comprises a name, a belonging department and the like;
a2, inquiring records of a cardholder on a corresponding date from a complete attendance record table through a trigger of a relational database table according to the card punching date and the identifier of the cardholder;
a3, if the query result is null, adding a new record in the complete attendance record table through a trigger in the relational database table, storing the identity information of the cardholder into a corresponding identity field in the added record, and storing the current time of the cardholder into two fields of the time for starting and ending the card punching in the added record;
and A4, if the query result is not null, storing the current card punching time of the card punch and the maximum value of the card punching end time field in the query result into the card punching end time field in the query result through a trigger in the relational database table.
The trigger calculates an indefinite number of card punching data in one day into two data of the start time and the end time of card punching in the work _ completion table, which is beneficial to reducing data capacity, reducing computing resource occupation and time consumption, and simplifying the analysis and calculation process of attendance data of departments and personnel in the unit of month and year. If the external attendance system supports calling an external notification interface, the corresponding records in the work _ completion table are still determined according to the card punching date and the employee number after the notification is received, and then the data of the two fields are updated according to the same logic of the updating card punching start time and the updating card punching end time.
When data needs to be gathered from different types of databases, for example, the databases used by the card punches used in different office locations are respectively SQL Server and Oracle, in this case, triggers of the respective databases can be used to respond to the card punching events of users in real time, and a trigger for a newly added event needs to be established for a database table storing the card punching data in each type of data, so that data such as real-time card punches and card punching time can be conveniently monitored and acquired. When the external attendance system and the complete attendance record table belong to different types of databases, the process that the card punching data of the external attendance system are gathered into the complete attendance record table in real time is as follows:
b1, when a trigger of a relational database table in the external attendance system intercepts a card punch event, acquiring identity information of a card punch from the relational database table according to the identifier of the card punch through the trigger of the relational database table;
b2, initiating HTTP or HTTPS call through a trigger of the relational database table to send the identifier, the identity information and the card punching data of the card punch to an HTTP server, wherein the card punching data comprise card punching date and card punching time;
b3, converging the identity information and the card punching data of the card punching person into a complete attendance record table through the HTTP server according to the identification of the card punching person. Specifically, the HTTP server inquires the record of the cardholder on the corresponding date from the complete attendance record table according to the card punching date and the identifier of the cardholder; if the query result is null, adding a new record in the complete attendance record table, storing the identity information of the cardholder in a corresponding identity field in the new record, and storing the current time of the cardholder in two fields of the time for starting and ending the card punching in the new record; and if the query result is not null, storing the current card punching time of the card punch and the maximum value of the values of the card punching end time fields in the query result into the card punching end time fields in the query result.
Further, in the embodiment of the application, the new card punching data can be displayed in a screen projection mode in real time. When new card punching data exist, inserting the identifier of a card punching person into a queue through an HTTP server, taking out the data in the queue through queue consumer service, and removing the same continuously appeared card punching records; and inquiring the identity data of the card punch through the queue consumer service according to the identification of the card punch, and sending the identity data of the card punch to a page of display equipment for displaying, wherein the identity data comprises names, departments and photo paths.
The browser of each display device is connected with and kept in the WebSocket of the HTTP server, retries regularly after the connection is disconnected, and sends an alarm to operation and maintenance personnel when the connection is failed; initiating HTTP call in a trigger from a card punching machine system to synchronous data of a complete attendance record table, submitting the serial number of a card punching employee to an HTTP server, analyzing response, and if any problem exists, storing the analyzed error information into a log table; the HTTP server puts the information into a queue after receiving the request, and then queue consumer service sequentially dequeues the queue data to display corresponding employee information; the consumer service of the queue data takes out the data in the queue and then removes the continuously appeared card punching records of the same person; the queue consumer service queries data such as name, department, photo path and the like of the cardholder according to the serial number of the cardholder, and then sends the data to a page of the display device through WebSocket. If data are abnormal or people come in and go out temporarily, detailed card punching data can be stored for query; the display page is refreshed after receiving the data of the card punch notified by the server, the information, department, type (such as whether the card punch is a visitor) and photos of the card punch are displayed on the page, and the photos of the card punch can be converted into base64 codes, compressed and sent to a browser through WebSocket or sent to the browser through a photo address, and then displayed through JavaScript asynchronous loading. When attendance data are collected from an external attendance machine, when a person swipes a card, the data such as pictures and names of corresponding persons can be displayed on a display screen in real time.
In order to deal with quick repeated card punching, the latest card punching information can be controlled to be displayed on the page for the shortest time length (adjustable). In addition, multiple display devices may be arranged to consume queue data or each punch terminal may be assigned a dedicated queue to display punch data for different people.
And 103, acquiring attendance event data from the OA system by configuring a trigger in the OA system, and converging the attendance event data into a complete attendance record table according to the employee identification and the event occurrence date in the attendance event data.
Configuring a trigger in the OA system, and when the trigger in the OA system acquires an approved attendance event, acquiring attendance event data corresponding to the approved attendance event from the OA system through the trigger in the OA system, wherein the attendance event data comprises leave data, field data, overtime data and/or non-card data; inquiring corresponding records from a complete attendance record table through a trigger in an OA system according to employee identification and event occurrence date in attendance data; when the query result corresponding to the employee identifier is empty, adding a new record in the complete attendance record table through a trigger in the OA system, and writing attendance event data corresponding to the employee identifier into a corresponding field of the newly added record; and when the query result corresponding to the employee identifier is not empty, writing attendance event data corresponding to the employee identifier into a corresponding field of the query result through a trigger in the OA system.
All events related to attendance checking, such as outwork, overtime, missed card printing, business trips, various vacations and even emergencies caused by epidemic situation isolation can be effectively managed by utilizing the custom flow on the OA system and the like in combination with reality. When the related processes of the systems are approved, the database tables for storing the data (which tables are specifically used and which fields are involved can be analyzed by using historical process data) can be scanned by a timing task to realize the aggregation of all attendance event data according to the design of the complete attendance record table, so that approved and generated records such as leave requests, outworkers, overtime, non-card-punching and the like can be firstly inquired from the related tables, and then the records are written into corresponding fields of the records in the table determined according to the employee numbers and the actual occurrence dates of the process application events according to the corresponding employee numbers, the start and end times of each day of the event occurrence and the design of the work day _ completion table. If an event spans days, for example, an employee vacates for 3 days, directly taking vacation start time as the start time of a vacation record of a first day, taking vacation end time as daily off-duty time, directly setting vacation start and end time as daily on-duty time on a second day, taking vacation start time of a third day as daily on-duty time, taking vacation end time as vacation end time obtained from an OA system, and uniquely determining a record in a workday _ completion table by combining employee number and date, and synchronously recording the vacation type corresponding to 3 days. If the records required in the work _ completion table do not exist during data writing, a new record is automatically generated, attendance event data acquired from an OA system is filled into fields corresponding to vacation, field attendance, overtime and missed card checking events according to the design of the work _ completion table, and then the new record is written into the work _ completion table.
Other implementation schemes can be adopted, specifically, if a database of the OA system can be logged in and operated, the table in which each process data is specifically stored can be determined according to the corresponding relationship of the change of the process data on the data change in each table, then, a trigger for updating an update event can be adopted for the table in which the process approval result of the OA system is stored in the convergence implementation, after the state of the OA process is checked to be formally approved in the trigger, the trigger is firstly used for acquiring data submitted by the process from the relevant table through an SQL statement, and then, data of corresponding fields of leave-on, outwork, overtime and missed card printing events are written into the workday _ completion table and stored. When the user formally approves the related flow on the OA, the update event trigger is automatically triggered, so that the data of the events of vacation, outwork, overtime and missed card printing are automatically written into corresponding fields in records of corresponding employees and dates in the workday _ completion table; if the OA system provides an interface for externally inquiring the related process state and applying for data or the OA system can call back the change of the external interface to notify the process state and the related data, the interfaces can also be used for obtaining and storing data of corresponding fields of leave-on, outwork, overtime and missed card-checking events in the workday _ completion table, and the specific logic is the same as that when the data is processed by the trigger.
All the database operations executed by the trigger can record failure logs through another table, and then the special checking and analyzing service processes the logs recorded at regular time and supplements and processes data failed due to server or network failure and the like, so as to prevent the problem of data loss caused by abnormal data acquisition and processing caused by IT resources or system failure.
And 104, when the staff inquires the attendance result, acquiring corresponding data from the complete attendance record table according to the staff identification of the staff, and calculating according to a preset calculation strategy to obtain the attendance calculation result of the staff.
When the employee inquires the attendance result, inquiring the attendance data in the current month from the complete attendance record table according to the employee identification of the employee to obtain an inquiry result set; determining whether missing attendance data exist in the query result set or not according to the date, if so, generating an empty record according to the employee identification and the missing working date and adding the empty record to the query result set, wherein the date comprises the date of the current day of query; if no scheduling data exist in the query result set, acquiring all scheduling data from the scheduling data table and caching the scheduling data into a memory; and establishing an attendance summary object in the current month, calculating the state data and time data of the complete attendance record in the query result set according to a preset calculation strategy to obtain an attendance calculation result of the employee in the current month, returning the attendance calculation result to a front-end page for displaying, wherein the display result can refer to fig. 2 specifically. The employee can rapidly check whether the attendance is normal or not every day in the current month and possible data such as vacation, field attendance, remaining vacation and the like through a webpage at one time.
Specifically, on the basis of the design of the database, corresponding calculation strategies are respectively established for each use scene and different attendance types of attendance data, then a calculation rule strategy component and a context component of each attendance type are dynamically loaded on the basis of a memory face to each attendance type, then attendance behaviors such as late arrival, early departure, absenteeism, vacation and the like are packaged into a state of a complete attendance record object, a unified calculation scheme is provided, and then multi-level cache is combined to realize high-performance real-time accurate calculation and output of calculation results in each attendance service scene, and the online loading of a new calculation strategy through technologies such as reflection and the like is supported to adapt to new service requirements.
Respectively defining a calculation method for attendance states (whether to have spaciousness, late arrival, early departure and overtime) and working time (total time of working and overtime) through an interface, and naming the interface as WorktimeCommputing;
and respectively providing an implementation class of the interface for each attendance type (including scheduling, fixed attendance, flexible attendance and the like), and specifically calculating attendance data of all employees in the type according to the attendance time and the attendance rule specified by each attendance type. The AbstractComputingStrategy is used as a base class of each strategy class and encapsulates common attributes and methods;
the WorktimeComputingContext is used as a context component, and a corresponding calculation strategy component object is set in an initilize () method according to the attendance type of the employee corresponding to the attendance data, so that the classification self-adaptive calculation of all data is realized. During specific calculation, a certain amount of coroutines or threads are automatically started according to the data volume requirement, and final results are combined after calculation. Data such as employee names and numbers, attendance types, scheduling and related work-on and work-off time, reusable calculation results and the like are stored through a memory and an external cache, and repeated calculation is avoided;
and designing components related to processing of user operation requests according to the MVC mode, wherein the requests including front-end pages are processed through a WorkdayCompletionController, and the class calls a WorkdayCompletionservice to call a WorkdimeCompuingContext initialization data calculation strategy component object according to user attributes and calculate to obtain a calculation result. The WorkdayCompletionhelper encapsulates operations such as caching, configuration, scheduling, business trip to other places, monthly data filling, calculation and the like, and then is called by WorkdayCompletionservice;
the WorkdayCompletion is an entity class corresponding to a complete attendance record table, and attributes (including last time of card punching before working in the afternoon, first time of card punching after working in the office, duration of various holidays in one day, late duration, early retreat duration, work absence duration, working type and lactation duration) and operations (the working time and the working time are determined according to the time of card punching and the approved missed card punching application time, the vacation duration is calculated, the attendance state of a WorkdayCompletion example is adjusted according to the lactation duration and whether the work is filed or not, the attendance state analysis, the abnormal condition detection and the like) are added for the convenience of calculation.
When the staff logs in and inquires the attendance result of the staff, a WorkdayCompletioncontroller acquires the staff number, then calls a WorkdayCompletionhelper to specifically calculate and acquire a final result, and firstly calls WorkdayCompletionservice to inquire a data set of the current attendance cycle (one month) from a database; if the data of the current day cannot be inquired, generating a piece of empty data according to the employee number, name, department and working date, inserting the empty data into a complete attendance record table, and then putting the generated data into an attendance data set (namely an inquiry result set); if the current staff is the scheduling staff and no scheduling data exists in the cache, caching all the scheduling data into a memory; comparing whether the number of days of the system date in the current month is larger than the record number of the current query result set, if so, checking which date data are lacked, automatically generating all WorkdayCompletion objects with the missing dates, setting employee numbers, names, departments and working dates, setting all attendance data attributes to be null, adding newly generated objects into the query result set, and sorting the newly generated objects in an ascending order according to the working dates; calling WorkdayCompletionservice to process the current-month attendance data set, establishing and storing objects for collecting late arrival, early departure, absenteeism and outwork in each month, and setting employee names, serial numbers and department names; and circularly calculating each WorkdayCompletion object (attendance data gathered every day) in the current-month data set to obtain summary of late-arrival, early-departure, absence of work, outwork, vacation conditions and the like in the current month and attendance state data every day. Before starting to calculate, all time is converted into corresponding millisecond values, a double type is adopted in the calculating process, no less than 3 bits are reserved after decimal points, and the final result needs to be rounded up in combination with UI display; the object with the vacation field not empty in the attendance data set in the current month indicates that the corresponding employee has vacation, the data are respectively calculated and summarized, the state of the corresponding complete attendance record object is set, for example, the vacation half-day, and the rest data and the annual vacation data are further calculated; and rendering the final result to a front-end page, and displaying the whole attendance analysis result in the current month and the normal attendance or abnormal attendance every day.
Further, the detailed step of circularly calculating each WorkdayCompletion object in the data set of the current month to obtain the summary of the late arrival, early departure, absence, outwork and vacation conditions of the current month and the attendance status data of each day comprises the following steps:
1) if the WorkdayCompletion object is scheduling data and the work attendance data spans the day, setting the work attendance data as the work attendance time of the WorkdayCompletion object on the work attendance date;
2) loading working day setting, checking whether the date of the working day setting, including national legal holidays, weekend working, holidays from Monday to Friday, and the like, is the same as the date of a Workday completion object, if so, using the working day type set by the system, and defaulting Saturday and Sunday as non-working days;
3) according to the attendance type and the working day type of the WorkdayCompletion object being processed and whether the work is scheduled or not, calling a WorktimeComputingContext object to initialize and setting an attendance data calculation strategy object to be used;
4) and calling the initialized WorkTimeComputingContext object, calling the selected calculation strategy object to sequentially calculate the state of the WorkdayCompletion data (whether the working day is late, early, absent, working, overtime, or overtime on a non-working day), the working time length and the working lack time length, and storing the working time length and the working lack time length in the memory. The two operations can also be executed according to business needs, for example, when only the working duration needs to be calculated, the method for calculating the working state may not be called.
When the calculation is specifically carried out according to the selected calculation strategy, the working day types are firstly processed: only processing overtime data on non-working days, and calculating special working days according to corresponding rules, such as only calculating vacation and overtime conditions; in processing the data of the working day, the possible 8 data of the time of punching the card, the time of missing the card, the time of outwork and the time of vacation (2 data each) are constructed into an array and sorted in ascending order, then the non-null data is circularly processed from the first element, and the circulation exits after the first non-null data is processed. The value of the blank data in the cycle is firstly assigned to be-1, the condition that only one piece of attendance data exists in one day can be found out by judging whether the first non-blank element is the last element of the array, and if the data are all blank, the work is done in the absence of the day. If a plurality of attendance data can take a minimum value (first non-empty data) and a maximum value (last element) as attendance starting and ending data of the current day, then the data are respectively compared with early, late and noon and afternoon hours specified by corresponding attendance types, for example, the minimum attendance time is earlier than the morning and afternoon hours, then the late attendance is judged, if the late is the afternoon and afternoon hours, the current day is not on duty but is on duty in the evening, and whether the late, early and absenteeism phenomena and related time lengths exist can be determined.
5) And storing the obtained attendance state, total working time and lack time data into a WorkdayCompletion object.
In the process, the WorkdayCompletion object is always transmitted in the memory, the attribute and state data of the WorkdayCompletion object are updated along with the execution of the calculation process, and the WorkdayCompletion object is loaded from the database only once. In the calculation end stage, after caching, the WorkdayCompletion object and the personal one-month attendance summary object need to be calculated again for subsequent analysis departments, all personnel one month and one year attendance data to use. When a new attendance event related to the cache data is detected according to the employee number and the attendance date, preferentially extracting a corresponding object from the cache and modifying the data corresponding to the new attendance event, then recalculating the attendance state and duration and then caching so as to keep the cache data consistent with the actual data. When a large amount of data needs to be calculated, by utilizing the service characteristic that only the latest attendance data can change, only the complete attendance record within a certain time period (for example, 1 day to 1 week, so as to avoid frequent cache updating) from the current moment is calculated, and then the cache data is combined to obtain the final calculation result, so that the calculation performance and the service stability are improved.
The calculation process of the data of one person in one month is similar to most steps, the main difference is to calculate the data of more persons and the data and the state of the data are not required to be displayed on a UI (user interface), so that the scheme can be hierarchically reused, and other parts cannot be influenced when a new strategy is expanded to support a new attendance type or an existing strategy is modified to deal with the change of the attendance rule.
The calculation of the annual data can be processed similarly, but in order to reduce the calculation time consumption caused by the large increase of the data volume, the calculation results of all data in each month before a certain time (for example, 2 months) can be stored in a historical table according to the business requirements, when the annual attendance data is actually calculated, only the data in each month left in the current year is calculated, and then the annual result is calculated according to the result in each month. If the final result is influenced by the change of the original attendance data, the work dayCompletionservice is called to recalculate the attendance result of the corresponding month, and then the annual data is recalculated.
In the embodiment of the application, an independent complete attendance record table is established for gathering various attendance data from different sources, the various attendance data are gathered into the complete attendance record table in real time by configuring triggers in an external attendance system and an OA system, the attendance data from various sources are avoided being manually gathered, the attendance data can be quickly acquired from the complete attendance record table when the attendance result calculation is carried out, the data record number is fixed, the problems that the data are gathered from various attendance terminals only when the attendance statistics is carried out and the data record number is indefinite are avoided, when an employee inquires the attendance result, the corresponding data are acquired from the complete attendance record table according to the employee identification of the employee, the attendance result of the employee is automatically calculated according to a preset calculation strategy, and the problem that in the prior art, which records need to be extracted from a database and are difficult to be accurately calculated so as to be manually processed by the employee is solved, the technical problems of long time consumption, low efficiency and easy error are caused.
Further, abnormal data analysis can be further performed in the embodiment of the application. Acquiring characteristic parameters of the attendance time and the working time of each department, the late arrival times, the late arrival time, the early departure times, the early departure time, the overtime, the various leave-on times and the leave-on time of each employee according to the attendance calculation result corresponding to each employee, wherein the characteristic parameters comprise median values, average values, median values, standard differences, minimum values, maximum values of the attendance time and the working time, and sorted 80% and 90% numerical values (which proportion is selected to allow adjustment); judging whether human resource input of each department needs to be increased or not according to characteristic parameters of the on-duty time and the working time of each department, wherein the minimum, the maximum and the average values of the data of the working time of each department are large, and when the variance is small, the attendance data can be used as a basis for increasing the related human resource input, otherwise, compared with the situation that the human resource needs to be increased, the work efficiency is possibly improved; and sending the mails to the staff with the late arrival times, the late arrival time, the early return times, the early return time, the overtime times, the overtime time, various leave-asking times and/or leave-asking time exceeding the corresponding threshold.
In the field where the entrance and exit are controlled by devices such as a gate and the like, whether the employee enters the work field after the employee is checked can be identified by means of a card checking terminal (namely, which terminal the employee checks the card on) for controlling the entrance and exit, and the total time of the employee in the work field in one day and the number of the persons who do not really enter the work field after the employee is checked every day and the total time can be further calculated. The daily attendance summary record can further reflect the working time efficiency of the card punch by integrating and evaluating the data of the daily working amount (such as the code line number submitted to SVN and Git, the finished requirement number, the number of returned or sent mails and the like of technicians) and the quality (such as the defect number found in the submission result, which can be automatically acquired and stored by other systems of enterprises through secondary development). The data reflecting the actual work of the attendance personnel can be used as an important fact basis when the attendance personnel miss the card punching, and can be displayed on a process page where the system such as an OA system applies for forgetting punching the card through an open interface, and even the last working time of the attendance personnel recorded by other systems can be used as the off-duty time of the missed card punching date by default.
All attendance personnel can be classified in detail according to historical attendance data through a random forest classifier, and the trained model can be used for carrying out automatic classification, identification and prediction on new attendance data. Specifically, firstly, attendance personnel are manually classified according to historical data of a certain time period, then classifiers such as random forests are trained to obtain a classification model, then the classification of actual attendance data is judged by using the trained classification model, late arrival, early departure, overtime and partial vacation behaviors are focused, the behaviors which accord with the predicted abnormal behaviors and obviously do not accord with the predicted behaviors are kept concerned, on one hand, the abnormal behaviors are determined to be the problems of the model and can be optimized by adjusting parameters such as selected characteristic values and the number of the classifiers, and the prediction result can play a role in narrowing the range and early warning for possible working abnormity. The characteristic values that can be selected include duty cycle, number of working days, average working time, number of late arrival times, total late arrival time, average late arrival time, late arrival duty ratio, number of early exits, total early exit time, average early exit time, early exit duty ratio, number of outing times, total outing time, average outing time, duty ratio of outing, time of a false, number of false, and ratio of false. Under the condition that the amount of late arrival, early exit, outwork and accident data is seriously unbalanced compared with the overall data, a small proportion of event data can be given a larger cost, for example, the longer the late arrival time or the early exit time is, the larger the cost weight is, so that the robustness of the trained model is improved.
The characteristics of related software technologies of the attendance terminals are utilized, automatic convergence of data of different attendance terminal manufacturers is realized, high-performance calculation and query of attendance data of thousands of people and smaller medium and small enterprises in one month can be realized through a common PC, data of larger-scale enterprises can be processed in a self-adaptive manner, and integration with an external system and automatic detection and processing of abnormal attendance conditions are supported.
Aiming at attendance systems and terminals thereof of different manufacturers, the embodiment of the application establishes real-time automatic convergence service of card punching data of different attendance terminals by using a database trigger and a special interface, and converges any number of card punching records of any person every day and all possible attendance events such as vacation and the like into one record in one table in the database; the system provides real-time service of attendance data, is used for calculating whether the attendance data of all people are abnormal or not and directly prompting when the attendance data have problems, further provides a historical calculation function of the attendance data, and is used for quickly calculating the attendance data of individuals, departments and enterprises for one year; the management of attendance related events such as outwork, vacation, business trips and the like is customized according to the actual needs of enterprises and public institutions through enterprise services such as OA and the like, and formal final result data of the related events are combined by adopting a unified model, so that comprehensive aggregation and accurate calculation of all data related to attendance in a broad sense are realized. All attendance data of a department and an enterprise can be checked by attendance personnel in each month and each year, and a system automatically detects possible abnormal data and prompts the possible abnormal data; when applying for and approving the vacation on the OA system and the like, the total vacation and the remaining vacation data of the related personnel are correspondingly displayed.
The above is an attendance data processing method provided by the present application, and the following is an attendance data processing system provided by the present application.
Referring to fig. 3, an attendance data processing system in an embodiment of the present application includes:
the establishing unit is used for establishing a complete attendance record table;
the data aggregation unit is used for aggregating the card punching data of the external attendance system into an attendance recording table in real time by configuring a trigger in a database of the external attendance system, acquiring attendance event data from the OA system by configuring the trigger in the OA system, and aggregating the attendance event data into a complete attendance recording table according to the employee identification and the event occurrence date in the attendance event data;
and the computing unit is used for acquiring corresponding data from the complete attendance record table according to the employee identification of the employee and computing the data to obtain the attendance computing result of the employee when the employee queries the attendance result.
The data aggregation unit can collect and store data of external attendance checking systems, OA systems and the like in a mode of an interface, a trigger and a timing task which are open to the outside, open real-time query of summary results of attendance data of vacation systems and the like to the OA systems, and provide data cache service and monitoring service for the running conditions of the external attendance checking systems.
Two approaches are provided for synchronizing the process data of the OA system, including synchronizing the process approval data through a trigger of an OA system database, or synchronizing approved vacation, outwork and overtime data to a complete attendance record table through a timing task developed by Java, Go and other languages.
The attendance data processing system also provides attendance service management functions, including management functions of enterprise, employee, workday, work type, scheduling related data, system settings and the like, and the adjustment of the data by the user can be cached during use and preferentially adopts memory-based caching.
The attendance data processing system also supports the notification of the discovered abnormal data and important analysis results to related people through mails by calculating and analyzing the attendance data, including monthly attendance data analysis and annual data analysis of all employees of staff, departments and units, and special topic analysis of late arrival, early departure, absenteeism, field attendance and vacation conditions with reference to fig. 4. Aiming at the specific and calculation requirements of business requirements, the cache is divided into three levels, namely local cache based on local memory and supporting persistence and distributed centralized cache, and a cache strategy can be switched automatically without stopping according to the total number of employees. By combining with the memory configuration of the server, if all attendance personnel are hundreds or less, the cache supporting the concurrency safety can be realized completely based on the memory; if the attendance number is more, the database can be further prevented from being repeatedly accessed and calculated by combining serialization, local hard disk or shared storage persistence; if the number of people checking on the attendance reaches tens of thousands or more, the problem of insufficient memory of a single server needs to be solved by utilizing distributed centralized cache.
The attendance data processing system also supports outputting of remaining vacation (annual vacation, rest-on-duty and the like) and vacated data on external system pages such as OA and the like, and comprises the steps of obtaining various types of vacation, outdoor attendance and overtime data which are already applied and completed by the employee in the current year and in the current month through an open interface of JavaScript calling attendance service on an OA process application and approval page, then rendering the data to a proper position of the process page through JavaScript and CSS for inspection when the process is applied and approved, and avoiding the operation of manually punching and inquiring the attendance page again. The working hours calculated by the attendance personnel can be output, the efficiency of the working time can be quantitatively evaluated by combining the working capacity and the working quality data, such as the working capacity finished by each working hour, the quantity of the existing problems, the working hours required by different requirements and projects and the like, the comparative analysis of different attendance personnel and different works can be supported, and the acquisition and storage service of related data can be provided.
The attendance processing system is simple to develop, can be conveniently expanded and adjusted to support different attendance types, calculation rules and possible changes of enterprises and public institutions, also supports a customized multistep flow integrating external OA and other systems to realize custom management of attendance related events, and is beneficial to enterprises to rapidly develop custom employee attendance data gathering, calculating and analyzing tools for attendance, OA and other systems of different manufacturers on the market; the system can run stably with high performance under the configuration of a common PC, and the total time consumption for real-time query and display of all attendance data of one employee in one month can be controlled within 0.2 second and the accuracy is higher through the calculation based on the memory and the support of the cache; the system has low cost, can reuse the investment of the original attendance terminal system, can automatically run for a long time without people after being developed and online, and can effectively control the related cost by assistance.
In the prior art, the attendance data are extracted from the database for calculation only when the attendance statistics is carried out, so that the data cannot be obtained in time, the data cannot be quickly found when the data is short, and the data are required to be manually processed, so that errors are easy to occur. According to the method and the device, a complete attendance record table is established, the card punching data in an external attendance system and the attendance event data in an OA system are gathered into the complete attendance record table in real time through a trigger, any employee card punching data of any number of times every day and possible attendance events such as vacation and the like can be gathered into one record in the complete attendance record table in real time, attendance statistics is carried out subsequently, the attendance data of corresponding dates can be rapidly inquired through employee identification and dates, whether data are lacked or not can be rapidly inquired, data from various sources are gathered through the complete attendance record table, the attendance data are organized and processed during gathering, calculation can be simplified during subsequent calculation, and accuracy is high.
In the embodiment of the application, an independent complete attendance record table is established for gathering various attendance data from different sources, triggers are configured in an external attendance system, different databases and an OA system to gather the various attendance data into the complete attendance record table in real time through the triggers, so that the attendance data from various sources are prevented from being manually gathered, the attendance data can be quickly acquired from the complete attendance record table when the attendance result calculation is carried out, the data gathering from various attendance terminals is avoided when the attendance statistics is carried out, when an employee inquires the attendance result, corresponding data is acquired from the complete attendance record table according to the employee identification of the employee, the attendance result of the employee is automatically calculated according to a preset calculation strategy, and the problems that the data of different attendance terminals in the prior art are difficult to be quickly inquired and calculated from the databases and the attendance result of the employee needs to be manually gathered by the employee, The manual examination and analysis have the technical problems of long time consumption, low efficiency and easy occurrence of calculation errors.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for executing all or part of the steps of the method described in the embodiments of the present application through a computer device (which may be a personal computer, a server, or a network device). And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be appreciated by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. An attendance data processing method is characterized by comprising the following steps:
establishing a complete attendance record table;
configuring a trigger in a database of the external attendance system to gather card punching data of the external attendance system into the attendance recording table in real time;
acquiring attendance event data from an OA system by configuring a trigger in the OA system, and converging the attendance event data into the complete attendance record table according to employee identification and event occurrence date in the attendance event data;
and when the employee inquires the attendance result, acquiring corresponding data from the complete attendance record table according to the employee identification of the employee and calculating according to a preset calculation strategy to obtain the attendance calculation result of the employee.
2. The attendance data processing method according to claim 1, wherein when the external attendance system and the full attendance record table belong to the same type of database, the process of aggregating the card punching data in the external attendance system into the full attendance record table in real time is as follows:
when a trigger of a relational database table in the external attendance system intercepts a card punch event, acquiring identity information of a card punch from the relational database table according to an identifier of the card punch through the trigger;
inquiring records of the cardholder on the corresponding date from the complete attendance record table through a trigger of the relational database table according to the card punching date and the identifier of the cardholder;
if the query result is empty, adding a new record in the complete attendance record table through a trigger in the relational database table, storing the identity information of the card punch into a corresponding identity field in the added record, and storing the current card punching time of the card punch into two fields of the card punching starting time and the card punching finishing time in the added record;
and if the query result is not null, storing the current card punching time of the card punch and the maximum value of the card punching end time field in the query result into the card punching end time field in the query result through a trigger in the relational database table.
3. The attendance data processing method according to claim 1, wherein when the external attendance system and the full attendance record table belong to different types of databases, the process of aggregating the card punching data in the external attendance system into the full attendance record table in real time is as follows:
when a trigger of a relational database table in the external attendance system intercepts a card punch event, acquiring identity information of a card punch from the relational database table according to an identifier of the card punch through the trigger of the relational database table;
initiating HTTP or HTTPS calling through a trigger of the relational database table to send the identifier, the identity information and the card punching data of a card punch to an HTTP server, wherein the card punching data comprise card punching date and card punching time;
and writing the identity information of the cardholder and the card punching data into the complete attendance record table through the HTTP server according to the identification of the cardholder.
4. The attendance data processing method according to claim 3, wherein the method further comprises:
when new card punching data exist, inserting the identifier of the card punching person into a queue through the HTTP server, taking out the data in the queue through queue consumer service, and removing the same continuously appeared card punching records;
and inquiring the identity data of the card punch through the queue consumer service according to the identification of the card punch, and sending the identity data of the card punch to a page of display equipment for displaying, wherein the identity data comprises a name, a department and a photo path.
5. The attendance data processing method according to claim 1, wherein the acquiring attendance event data from the OA system by configuring a trigger in the OA system, and aggregating the attendance event data into the full attendance record table according to the employee identification and the event occurrence date in the attendance event data comprises:
configuring a trigger in an OA system, and when the trigger in the OA system acquires an approved attendance event, acquiring attendance event data corresponding to the approved attendance event from the OA system through the trigger in the OA system, wherein the attendance event data comprises leave data, field data, overtime data and/or non-card data;
inquiring corresponding records from the complete attendance record table through a trigger in the OA system according to the employee identification and the event occurrence date in the attendance data;
when the query result corresponding to the employee identifier is empty, adding a new record in the complete attendance record table through a trigger in the OA system, and writing attendance event data corresponding to the employee identifier into a corresponding field of the new record;
and when the query result corresponding to the employee identifier is not empty, writing attendance event data corresponding to the employee identifier into a corresponding field of the query result through a trigger in the OA system.
6. The attendance data processing method according to claim 1, wherein when the employee queries the attendance result, acquiring corresponding data from the complete attendance record table according to the employee identifier of the employee and performing calculation according to a preset calculation policy to obtain the attendance calculation result of the employee, and the method comprises the steps of:
when the employee inquires the attendance result, inquiring the attendance data in the current month from the complete attendance record table according to the employee identification of the employee to obtain an inquiry result set;
determining whether the inquiry result set has missing attendance data according to the date, if so, generating an empty record according to the employee identification and the missing working date and adding the empty record to the inquiry result set, wherein the date comprises the date of the current inquiry day;
if the query result set does not contain the scheduling data, acquiring all the scheduling data from the scheduling data table and caching the scheduling data into a memory;
and establishing an attendance summary object in the current month, and calculating the state data and the time data of the complete attendance record in the query result set according to a preset calculation strategy to obtain the attendance calculation result of the employee in the current month.
7. The attendance data processing method according to claim 6, wherein the calculating of the state data and the time data of the complete attendance record in the query result set according to a preset calculation policy to obtain the attendance calculation result of the employee in the current month comprises:
if the complete attendance record in the query result set is scheduling data and the attendance data are in a time-span state, setting the attendance data as the attendance time of the complete attendance record of the attendance date;
loading a working day setting, and setting the working day type of the complete attendance record according to the working day setting;
initializing the attendance summary object, and determining a calculation strategy corresponding to the complete attendance record according to the attendance type and the working day type of the complete attendance record and whether to arrange duty or not;
calculating the attendance state and attendance time of the complete attendance record according to a calculation strategy corresponding to the complete attendance record, and storing the attendance state and the attendance time into the attendance summary object, wherein the attendance state comprises whether a working day is late, early quit, spacious working and overtime, and whether a non-working day is overtime, and the attendance time comprises working duration and working lack duration;
when the value of a vacation field in the complete attendance record is not null, calculating a vacation state and vacation time data of the complete attendance record, wherein the vacation time data comprises residual rest data and annual vacation data;
and summarizing the attendance state, the attendance time, the vacation state and the vacation time data to obtain an attendance calculation result.
8. The attendance data processing method according to claim 1, further comprising:
acquiring characteristic parameters of the attendance time and the working time of each department, and the late arrival times, the late arrival time, the early departure times, the early departure time, the overtime times, various leave-asking times and leave-asking times of each employee according to the attendance calculation result corresponding to each employee;
judging whether the human resource input of each department needs to be increased or not according to the characteristic parameters of the working hours and the working hours of each department;
and sending the mails to the staff with the late arrival times, the late arrival time, the early return times, the early return time, the overtime times, the overtime time, various leave-asking times and/or leave-asking time exceeding the corresponding threshold.
9. The attendance data processing method according to claim 1, further comprising:
training a classifier through historical attendance data to obtain a classification model;
and extracting the characteristics of the new attendance data, and inputting the extracted characteristics into the classification model for identifying abnormal behaviors.
10. An attendance data processing system, comprising:
the establishing unit is used for establishing a complete attendance record table;
the data aggregation unit is used for aggregating the card punching data of the external attendance system into the attendance recording table in real time by configuring a trigger in a database of the external attendance system, acquiring attendance event data from an OA system by configuring the trigger in the OA system, and aggregating the attendance event data into the complete attendance recording table according to the employee identification and the event occurrence date in the attendance event data;
and the computing unit is used for acquiring corresponding data from the complete attendance record table according to the employee identification of the employee and computing according to a preset computing strategy to obtain the attendance computing result of the employee when the employee queries the attendance computing result.
CN202210630980.8A 2022-06-06 2022-06-06 Attendance data processing method and system Pending CN114862270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210630980.8A CN114862270A (en) 2022-06-06 2022-06-06 Attendance data processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210630980.8A CN114862270A (en) 2022-06-06 2022-06-06 Attendance data processing method and system

Publications (1)

Publication Number Publication Date
CN114862270A true CN114862270A (en) 2022-08-05

Family

ID=82624695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210630980.8A Pending CN114862270A (en) 2022-06-06 2022-06-06 Attendance data processing method and system

Country Status (1)

Country Link
CN (1) CN114862270A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115114666A (en) * 2022-08-25 2022-09-27 天聚地合(苏州)科技股份有限公司 Attendance data privacy calculation method and system based on block chain
CN115409467A (en) * 2022-08-08 2022-11-29 深圳市一页科技有限公司 Intelligent UHR management method and system thereof
CN116894653A (en) * 2023-08-16 2023-10-17 广州红海云计算股份有限公司 Personnel management data processing method and system based on multi-prediction model linkage
CN116957528A (en) * 2023-07-06 2023-10-27 三峡高科信息技术有限责任公司 Method and system for automatically generating attendance result for multi-source card punching data
CN117709911A (en) * 2023-12-27 2024-03-15 南京众弘信息科技有限公司 Attendance management system and attendance management method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115409467A (en) * 2022-08-08 2022-11-29 深圳市一页科技有限公司 Intelligent UHR management method and system thereof
CN115114666A (en) * 2022-08-25 2022-09-27 天聚地合(苏州)科技股份有限公司 Attendance data privacy calculation method and system based on block chain
CN115114666B (en) * 2022-08-25 2023-04-21 天聚地合(苏州)科技股份有限公司 Attendance data privacy calculation method and system based on blockchain
CN116957528A (en) * 2023-07-06 2023-10-27 三峡高科信息技术有限责任公司 Method and system for automatically generating attendance result for multi-source card punching data
CN116957528B (en) * 2023-07-06 2024-07-05 三峡高科信息技术有限责任公司 Method and system for automatically generating attendance result for multi-source card punching data
CN116894653A (en) * 2023-08-16 2023-10-17 广州红海云计算股份有限公司 Personnel management data processing method and system based on multi-prediction model linkage
CN116894653B (en) * 2023-08-16 2024-02-23 广州红海云计算股份有限公司 Personnel management data processing method and system based on multi-prediction model linkage
CN117709911A (en) * 2023-12-27 2024-03-15 南京众弘信息科技有限公司 Attendance management system and attendance management method
CN117709911B (en) * 2023-12-27 2024-05-28 南京众弘信息科技有限公司 Attendance management system and attendance management method

Similar Documents

Publication Publication Date Title
CN114862270A (en) Attendance data processing method and system
CN108537544B (en) Real-time monitoring method and monitoring system for transaction system
US8285580B2 (en) System and method for filtering exceptions generated by forecasting and replenishment engine
KR20180030521A (en) Data quality analysis
US9235608B2 (en) Database performance analysis
CN113342939B (en) Data quality monitoring method and device and related equipment
CN112396397A (en) Operation and maintenance affair collection and management system
CN109902919A (en) Server assets management method, device, equipment and readable storage medium storing program for executing
US8606762B2 (en) Data quality administration framework
CN114385663B (en) Data processing method and device
CN110781235A (en) Big data based purchase data processing method and device, terminal and storage medium
CN114090634A (en) Hotel data management method and device based on data warehouse
US20130041712A1 (en) Emerging risk identification process and tool
CN116227840A (en) Intelligent scheduling method, device and medium
CN115271514A (en) Communication enterprise monitoring method and device, electronic equipment and storage medium
CN115034742A (en) Attendance checking method and system
JP2001250022A (en) Device and method for supporting business activity, and recording medium
CN112184173A (en) Data processing method and device and electronic equipment
CN112215560A (en) Intelligent shift arrangement system and implementation method thereof
JP2014067263A (en) Customer attribute-base clerical work counting method and system
CN114331653A (en) Processing method and device for to-and-fro ledger data
CN112561368B (en) Visual performance calculation method and device for OA approval system
JP2003196474A (en) Credit management system, credit management method and program for it
Donatus et al. Statistical Analysis of the Queuing System at the Opd in Bolgatanga Regional Hospital
CN112488860A (en) Method and system for processing waybill

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