Attendance check analysis method and device, storage medium and computer equipment

By establishing a one-dimensional attendance matrix in seconds and priority rule labeling, the problems of efficiency and flexibility of existing attendance calculation methods are solved, and efficient and accurate attendance analysis is achieved.

CN119850163APending Publication Date: 2025-04-18ZKTECO CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510023397.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing attendance calculation methods are not efficient and flexible enough, especially when dealing with complex time intervals, the calculation volume is huge and it is difficult to adapt to the needs of enterprise scale expansion and changes in attendance rules.

Method used

By establishing a daily one-dimensional matrix in seconds, the actual attendance time period is determined based on the employee's punch-in records and attendance rules, and the attendance type in the overlapping time period is marked through the priority rules, and the matrix elements are marked to count the attendance results.

Benefits of technology

It improves the efficiency of attendance data calculation, avoids complex period intersection and union operations, enhances the adaptability to complex attendance rules, ensures the logic and consistency of attendance results, and provides efficient, flexible and accurate attendance analysis methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850163A_ABST
    Figure CN119850163A_ABST
Patent Text Reader

Abstract

The invention discloses an attendance analysis method and device, a storage medium and computer equipment. The attendance checking method provided by the invention comprises the following steps: establishing a daily one-dimensional matrix for employees by taking seconds as a unit; in each day, according to the clock-in records of the employees on the same day, the specified working time period and the specified rest time period on the same day are determined, the actual attendance time period of the employees on the same day is determined, and the actual attendance time period at least comprises the actual working time period and the actual rest time period; determining a plurality of overlapping time periods based on the actual attendance time period, the specified working time period and the specified rest time period; determining the priority of each attendance type in each overlapping time period, determining the identifier of each attendance type in each overlapping time period, and performing matrix element labeling in the one-dimensional matrix of the employee on the same day according to the identifier corresponding to the attendance type with the highest priority in each overlapping time period; and counting the number of identifiers of each attendance checking type in the daily one-dimensional matrix of the employee to obtain an attendance checking result of the employee. Therefore, the flexibility of the attendance checking method can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an attendance analysis method, device, storage medium and computer equipment. Background Art

[0002] In modern enterprise management, accurate calculation of employee attendance is the basis for ensuring smooth operation of the company. Traditional attendance analysis methods are usually based on fixed working hours, adding and subtracting employee punch-in, leave, overtime, outing and rest periods from working hours to obtain employees' actual working hours and other data, such as lateness and early departure.

[0003] However, as the scale of enterprises expands, traditional attendance analysis methods have exposed a series of problems. First, the attendance data of each employee needs to be calculated separately, especially when dealing with complex time period intersections and unions, the amount of calculation is huge. Secondly, with the changes in attendance rules and the growth of business needs, the original attendance calculation logic has become more and more complicated. Therefore, the existing attendance calculation method is not efficient and flexible enough in the face of increasingly complex enterprise needs. Summary of the invention

[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect that the existing attendance calculation method is not efficient and flexible enough.

[0005] In a first aspect, the present application provides an attendance analysis method, the method comprising:

[0006] Establish a daily one-dimensional matrix for employees in seconds;

[0007] Every day, according to the employee's punch-in record of the day, determine the prescribed working time period and the prescribed rest time period of the day, and determine the employee's actual attendance time period of the day. The actual attendance time period at least includes the actual working time period and the actual rest time period;

[0008] Determine multiple overlapping time periods based on actual attendance time periods, prescribed working time periods, and prescribed rest time periods;

[0009] Determine the priority of each attendance type in each overlapping time period, and determine the identifier of each attendance type in each overlapping time period, and mark the matrix elements in the one-dimensional matrix of the employee on the day according to the identifier corresponding to the attendance type with the highest priority in each overlapping time period;

[0010] Count the number of identifiers of each attendance type in the one-dimensional matrix of each employee every day to obtain the employee's attendance results.

[0011] In one embodiment, the actual attendance time period also includes the actual absence time period, and the step of determining the employee's actual attendance time period for the day includes:

[0012] When it is determined that an employee's punch-in record for the day is incomplete, the employee's actual working time period, actual rest time period and actual missing punch-in time period shall be determined according to the punch-in record, prescribed working time period and prescribed rest time period of the day;

[0013] When it is determined that there is no punch-in record for the employee on that day, the employee's actual working time period, actual rest time and actual missing punch-in time period are determined according to the prescribed working time period and prescribed rest time period.

[0014] In one embodiment, the process of determining that an employee's punch-in record for the day is incomplete includes:

[0015] When the employee's punch-in record for the day exists, if there is an on-duty punch-in record without a corresponding off-duty punch-in record, or there is an off-duty punch-in record without a corresponding on-duty punch-in record, the employee's punch-in record for the day is incomplete.

[0016] In one embodiment, the step of determining the priority of each attendance type in each overlapping time period includes:

[0017] For each overlapping time period, if it is determined that there is no attendance approval form in the overlapping time period, the pre-set priority of each attendance type in the overlapping time period is maintained;

[0018] For each overlapping time period, if it is determined that there is an attendance approval form in the overlapping time period, the priority of each attendance type in the overlapping time period is determined according to the approval status of the attendance approval form.

[0019] In one embodiment, for each overlapping time period, if it is determined that there is an attendance approval form in the overlapping time period, the step of determining the priority of each attendance type in the overlapping time period according to the approval status of the attendance approval form includes:

[0020] For each overlapping time period, if there is an attendance approval form in the overlapping time period, determine whether the approval status of the attendance approval form in the overlapping time period is passed;

[0021] If the approval status of the attendance approval form in the overlapping time period is passed, the priority of each attendance type in the overlapping time period is updated according to the attendance type corresponding to the attendance approval form;

[0022] If the approval status of the attendance approval form in the overlapping time period is not passed, the pre-set priority of each attendance type in the overlapping time period is maintained.

[0023] In one embodiment, if the approval status of the attendance approval form in the overlapping time period is passed, the step of updating the priority of each attendance type in the overlapping time period according to the attendance type corresponding to the attendance approval form includes:

[0024] If the approval status of the attendance approval form in the overlapping time period is passed, the approval attendance time period corresponding to the attendance approval form is determined, and in the intersection time period between the approval attendance time period and the overlapping time period, according to the attendance type corresponding to the attendance approval form, the priority of each attendance type in the intersection time period is determined, and in the non-intersecting time period between the approval attendance time period and the overlapping time period, the pre-set priority of each attendance type in the non-intersecting time period is maintained.

[0025] In one embodiment, the step of marking matrix elements in the one-dimensional matrix of the employee's day according to the identifier corresponding to the highest priority attendance type in each overlapping time period includes:

[0026] For each overlapping time period, the target interval corresponding to the overlapping time period is determined in the employee's current one-dimensional matrix according to the start and end time of the overlapping time period, and each matrix element in the target interval is assigned the identifier corresponding to the highest priority attendance type in the overlapping time period.

[0027] In a second aspect, the present application provides an attendance analysis device, the device comprising:

[0028] One-dimensional matrix building module, used to build daily one-dimensional matrix for employees in seconds;

[0029] The actual attendance time period determination module is used to determine the prescribed working time period and the prescribed rest time period of the day according to the employee's punch-in record of the day, and determine the employee's actual attendance time period of the day. The actual attendance time period at least includes the actual working time period and the actual rest time period;

[0030] An overlapping time period determination module, used to determine multiple overlapping time periods based on actual attendance time periods, prescribed working time periods and prescribed rest time periods;

[0031] A matrix element marking module is used to determine the priority of each attendance type in each overlapping time period, determine the identifier of each attendance type in each overlapping time period, and mark the matrix elements in the one-dimensional matrix of the employee's day according to the identifier corresponding to the attendance type with the highest priority in each overlapping time period;

[0032] The attendance result statistics module is used to count the number of identifiers of each attendance type in the one-dimensional matrix of the employee every day to obtain the employee's attendance results.

[0033] In a third aspect, the present application provides a storage medium: the storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of any attendance analysis method in the above embodiments.

[0034] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0035] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the attendance analysis method in any of the above embodiments are executed.

[0036] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0037] In the attendance analysis method, device, storage medium and computer equipment provided in the present application, by establishing a daily one-dimensional matrix in seconds and marking the matrix elements based on the punch-in records, the efficiency of attendance data calculation can be effectively improved, and the complex time period intersection and union operations in the traditional method can be avoided; the attendance types in overlapping time periods are marked by priority rules, which enhances the adaptability to complex attendance rules and ensures the logic and consistency of the attendance results; the matrix operation makes the statistical process simple and clear, and can accurately calculate the duration of each attendance type, providing an efficient, flexible and accurate attendance analysis method. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0039] Figure 1 A flowchart of the attendance analysis method provided in the embodiment of the present application;

[0040] Figure 2 A schematic diagram of the structure of the attendance analysis device provided in an embodiment of the present application;

[0041] Figure 3 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] The present application provides an attendance analysis method. The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with data processing functions, including but not limited to a single server, a server cluster, a personal laptop computer, a desktop computer, etc. Figure 1 As shown, the method may include the following steps:

[0044] S101: Establish a daily one-dimensional matrix for employees in seconds.

[0045] Among them, using seconds as the unit means that a day is divided into 86,400 consecutive seconds, with each second as the minimum time unit. A one-dimensional matrix is ​​an array with a length of 86,400, which is used to represent the state of each second in a day. Each element of the matrix can store an identifier, indicating the attendance type corresponding to the second, such as work, rest, leave, etc. Daily refers to an employee's single-day attendance cycle, from 00:00:00 in the morning to 23:59:59 on the same day.

[0046] In this step, firstly, a daily one-dimensional matrix is ​​established. For example, an array with a length of 86,400 can be allocated in the computer memory, and the default value is set to 0, indicating that the initial state is empty. If it is necessary to determine the attendance of an employee for multiple days, a two-dimensional matrix for multiple days can be established for each employee. If it is necessary to determine the attendance of multiple employees for multiple days, a three-dimensional matrix for multiple days can be established for multiple employees. For example, for the daily attendance of employees, a one-dimensional matrix is ​​established for the employee working time in seconds, that is, a one-dimensional matrix of 24*60*60 is established; for the monthly attendance of employees, a two-dimensional matrix is ​​established for the employees, that is, 31*daily attendance matrix; for the attendance of all employees, a three-dimensional matrix is ​​established for all employees, that is, N*employee monthly attendance matrix.

[0047] It can be understood that dividing time in seconds ensures that any short time period in a day can be accurately recorded, effectively avoiding the loss of time accuracy caused by minutes or hours. At the same time, the establishment and operation of the matrix only requires traversing the array once, avoiding the complex intersection and union calculation of time intervals in the traditional method, and reducing the amount of calculation. In addition, by marking different attendance types through the matrix, it supports dynamic adjustment of multiple rules and priorities to meet the personalized needs of attendance.

[0048] S102: Every day, according to the employee's punch-in record of the day, determine the prescribed working time period and the prescribed rest time period of the day, and determine the employee's actual attendance time period of the day, and the actual attendance time period at least includes the actual working time period and the actual rest time period.

[0049] The clock-in record is the time when an employee comes in and out of get off work and records it through the attendance device. The prescribed working time period is the time range during which an employee is required to work on a certain day, such as 9:00 to 12:00 and 13:00 to 18:00. The prescribed rest time period is the time range during which an employee is required to rest on a certain day, such as 12:00 to 13:00, 0:00-8:59 and 18:01-23:59. The actual attendance time period is the time period actually performed calculated based on the employee's clock-in record on that day, including the actual working time period and the actual rest time period. The actual working time period is the time period during which an employee actually works according to the clock-in record on that day. The actual rest time period is the time period during which an employee actually rests according to the clock-in record on that day.

[0050] In this step, all the punch-in records of the employee for the day are imported, and the working time and rest time of the employee for the day are obtained. According to the punch-in records, the actual working time and rest time of the employee for the day are generated, for example, the working time from 09:00 to 12:00.

[0051] Furthermore, the employee's punch-in record for the day and the attendance rules of his / her company can be combined to determine the prescribed working hours and prescribed rest time. After that, the employee's actual attendance time can be determined based on the punch-in record, attendance rules, prescribed working hours and prescribed rest time. For example, if the employee's punch-in record for the day is 9:15 and the punch-in record for the day is 18:30, if the attendance rule stipulated by the employee's company is that the punch-in time for the day plus 9 hours is the time to leave work, that is, under the attendance rule, the employee's prescribed working hours for the day are 9:15-18:15, and the prescribed rest time is 0:00-9:14 and 8:16-23:59, the actual working hours may be 9:15-18:30, and the actual rest time is 0:00-9:14 and 8:31-2 3:59; if the attendance rule stipulated by the employee's company is a fixed working time of 9:30-18:30, and the time outside this time period is not regarded as the employee's actual working time, that is, under this attendance rule, the employee's prescribed working time for the day is 9:30-18:30, and the prescribed rest time is 0:00-9:29 and 8:31-23:59, the actual working time can be 9:30-18:30, and the actual rest time is 0:00-9:29 and 8:31-23:59.

[0052] It can be understood that the time period division can be dynamically adjusted according to the punch-in data to adapt to the scheduling rules of different employees and support a variety of personalized attendance needs.

[0053] S103: Determine a plurality of overlapping time periods based on the actual attendance time period, the prescribed working time period and the prescribed rest time period.

[0054] In this step, the actual attendance time period, the prescribed working time period, and the prescribed rest time period are read. The start and end points of the time period are converted into numerical form for easy calculation. For example, 9:00-12:00 is converted into a numerical value in seconds. After that, the start and end points of the time period are compared. In one example, let the start point of time period A be A_start and the end point be A_end; let the start point of time period B be B_start and the end point be B_end. If max(A_start, B_start) < min(A_end, B_end), there is an overlap, and the overlapping time period is [max(A_start, B_start), min(A_end, B_end)]. In another example, the start and end points of all time periods are extracted into a list, sorted by time, and a counter count is maintained. Each time a start point is encountered, +1 is added, and each time an end point is encountered, -1 is added. If count > 1, it means that the current time point is in the overlapping time period. When count changes from a non-overlapping state (≤1) to an overlapping state (>1), the start time is recorded; when count returns to a non-overlapping state, the end time is recorded.

[0055] For all the actual attendance time periods, the prescribed working time periods and the prescribed rest time periods, the intersection operation is performed in turn, and all the overlapping parts are recorded. The overlapping time periods at least include the overlap between the actual working time period and the prescribed working time period, the overlap between the actual working time period and the prescribed rest time period, the overlap between the actual rest time period and the prescribed working time period, and the overlap between the actual rest time period and the prescribed rest time period.

[0056] It can be understood that the flexible calculation method of time period intersection can effectively cope with different attendance rules and adapt to complex attendance scenarios. The calculation of overlapping time periods provides a solid foundation for analyzing the actual work and rest situation of employees, ensuring that the data is true and accurate. After clarifying the overlapping time periods, it is possible to accurately determine whether employees work or rest in accordance with regulations, thereby improving the execution effect of attendance rules. At the same time, this method supports interactive calculation of complex time periods and multiple attendance modes, fully meeting diverse attendance needs.

[0057] S104: Determine the priority of each attendance type in each overlapping time period, and determine the identifier of each attendance type in each overlapping time period, and mark the matrix elements in the one-dimensional matrix of the employee on the day according to the identifier corresponding to the attendance type with the highest priority in each overlapping time period.

[0058] The priority of the attendance type refers to the priority order of attendance types, such as work, rest, overtime, leave, etc., in overlapping time periods, which is used to distinguish the attendance category to which a certain time period belongs. The identifier of the attendance type is used to represent the unique code or symbol of the attendance type, such as 1 for work and 2 for rest. Matrix element labeling refers to marking the time period corresponding to the one-dimensional matrix of the employee on the day according to the identifier of the attendance type.

[0059] In this step, for each overlapping time period, all the attendance types involved are listed, and the priority rules of each attendance type pre-set in the overlapping time period are loaded. The attendance types are sorted according to the priority rules, and the type with the highest priority is selected as the attendance type of the time period. Among them, the priority of the attendance type in each overlapping time period is determined by the enterprise according to actual needs. For example, in the overlapping time period of the actual working time period and the prescribed working time period, the work priority is the highest. In the overlapping time period of the actual working time period and the prescribed rest working time period, if the overlapping time period is after the prescribed evening off-get off work time, then the priority of overtime can be the highest, or the priority of rest can be the highest. If the overlapping time period is during the prescribed lunch break, then the priority of rest can be the highest.

[0060] Next, load the correspondence between the attendance type and the identifier, for example, 1 for work, 2 for rest, etc. Assign a corresponding identifier to each attendance type in the overlapping time period. According to the start and end positions of the overlapping time period, find the corresponding time interval in the matrix in seconds, and set the value of the corresponding index position of the matrix to the identifier of the attendance type with the highest priority in the overlapping time period.

[0061] It is understandable that overlapping time periods may involve multiple attendance types. By setting priorities, the attribution is clarified to avoid data conflicts while ensuring the standardization and traceability of attendance records. The priority mechanism supports the flexible expansion of multiple attendance rules to adapt to the diverse needs of enterprises, and effectively avoids data errors caused by conflicts or omissions through precise labeling, ensuring more reliable statistical results.

[0062] S105: Count the number of identifiers of each attendance type in the one-dimensional matrix of the employee every day to obtain the employee's attendance result.

[0063] In this step, for each attendance type, the number of identifiers of the attendance type can be counted in the employee's daily one-dimensional matrix, where the one-dimensional matrix is ​​in seconds, each identifier represents one second, and the total number of identifiers is the total duration of the attendance type. In this way, the attendance result of the employee can be obtained. For example, create a dictionary or array, the key is the identifier of the attendance type, the value is the corresponding cumulative count, the initial value is zero, scan each element of the one-dimensional matrix one by one, read its identifier value, and add one to the value of the corresponding counter according to the identifier of the current matrix element. After the statistics are completed, the value stored in the dictionary or array is the cumulative number of seconds for each attendance type.

[0064] It can be understood that the one-dimensional matrix recording and direct counting of identifiers in seconds reduces complex logical calculations and improves data processing speed. In addition, the matrix structure and identifier counting method are easy to expand and adjust, and can quickly adapt to new attendance rules or analysis requirements.

[0065] In the above embodiment, by establishing a daily one-dimensional matrix in seconds and marking the matrix elements based on the punch-in records, the efficiency of attendance data calculation can be effectively improved, and the complex time period intersection and union operations in the traditional method can be avoided; the attendance types in the overlapping time periods are marked by priority rules, which enhances the adaptability to complex attendance rules and ensures the logic and consistency of the attendance results; the matrix operation makes the statistical process simple and clear, and can accurately calculate the duration of each attendance type, providing an efficient, flexible and accurate attendance analysis method.

[0066] In one embodiment, the actual attendance time period also includes the actual absence time period, and the step of determining the employee's actual attendance time period for the day includes:

[0067] When it is determined that an employee's punch-in record for the day is incomplete, the employee's actual working time period, actual rest time period and actual missing punch-in time period shall be determined according to the punch-in record, prescribed working time period and prescribed rest time period of the day;

[0068] When it is determined that there is no punch-in record for the employee on that day, the employee's actual working time period, actual rest time and actual missing punch-in time period are determined according to the prescribed working time period and prescribed rest time period.

[0069] The actual time period without clock-in refers to the time range that cannot be covered due to incomplete or missing clock-in records and is regarded as a time period that is not clearly recorded.

[0070] Specifically, check whether there are any omissions based on the employee's punch-in data for the day. If some time periods are missing, mark them as "incomplete", and if there is no record at all, mark them as "record does not exist". If the record is incomplete, combine the punch-in record with the specified working and rest time periods, calculate the overlapping parts, and infer the actual working time period and the actual rest time period, and mark the uncovered time period as the missing punch-in time period. If the record does not exist, you can directly use the specified working and rest time periods as the basis, mark all time periods as "missing punch-in time periods", and leave the actual working time period and the actual rest time period empty.

[0071] In one example, in a scenario where the punch-in record is incomplete, the working time periods are specified as 9:00-12:00 and 13:00-18:00, the rest time period is specified as 12:00-13:00, and the employee's punch-in record is that he / she starts work at 9:00 and leaves work at 12:00. Then, the actual working time period is 9:00-12:00, the actual rest time period is 12:00-13:00, and the actual missing punch-in time period is 13:00-18:00. In a scenario where the punch-in record does not exist, the working time periods are specified as 9:00-12:00 and 13:00-18:00, the rest time period is specified as 12:00-13:00, and the employee's punch-in record is not available. Then, the actual working time period is empty, the actual rest time period is not available, and the actual missing punch-in time period is 9:00-18:00.

[0072] In this embodiment, the calculation logic is flexibly adjusted according to different punch-in records, and clear time period division rules are used to ensure that the definition of work, rest and missing punch-in time periods is clear and accurate. Whether it is normal work, field work or special circumstances, the time period can be accurately identified based on the punch-in records to meet various attendance needs.

[0073] In one embodiment, the process of determining that an employee's punch-in record for the day is incomplete includes:

[0074] When the employee's punch-in record for the day exists, if there is an on-duty punch-in record without a corresponding off-duty punch-in record, or there is an off-duty punch-in record without a corresponding on-duty punch-in record, the employee's punch-in record for the day is incomplete.

[0075] Specifically, extract the employee's punch-in records for the day, sort them in chronological order, traverse the punch-in records, and check whether there is a separate clock-in record or clock-out record. For example, for each pair of adjacent clock-in and clock-out records, check their pairing relationship. For example, the time of the clock-in record should be earlier than the clock-out record. If there is no corresponding clock-out record after a clock-in record, or there is no corresponding clock-in record before a clock-out record, mark the record for the day as "incomplete".

[0076] In one example, if the clock-in record is 9:00 on duty and the off duty record is missing, the clock-in record is incomplete. If the clock-in record is 9:00 on duty and 11:00 off duty, or 14:00 on duty and the off duty record is missing, the off duty record in the afternoon is missing, marking the record for the day as incomplete.

[0077] In this embodiment, the incompleteness of the clock-in record is automatically identified and marked, the accuracy and traceability of the attendance record are improved, and the statistical errors caused by missing data are reduced.

[0078] In one embodiment, the step of determining the priority of each attendance type in each overlapping time period includes:

[0079] For each overlapping time period, if it is determined that there is no attendance approval form in the overlapping time period, the pre-set priority of each attendance type in the overlapping time period is maintained;

[0080] For each overlapping time period, if it is determined that there is an attendance approval form in the overlapping time period, the priority of each attendance type in the overlapping time period is determined according to the approval status of the attendance approval form.

[0081] Among them, the attendance approval form is an application document related to attendance submitted by employees, such as leave application, overtime application, out-of-office application, etc., which usually includes the application time period and approval status.

[0082] Specifically, the approval form data submitted by the employee is screened to see if there is an approval form that matches the current overlapping time period. If not, the default priority of each attendance type in the overlapping time period is directly used. If it exists, the status field of the approval form is checked, such as "approved", "pending approval", and "rejected", and the priority is reallocated according to the approval form status, such as the approved leave type has a higher priority than the work type. According to the priority adjustment rules, the attendance mark related to the current overlapping time period is updated.

[0083] In an example, if the overlapping time period is 10:00-12:00, including work and leave time types, there is no approval form, and the default priority is work > leave, the time period is marked as work time. If the overlapping time period is 14:00-16:00, including work and leave time types, and there is an approved leave form, the priority is adjusted to leave > work, and the time period is marked as leave time.

[0084] In this embodiment, by dynamically adjusting the priority, the intervention of the approval form can be flexibly handled to ensure that the attendance record accurately reflects the actual situation of the employee. The priority adjustment mechanism improves the credibility of the attendance data and reduces the marking errors caused by the incorrect application of the approval form status. The method supports multiple attendance types and approval processes, enhances the flexibility of attendance management rules, effectively reduces the risk of misjudgment in complex scenarios, and ensures the accuracy of attendance attribution.

[0085] In one embodiment, for each overlapping time period, if it is determined that there is an attendance approval form in the overlapping time period, the step of determining the priority of each attendance type in the overlapping time period according to the approval status of the attendance approval form includes:

[0086] For each overlapping time period, if there is an attendance approval form in the overlapping time period, determine whether the approval status of the attendance approval form in the overlapping time period is passed;

[0087] If the approval status of the attendance approval form in the overlapping time period is passed, the priority of each attendance type in the overlapping time period is updated according to the attendance type corresponding to the attendance approval form;

[0088] If the approval status of the attendance approval form in the overlapping time period is not passed, the pre-set priority of each attendance type in the overlapping time period is maintained.

[0089] Specifically, by associating the attendance approval form with the overlapping time periods, the status field of the attendance approval form is read. For each overlapping time period, the corresponding attendance approval form is matched and the approval status is retrieved. If the approval status is passed, the priority table is dynamically adjusted according to the attendance type field in the approval form. For example, the attendance type corresponding to the approval form is set to the highest priority. If the approval status is not passed, the current priority configuration remains unchanged.

[0090] In this embodiment, the status of the attendance approval form directly affects the rationality of the attendance record. By checking the approval status of the approval form, the attendance data is ensured to be consistent with the actual situation. Dynamically updating the priority ensures that the time period affected by the approval form can accurately reflect the approval result, while avoiding the misuse of the failed approval form data. Therefore, the priority will only be modified after the approval form is passed, thereby avoiding data deviations caused by approval errors or failed records. By supporting dynamic adjustment of the priority, it can adapt to a variety of attendance rules and special scenario requirements, while effectively avoiding conflicts and overlaps between different attendance types, ensuring the uniqueness and consistency of the final attendance record.

[0091] In one embodiment, if the approval status of the attendance approval form in the overlapping time period is passed, the step of updating the priority of each attendance type in the overlapping time period according to the attendance type corresponding to the attendance approval form includes:

[0092] If the approval status of the attendance approval form in the overlapping time period is passed, the approval attendance time period corresponding to the attendance approval form is determined, and in the intersection time period between the approval attendance time period and the overlapping time period, according to the attendance type corresponding to the attendance approval form, the priority of each attendance type in the intersection time period is determined, and in the non-intersecting time period between the approval attendance time period and the overlapping time period, the pre-set priority of each attendance type in the non-intersecting time period is maintained.

[0093] Specifically, the overlapping time periods, approval attendance time periods, and their intersection and non-intersection time periods are located, the overlapping areas of the two time periods are identified, and the intersection and non-intersection parts are marked. After the intersection part is determined, the priority of the intersection of the approval attendance time period and the overlapping time period is found, and the priority of the time period is updated according to the attendance type defined in the approval attendance sheet. For non-intersection time periods, the original priority is retained according to the preset rules.

[0094] In an example, suppose that employee A's actual clocking time is from 8:00 am to 9:00 pm, the prescribed working time is from 8:00 am to 6:00 pm, and the rest of the time is the prescribed rest time. Employee A submitted an overtime application to the company and was approved. The approved overtime time is from 6:00 pm to 8:00 pm. Then the overlapping time period includes 6:00 pm to 9:00 pm. During this time period, the employee's actual working time and the prescribed rest time have an intersection, and there is an approved attendance approval form in the overlapping time period, and there are attendance types including rest and overtime. The intersection time period of the overlapping time period and the attendance approval time period is from 6:00 pm to 8:00 pm, and the non-intersecting time period is from 8:00 pm to 9:00 pm. Therefore, the priority of overtime can be set to the highest in the intersection time period, and the priority of each attendance type in the non-intersecting time period remains unchanged. If the original highest priority is rest, the attendance type corresponding to the non-intersecting time period is rest; if the original highest priority is overtime, the attendance type corresponding to the non-intersecting time period is overtime.

[0095] In this embodiment, by calculating the intersection and non-intersection time periods, the correct priority can be accurately assigned to each attendance period to avoid incorrectly assigning attendance types, especially in complex time period intersection scenarios. The priority is strictly adjusted according to the approval status to ensure that the failed approval records will not be incorrectly applied, thereby improving the accuracy of the attendance records. At the same time, the method is flexibly adapted to different attendance rules, especially when it involves approval changes, and can dynamically adjust the priority to better meet diverse attendance needs.

[0096] In one embodiment, the step of marking matrix elements in the one-dimensional matrix of the employee's day according to the identifier corresponding to the highest priority attendance type in each overlapping time period includes:

[0097] For each overlapping time period, the target interval corresponding to the overlapping time period is determined in the employee's current one-dimensional matrix according to the start and end time of the overlapping time period, and each matrix element in the target interval is assigned the identifier corresponding to the highest priority attendance type in the overlapping time period.

[0098] Specifically, the time period is mapped to the index range of the one-dimensional matrix according to the start and end time of the overlapping time period. For example, if the granularity of the matrix is ​​seconds and the overlapping time period is from 09:00 to 10:00, the target interval is the 32400th element to the 35999th element of the matrix, that is, the day starts counting from 00:00. Read the highest priority attendance type and its identifier in the overlapping time period, and assign the identifier to the corresponding matrix element. For example, if the highest priority attendance type is "vacation" and the identifier is "2", all matrix elements in the target interval are assigned "2".

[0099] In this embodiment, the assignment of matrix elements clarifies the employee's attendance type for each time period, making the attendance data more intuitive and easy to read. The priority coverage mechanism effectively solves the conflict problem of multiple attendance types in overlapping time periods, and supports dynamic management of different attendance rules and types, which can flexibly adapt to the changing needs of complex attendance scenarios.

[0100] The attendance analysis device provided in the embodiment of the present application is described below. The attendance analysis device described below and the attendance analysis method described above can be referred to in correspondence with each other. Figure 2 As shown, the present application provides an attendance analysis device, which includes:

[0101] A one-dimensional matrix building module 201 is used to build a daily one-dimensional matrix for employees in seconds;

[0102] The actual attendance time period determination module 202 is used to determine the prescribed working time period and the prescribed rest time period of the day according to the punch-in record of the employee on the day, and determine the actual attendance time period of the employee on the day, where the actual attendance time period at least includes the actual working time period and the actual rest time period;

[0103] An overlapping time period determination module 203, for determining a plurality of overlapping time periods based on the actual attendance time period, the prescribed working time period and the prescribed rest time period;

[0104] The matrix element marking module 204 is used to determine the priority of each attendance type in each overlapping time period, determine the identifier of each attendance type in each overlapping time period, and mark the matrix elements in the one-dimensional matrix of the employee's day according to the identifier corresponding to the attendance type with the highest priority in each overlapping time period;

[0105] The attendance result statistics module 205 is used to count the number of identifiers of each attendance type in the one-dimensional matrix of the employee every day to obtain the attendance result of the employee.

[0106] In one embodiment, the actual attendance time period also includes the actual absence time period, and the actual attendance time period determination module 202 includes:

[0107] The first actual attendance time period determination submodule is used to determine the employee's actual working time period, actual rest time period and actual missing time period on the day according to the employee's punch-in record, the prescribed working time period and the prescribed rest time period when it is determined that the employee's punch-in record on the day is incomplete;

[0108] The second actual attendance time period determination submodule is used to determine the employee's actual working time period, actual rest time and actual absence of punch-in time period according to the prescribed working time period and prescribed rest time period when it is determined that the employee's punch-in record for the day does not exist.

[0109] In one embodiment, the first actual attendance time period determination submodule includes:

[0110] The clock-in record determination unit is used to determine that when the clock-in record of the employee exists for the day, if there is an on-duty clock-in record without a corresponding off-duty clock-in record, or there is an off-duty clock-in record without a corresponding on-duty clock-in record, the employee's clock-in record for the day is incomplete.

[0111] In one embodiment, the matrix element labeling module 204 includes:

[0112] A first attendance type priority determination submodule is used for maintaining the preset priority of each attendance type in each overlapping time period if it is determined that there is no attendance approval form in the overlapping time period;

[0113] The second attendance type priority determination submodule is used to determine the priority of each attendance type in each overlapping time period according to the approval status of the attendance approval form if it is determined that there is an attendance approval form in the overlapping time period.

[0114] In one embodiment, the second attendance type priority determination submodule includes:

[0115] An approval status determination unit, for each overlapping time period, if there is an attendance approval form in the overlapping time period, determines whether the approval status of the attendance approval form in the overlapping time period is passed;

[0116] A first attendance type priority determination unit, configured to update the priority of each attendance type in the overlapping time period according to the attendance type corresponding to the attendance approval form if the approval status of the attendance approval form in the overlapping time period is passed;

[0117] The second attendance type priority determination unit is used to maintain the preset priority of each attendance type in the overlapping time period if the approval status of the attendance approval form in the overlapping time period is not passed.

[0118] In one embodiment, the first attendance type priority determination unit includes:

[0119] The attendance type priority determination subunit is used to determine the approval attendance time period corresponding to the attendance approval form if the approval status of the attendance approval form in the overlapping time period is passed, and in the intersection time period between the approval attendance time period and the overlapping time period, determine the priority of each attendance type in the intersection time period according to the attendance type corresponding to the attendance approval form, and in the non-intersecting time period between the approval attendance time period and the overlapping time period, maintain the pre-set priority of each attendance type in the non-intersecting time period.

[0120] In one embodiment, the matrix element labeling module 204 includes:

[0121] The matrix element labeling submodule is used to determine the target interval corresponding to each overlapping time period in the employee's current one-dimensional matrix according to the start and end time of the overlapping time period, and assign each matrix element in the target interval to the identifier corresponding to the highest priority attendance type in the overlapping time period.

[0122] In one embodiment, the present application further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the attendance analysis method as described in any one of the above embodiments.

[0123] In one embodiment, the present application further provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the attendance analysis method as described in any one of the above embodiments.

[0124] Indicatively, Figure 3 As shown, Figure 3This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 3 The computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the attendance analysis method of any of the above embodiments.

[0125] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0126] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.

[0128] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0129] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for attendance analysis, characterized in that: The method comprises: Establish a daily one-dimensional matrix for employees in seconds; Every day, according to the employee's punch-in record of the day, determine the prescribed working time period and the prescribed rest time period of the day, and determine the employee's actual attendance time period of the day, the actual attendance time period at least includes the actual working time period and the actual rest time period; Determining a plurality of overlapping time periods based on the actual attendance time period, the prescribed working time period, and the prescribed rest time period; Determine the priority of each attendance type in each overlapping time period, and determine the identifier of each attendance type in each overlapping time period, and mark the matrix elements in the one-dimensional matrix of the employee on the day according to the identifier corresponding to the attendance type with the highest priority in each overlapping time period; The number of identifiers of each attendance type in the one-dimensional matrix of the employee every day is counted to obtain the attendance result of the employee.

2. The attendance analysis method according to claim 1, characterized in that: The actual attendance time period also includes the actual absence time period. The step of determining the employee's actual attendance time period for the day includes: When it is determined that the employee's punch-in record for the day is incomplete, the employee's actual working time period, actual rest time period and actual missing punch-in time period are determined according to the punch-in record for the day, the prescribed working time period and the prescribed rest time period; When it is determined that the punch-in record of the employee on that day does not exist, the actual working time period, actual rest time and actual missing punch-in time period of the employee on that day are determined according to the prescribed working time period and the prescribed rest time period.

3. The attendance analysis method according to claim 2, characterized in that: The process of determining that the employee's punch-in record for the day is incomplete includes: When the employee's punch-in record for the day exists, if in the punch-in record for the day, there is an on-duty punch-in record without a corresponding off-duty punch-in record, or there is an off-duty punch-in record without a corresponding on-duty punch-in record, then the employee's punch-in record for the day is incomplete.

4. The attendance analysis method according to claim 1 or 2, characterized in that: The step of determining the priority of each attendance type in each overlapping time period comprises: For each overlapping time period, if it is determined that there is no attendance approval form in the overlapping time period, the pre-set priority of each attendance type in the overlapping time period is maintained; For each overlapping time period, if it is determined that there is an attendance approval form in the overlapping time period, the priority of each attendance type in the overlapping time period is determined according to the approval status of the attendance approval form.

5. The attendance analysis method according to claim 4, characterized in that: For each overlapping time period, if it is determined that there is an attendance approval form in the overlapping time period, the step of determining the priority of each attendance type in the overlapping time period according to the approval status of the attendance approval form includes: For each overlapping time period, if there is an attendance approval form in the overlapping time period, determine whether the approval status of the attendance approval form in the overlapping time period is passed; If the approval status of the attendance approval form in the overlapping time period is passed, then according to the attendance type corresponding to the attendance approval form, the priority of each attendance type in the overlapping time period is updated; If the approval status of the attendance approval form in the overlapping time period is not passed, the preset priority of each attendance type in the overlapping time period is maintained.

6. The attendance analysis method according to claim 5, characterized in that: If the approval status of the attendance approval form in the overlapping time period is passed, the step of updating the priority of each attendance type in the overlapping time period according to the attendance type corresponding to the attendance approval form includes: If the approval status of the attendance approval form in the overlapping time period is passed, the approval attendance time period corresponding to the attendance approval form is determined, and in the intersection time period between the approval attendance time period and the overlapping time period, according to the attendance type corresponding to the attendance approval form, the priority of each attendance type in the intersection time period is determined, and in the non-intersecting time period between the approval attendance time period and the overlapping time period, the pre-set priority of each attendance type in the non-intersecting time period is maintained.

7. The attendance analysis method according to claim 1, characterized in that: The step of marking matrix elements in the one-dimensional matrix of the employee's day according to the identifier corresponding to the highest priority attendance type in each overlapping time period includes: For each overlapping time period, according to the start and end time of the overlapping time period, the target interval corresponding to the overlapping time period is determined in the current one-dimensional matrix of the employee, and each matrix element in the target interval is assigned an identifier corresponding to the highest priority attendance type in the overlapping time period.

8. An attendance analysis device, characterized in that: The device comprises: One-dimensional matrix building module, used to build daily one-dimensional matrix for employees in seconds; The actual attendance time period determination module is used to determine the prescribed working time period and the prescribed rest time period of the day according to the punch-in record of the employee on the day, and determine the actual attendance time period of the employee on the day, wherein the actual attendance time period at least includes the actual working time period and the actual rest time period; An overlapping time period determination module, used for determining a plurality of overlapping time periods based on the actual attendance time period, the prescribed working time period and the prescribed rest time period; A matrix element marking module, used to determine the priority of each attendance type in each overlapping time period, and determine the identifier of each attendance type in each overlapping time period, and mark the matrix elements in the one-dimensional matrix of the employee on the day according to the identifier corresponding to the attendance type with the highest priority in each overlapping time period; The attendance result statistics module is used to count the number of identifiers of each attendance type in the one-dimensional matrix of the employee every day to obtain the attendance result of the employee.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the attendance analysis method according to any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the attendance analysis method according to any one of claims 1 to 7 are executed.