Attendance abnormity real-time processing method and system

By combining multi-source data with a pre-trained anomaly detection model to identify attendance anomalies, the problem of high misjudgment rate and many missed judgments in the traditional manual judgment mode has been solved, realizing accurate attendance management and efficiency improvement in labor-intensive industries.

CN121745878AInactive Publication Date: 2026-03-27SUZHOU GAIYA INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional labor-intensive industries rely on manual judgment for attendance management, resulting in high error rates, numerous missed judgments, and low efficiency, which cannot meet the needs of digital and refined management.

Method used

By combining voice command parsing with multi-source data (employee identity, time-series attendance, commuting characteristics, shift schedule, and business scenario data), and utilizing a pre-trained anomaly detection model (including input layer, BiLSTM layer, Attention layer, and output layer), attendance anomalies are identified, achieving full-dimensional data completion and pattern mining.

Benefits of technology

It improved the accuracy of attendance recognition, optimized management efficiency, enhanced business adaptability, improved employee experience, and reduced the false positive and false negative rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121745878A_ABST
    Figure CN121745878A_ABST
Patent Text Reader

Abstract

The invention discloses an attendance abnormity real-time processing method and system, and relates to the technical field of attendance information processing, and the method comprises the steps: responding to a voice instruction input by a user, carrying out semantic analysis on the voice instruction, calling multi-source data associated with a to-be-queried target employee in real time based on the analysis content, and sending the multi-source data to the to-be-queried target employee; the multi-source data at least comprises employee identity data, time sequence attendance data, commuting feature data, scheduling data and business scene data; and extracting specified features of the multi-source data, and inputting the specified features into a pre-trained anomaly detection model to identify an attendance abnormal event of the target employee. The full-dimensional data complementation information gap is combined with the model accurate mining rule, the pain points of high misjudgment rate, more missed judgment, low efficiency and poor scene adaptation in the traditional single data and manual judgment mode are solved, and the labor intensive industry brings the values of recognition precision improvement, management efficiency optimization, business adaptation enhancement and employee experience improvement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of attendance information processing technology, specifically to a method and system for real-time handling of attendance anomalies. Background Technology

[0002] Labor-intensive industries typically face the contradiction of having a large number of employees (e.g., 20-50 people per retail store, thousands in manufacturing plants) and limited time and energy for frontline managers. Traditional manual management models can no longer support efficient operations. Managers need to manually check the attendance records, work schedules, and business needs of thousands of employees, and handling attendance anomalies can take 30-50 hours per month. Objective causes account for a high percentage of attendance anomalies in labor-intensive industries (e.g., manufacturing workers being late due to heavy rain, delivery workers not clocking in due to traffic control). Traditional methods that only consider clocking in time are prone to misjudging as subjective violations, leading to employee disputes.

[0003] Labor-intensive industries are currently transitioning from extensive management to digitalized, refined management. Traditional methods relying on manual, paper-based records are no longer sufficient to meet long-term development needs. Current methods for manually identifying attendance anomalies result in a large number of misjudgments and are costly. Summary of the Invention

[0004] The main objective of this invention is to provide a method and system for real-time handling of attendance anomalies, in order to address the shortcomings of related technologies.

[0005] To achieve the above objectives, according to a first aspect of the present invention, a real-time handling method for attendance anomalies is provided, comprising: responding to a voice command input by a user, performing semantic parsing on the voice command, and retrieving multi-source data associated with the target employee to be queried in real time based on the parsed content, wherein the multi-source data includes at least employee identity data, time-series attendance data, commuting feature data, shift scheduling data, and business scenario data; extracting specified features from the multi-source data, and inputting the specified features into a pre-trained anomaly detection model to identify attendance anomaly events of the target employee, wherein the anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer.

[0006] According to a second aspect of the present invention, a real-time attendance anomaly handling system is provided, comprising a voice processing unit for responding to a voice command input by a user, performing semantic parsing on the voice command, and retrieving multi-source data associated with the target employee to be queried in real time based on the parsed content, wherein the multi-source data includes at least employee identity data, time-series attendance data, commuting feature data, shift scheduling data, and business scenario data; and an attendance anomaly identification unit for extracting specified features from the multi-source data and inputting the specified features into a pre-trained anomaly detection model to identify attendance anomaly events of the target employee, wherein the anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer.

[0007] According to a third aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing the computer to perform the method described in any one of the first aspects.

[0008] According to a fourth aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the method described in any implementation of the first aspect.

[0009] This embodiment of the real-time attendance anomaly handling method responds to user-inputted voice commands, performs semantic parsing on the voice commands, and retrieves multi-source data associated with the target employee in real time based on the parsed content. The multi-source data includes at least employee identity data, time-series attendance data, commuting feature data, shift scheduling data, and business scenario data. Specific features are extracted from the multi-source data and input into a pre-trained anomaly detection model to identify attendance anomalies of the target employee. The anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer. By supplementing information gaps with comprehensive data and combining it with the model's accurate pattern mining, this method addresses the pain points of high misjudgment rates, numerous missed judgments, low efficiency, and poor scenario adaptability in traditional single-data, manual judgment modes. It brings value to labor-intensive industries by improving recognition accuracy, optimizing management efficiency, enhancing business adaptability, and improving employee experience. Attached Figure Description

[0010] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0011] Figure 1 This is a flowchart of the real-time attendance exception handling method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0012] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the invention described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0015] According to an embodiment of the present invention, a method for real-time handling of attendance anomalies is provided, such as... Figure 1 As shown, steps 101 to 102 are included below: Step 101: In response to the user's voice command, perform semantic parsing on the voice command, and retrieve multi-source data associated with the target employee in real time based on the parsed content. The multi-source data includes at least employee identity data, time-series attendance data, commuting feature data, shift scheduling data, and business scenario data.

[0016] In this step, attendance clerks can view employee attendance data. Specifically, they can query attendance via voice through the user terminal. The process involves analyzing the text converted from voice commands to extract key information (such as target employees, time range, and query dimensions). The core is to transform unstructured text into structured information that machines can understand.

[0017] Traditional attendance systems rely solely on clock-in time to determine anomalies, which can easily misclassify compliant clock-in after a shift change as lateness, or delays caused by commuting disruptions as intentional violations. Therefore, this embodiment combines multi-source data to ensure accurate anomaly detection.

[0018] Multi-source data refers to various data collections related to employee attendance management, specifically including: Employee identity data: Data that identifies an employee's identity and basic attributes, such as employee ID, name, department, job type, skill tags, etc. Time-series attendance data: Employee attendance behavior data recorded in chronological order, such as daily clock-in and clock-out times, clock-in devices, and abnormal records (late arrival / early departure / failure to clock in), etc. Commuting characteristic data: Data reflecting employees' commuting situation, such as commuting route ID, historical commuting time, commuting mode (driving / public transportation), real-time traffic information, etc. Scheduling data: Data on the work hours arranged by the company for its employees, such as the arrival / departure time of the day, the type of scheduling (fixed / flexible / overtime), and the record of shift changes; Business scenario data, data related to the business of employees' positions, such as departmental business peak and valley period markings (peak / off-peak / valley), real-time work order volume, core position markings, etc.

[0019] The retrieved multi-source data undergoes consistency verification and format integration, including unifying the time format by converting all time fields (such as clock-in time and shift start time) to YYYY-MM-DDHH:MM:SS format; filtering outliers by removing invalid records in the time-series attendance data where the clock-in time is empty and there is no anomaly marker (which may be due to system failure); and merging the multi-source data of the same employee into a structured dataset by date.

[0020] Among the aforementioned multi-source data, the combination of employee identity data and business scenario data can ensure that the scheduling personnel match the business needs by using skill tags and peak and off-peak business requirements (such as needing to schedule more chefs during the lunch rush in the catering industry), avoiding situations where there are positions but no staff or staff but no positions. When time-series attendance data and business scenario data are combined, if the business is in a peak period for medical emergencies, the impact of an employee being 10 minutes late is far greater than during off-peak periods, which can trigger a high-priority anomaly warning, allowing for rapid dispatch of substitute personnel and reducing business losses. When scheduling data and business scenario data are combined, if the business experiences a sudden surge in logistics orders, real-time shift adjustments can be made based on currently available staff (scheduling data) and employee skills (identity data) to resolve the contradiction between business fluctuations and the rigidity of scheduling. Furthermore, based on the combination of commuting characteristic data and business scenario data, if there is a sudden traffic control in the business location (commuting data), shift times can be adjusted in advance (such as delaying arrival by 1 hour) to avoid all employees being late and causing the business to be unable to start.

[0021] By linking multiple data sources, we can accumulate digital assets such as individual employee patterns, business manpower needs, and abnormal causes, providing data support for optimizing enterprise manpower allocation (such as the staffing of store employees) and adjusting the compensation system (such as flexible shift salary).

[0022] Step 102: Extract the specified features from the multi-source data and input the specified features into the pre-trained anomaly detection model to identify the attendance anomaly events of the target employee. The anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer.

[0023] In this step, specific features are extracted from the multi-source data of the target employee to be queried. These features are then input into the anomaly detection model to identify abnormal attendance data of the target employee. For example, abnormal attendance data is represented by anomaly type, occurrence time, and associated scenario.

[0024] As an optional implementation of this embodiment, the training method of the anomaly detection model includes: extracting multi-source data from the historical attendance data of different employees, and extracting specified features from the multi-source data; constructing a feature matrix from the specified features, and performing feature standardization on different types of features in the feature matrix; labeling the standardized features with anomaly labels; inputting the labeled features into the anomaly detection model to train the model, wherein the forward LSTM of the BiLSTM layer learns the historical attendance trend of employees to capture periodic anomaly patterns, and the backward LSTM learns the scheduling constraints to obtain bidirectional time-series features through the output of the BiLSTM layer; filtering out the anomaly features corresponding to the original features from the bidirectional time-series features output by the BiLSTM layer; and quantifying the difference between the model's predicted value and the labeled value using a combination loss function of cross-entropy loss and mean squared error loss for the output layer, and optimizing the model based on the difference information.

[0025] In this embodiment, to support the learning of historical attendance trends by the forward LSTM in the anomaly detection model, it is necessary to extract specified features from multi-source data that can reflect the patterns, periodic characteristics, and abnormal correlation patterns of employee attendance behavior. These features cover four dimensions: basic attendance behavior, time-series fluctuation patterns, abnormal correlation factors, and individual stable characteristics, to ensure that the forward LSTM can accurately capture the long-term attendance habits, periodic abnormal patterns, and potential trends of employees.

[0026] When training the model, data from the company's historical attendance and time management systems are used to label instances of lateness or non-lateness; overtime exceeding limits and non-exceeding limits are also labeled separately. Each label sequence can be formatted as "[Day 1 (probability of lateness, probability of exceeding overtime limits), Day 2 (probability of lateness, probability of exceeding overtime limits), ..., Day N (probability of lateness, probability of exceeding overtime limits)]", strictly aligned with the input time-series feature sequence. All "time-series feature sequences + dual-probability label sequences" are combined to form a complete training sample set.

[0027] The partitioned dataset is preprocessed to ensure effective model learning. Sequence lengths are standardized, with all time-series feature sequences adjusted to a preset length (e.g., 7 days). Shorter sequences are padded with zero values ​​or the mean of features of the same dimension, while excessively long sequences are truncated to the target length. Feature standardization transforms all feature values ​​(e.g., cumulative overtime hours, weather impact factors) into a 0-1 range using Min-Max normalization, eliminating dimensional differences between features of different magnitudes. Missing feature values ​​(e.g., missing weather data for a particular day) are filled in using the mean, median, or feature values ​​from adjacent time steps, ensuring no invalid samples. The time steps of the input feature sequence and output label sequence are checked for consistency, ensuring strict correspondence between input and output for each sample, and samples with abnormal formats are removed.

[0028] For example, time-series attendance data is a direct carrier of historical attendance trends. Features reflecting the baseline and deviations of employee clock-in behavior need to be extracted as the basis for forward LSTM learning. For instance, clock-in time deviation (calculated from the actual clock-in time and scheduled arrival time in time-series attendance data (actual - scheduled, early arrival is negative, late arrival is positive)) reflects the degree of deviation between employees' daily clock-in and schedule. The forward LSTM learns the normal deviation range and daily clock-in frequency through this feature (statistical analysis of clock-in records in time-series attendance data (normal is 2 clock-ins and 2 clock-outs, missing clock-ins is 1 or 0)). This feature can capture habitual missing clock-in trends. For example, forgetting to clock out every Wednesday. The forward LSTM identifies such periodic behavioral patterns and abnormal type sequences (extracted from the abnormal labels in the time-series attendance data (late → 1, early departure → 2, no clocking in → 3, normal → 0), sorted by time). This feature forms an abnormal type time-series chain (e.g., [1,1,0,1]), which is used to learn the periodicity of abnormalities and the duration of abnormalities (calculated from the abnormal details in the time-series attendance data (e.g., late 30 minutes, early departure 15 minutes)). This feature reflects the trend of the severity of abnormalities (e.g., the duration of lateness gradually increases from 10 minutes to 30 minutes). The forward LSTM captures the worsening / mitigation trend.

[0029] Commuting feature data reflects the objective constraints on employee attendance behavior. Extracting these features helps the forward LSTM distinguish between subjective anomalies and trend anomalies caused by objective conditions. For example, the difference between the daily commuting time and the historical average time can be calculated from the daily commuting time data. A positive value indicates an increase in time, and the forward LSTM can learn the correlation between changes in commuting time and clock-in deviation. The number of route changes in the past 30 days divided by the total number of days can be counted from the route ID in the commuting feature data. The lower the value, the more stable the route. When the route is stable, the forward LSTM can strengthen the prediction weight of historical commuting time → clock-in time; frequent route changes will reduce the weight. The mode of transportation can be extracted from the commuting mode data, such as driving → 1, public transportation → 2, walking → 3. The extracted modes of transportation are recorded in time series. Different commuting modes have different attendance trends (e.g., driving is greatly affected by congestion, while walking is more stable), and the forward LSTM learns the specific patterns of each mode.

[0030] Business scenario data can reflect the impact trend of external business pressure on employee attendance. Extracting these features can help the forward LSTM learn the correlation between business fluctuations and attendance anomalies. For example, it can extract the trend feature of business intensity → attendance performance, attendance deviation during business peak and valley periods (e.g., grouping by peak and valley markers of business scenario data and calculating the average clock-in deviation of each group (e.g., an average lateness of 15 minutes during peak hours)), extract the chain trend feature that can capture overtime → fatigue → the next day's anomaly, such as the correlation feature between overtime frequency and the next day's anomaly (calculated from overtime records of business scenario data and the next day's time-series attendance data (the probability of the next day's anomaly caused by the previous day's overtime)), and extract the feature that can learn the interference trend of special business days on attendance, such as the attendance pattern of special business days (which can be extracted from special day markers of business scenario data (e.g., promotion days, inventory days) and statistically analyze the difference between the anomaly rate and the normal rate of such dates).

[0031] Individual attributes in employee identity data can reflect stable preferences in attendance behavior. Extracting these features can help forward LSTM calibrate trend biases caused by individual differences. For example, historical attendance compliance rate (extracted from historical attendance statistics of employee identity data (number of normal attendances in the past 3 months / total number of attendances)) can distinguish between high-compliance employees (occasional anomalies) and low-compliance employees (normal anomalies). Forward LSTM assigns different trend weights to the two types of employees. Job attendance feature matching degree (calculating the matching degree between the employee's attendance trend and the typical attendance characteristics of their job (e.g., the matching degree of flexible attendance for sales positions)) If the employee's trend deviates significantly from the job characteristics (e.g., administrative positions frequently have flexible attendance), forward LSTM strengthens its sensitivity to anomalies. Length of service (calculated from the employee's start date in the employee identity data (current date - start date)) is also important. For example, for new employees (<3 months) whose attendance trends are unstable, forward LSTM reduces the weight of historical data; for older employees, it increases the weight.

[0032] The aforementioned features together constitute the complete input for the forward LSTM to understand the normal state, patterns, and influencing factors of employee attendance behavior. This ensures that the model can accurately identify anomalies that deviate from historical trends, providing historical benchmarks for subsequent anomaly detection. It complements the scheduling constraints of the backward LSTM, jointly improving the accuracy of anomaly judgment.

[0033] Backward LSTM is a core technical component for improving the accuracy of attendance anomaly prediction. Its core function is to capture the reverse influence of future scenarios on current attendance behavior, thereby solving the prediction bias caused by traditional prediction models (such as forward LSTM and rule-based methods) that only rely on past → present time sequence relationships, and making attendance anomaly prediction more in line with the actual logic of scheduling scenarios.

[0034] Attendance anomalies, such as lateness and exceeding overtime limits, are highly time-dependent events. Employee attendance prediction is influenced not only by past data (such as last week's lateness records and historical commuting times) but also by future scheduling constraints. The core of anomaly prediction is to predict the probability of attendance anomalies in future periods based on time-series data. The process of learning scheduling constraints using a backward LSTM is based on specified scheduling-related features extracted from multi-source data. These features directly reflect scheduling rules, adjustment records, and business constraints. Through bidirectional propagation, forward propagation learns historical attendance patterns, and backward propagation learns future scheduling constraints, outputting a 256-dimensional time-series feature vector, providing a foundation for subsequent anomaly identification.

[0035] To support the backward LSTM in the anomaly detection model in learning scheduling constraints, it is necessary to extract specific features from multi-source data that directly reflect scheduling rules, adjustment records, and business-related constraints. These features need to cover four dimensions: basic scheduling benchmark, flexible rule boundaries, temporary adjustment information, and business scenario association, to ensure that the backward LSTM can accurately understand the attendance constraint boundaries that employees should abide by.

[0036] For example, scheduling data is the direct carrier of scheduling constraints. Features that can define the basic attendance benchmark for employees need to be extracted as the basis for backward LSTM learning: such as scheduled arrival time features (extracted from the planned arrival time field of the scheduling data and converted into minutes), scheduled departure time features (extracted from the planned departure time field of the scheduling data and converted into minutes), shift type coding features (extracted from the shift type field of the scheduling data and mapped to a code), shift adjustment identifier and adjustment record (extracted from the original scheduling time field of the shift adjustment status of the scheduling data), and overtime plan duration (extracted from the overtime plan field of the scheduling data).

[0037] The job attributes in employee identity data directly determine the details of scheduling constraints (such as differences in flexible rules). Features used to refine the constraint boundaries need to be extracted, such as job type code (extracted from the job name field of employee identity data and mapped to a code), core job identifier (extracted from the job priority field of employee identity data), and skill tag matching degree (calculated by matching the skill tags of employee identity data with the job skill requirements of scheduling data).

[0038] Business scenario data determines the need for dynamic adjustment of scheduling constraints (such as stricter constraints during peak periods). Features used to adapt to business fluctuations need to be extracted, such as business peak and valley period codes (extracted from the peak and valley marker field of business scenario data), manpower gap number for each period (calculated from the manpower demand field of business scenario data (number of people needed - number of people currently on duty, positive numbers indicate gaps), and special business day identifiers (extracted from the date type field of business scenario data).

[0039] Historical records in time-series attendance data can help the backward LSTM learn the actual execution of scheduling constraints, enhancing the model's understanding of the constraints. For example, historical scheduling compliance rate features (calculated from time-series attendance data (number of actual clock-ins that comply with scheduling constraints in the past 30 days / total number of scheduling times)) and attendance deviation change features after shift adjustment (comparing the deviation between clock-in time and scheduling time before and after shift adjustment (e.g., a deviation of 20 minutes before shift adjustment and a deviation of 5 minutes after shift adjustment)).

[0040] These features together constitute the complete input for the backward LSTM to understand what scheduling constraints are, how they change with the scenario, and how they are related to employee behavior. This ensures that the model can accurately distinguish between abnormal behaviors that violate scheduling constraints and normal behaviors that comply with the constraints, thus completely solving the misjudgment problem of traditional models that only look at historical attendance records and ignore the current schedule.

[0041] The temporal tensor composed of the above features (e.g., 66-dimensional) is input into the model input layer. The features are mapped to, for example, 256-dimensional features adapted by the model BiLSTM layer through the dimension adaptation layer. The mapping logic is to perform a linear transformation on the original 66-dimensional features (y=Wx+b, where W is a 66×256 weight matrix and b is a bias term) to ensure that no feature information is lost.

[0042] The BiLSTM layer receives 30×256 mapped temporal features as input and performs bidirectional temporal learning through two BiLSTM layers (128 hidden units per layer, Tanh activation function, dropout=0.2). For example, the forward LSTM learns historical attendance trends from day 1 to day 30, such as employee A's commuting time increasing by 20% every Monday, corresponding to increased lateness deviation on Mondays, focusing on capturing periodic anomalies. The backward LSTM learns future scheduling constraints from day 30 to day 1, such as a shift change to the afternoon shift on day 10, requiring a 2-hour delay in the clock-in time baseline on day 10, avoiding misjudging compliant clock-in after the shift change as abnormal. The output is a 30×256 bidirectional temporal feature vector (128 dimensions forward + 128 dimensions backward). The features at each time step (day) in the vector integrate historical patterns and future rules, providing temporal basis for subsequent anomaly identification.

[0043] Furthermore, the Attention layer filters out high-impact abnormal features (such as the relative time consumption ratio of commuting and the demand coefficient of business scenarios) corresponding to 66 original features from the 256-dimensional temporal features output by BiLSTM, thereby improving the model's ability to judge objective anomalies.

[0044] The steps are as follows: Step 1: Calculate the attention weights. Use the dynamic anomaly features (15 dimensions out of the original 66 dimensions, corresponding to 60 dimensions out of the mapped 256 dimensions) as the query vector Q, and the anomaly impact factor library (e.g., commuting time ratio impact factor 0.6, demand coefficient impact factor 0.3, attendance deviation impact factor 0.1) as the key vector K. Calculate the attention weights using the attention score formula. Step 1: Calculate the weight of each feature; Step 2: Weight allocation and feature enhancement. For objective anomaly-related features (such as commuting relative time ratio ≥20%, business scenario demand coefficient ≥6), increase their attention weight to twice that of ordinary features (e.g., from 0.1 to 0.2) to ensure that the model prioritizes judging anomalies based on objective factors; Step 3: Output a weighted time series feature vector, such as 30×256. The signals of high-weight features (such as objective anomaly features) in the vector are amplified, while the signals of low-weight features (such as irrelevant identity information) are suppressed.

[0045] Further, the output layer steps are illustrated below: Step 1: Input the 30×256 weighted temporal feature vector into the fully connected layer, and output the probability distribution of 5 types of anomalies for each day within 30 days through the Softmax activation function (e.g., Day 5: no attendance 0.1, late arrival 0.8, early departure 0.05, other 0.05). The type with the highest probability is the anomaly type determined by the model. Step 2: Dynamic threshold prediction branch: Input the same weighted feature into another fully connected layer, and output the extended time for late arrival judgment for each day within 30 days through the Linear activation function (e.g., Day 5: 15 minutes). At the same time, add rule constraints (e.g., extended time ≤ 30 minutes, only effective for objective anomalies) to ensure that the output conforms to the document attendance system. Step 3: Calculate the loss: Use a combined loss function (7:3 weighted) of cross-entropy loss (anomaly type prediction) + mean squared error loss (dynamic threshold prediction) to quantify the difference between the model's predicted value and the manually labeled value (e.g., cross-entropy loss for predicting late arrival but actually not attending, mean squared error loss for predicting an extension of 10 minutes but actually extending by 15 minutes).

[0046] During training, the Adam optimizer was used (initial learning rate 0.001, decaying to 0.8 times the original rate every 5 epochs). The combined loss value was propagated back to each layer of the model through the backpropagation algorithm to adjust the weight matrix of the Attention layer, the hidden unit parameters of the BiLSTM layer, the mapping matrix of the input layer, etc., to minimize the prediction error. Parameters related to objective abnormal features (such as the influence factor weight of commuting time ratio in the Attention layer) were optimized to ensure that the model's adaptability to scenarios such as traffic control and peak business hours is gradually improved.

[0047] The trained model can directly output quantified probabilities / ratios of 0-1 when making predictions (such as the probability of being late or the probability of exceeding overtime limits). This embodiment can also correlate the output with quantified details supporting the probabilities to derive solution parameters. For example, a lateness probability of 0.65 is associated with data such as an estimated average lateness of 30 minutes, 20 affected employees, and the core cause being heavy rain and commuting congestion; a overtime limit probability of 0.85 is associated with data such as an estimated total overtime of 5 hours, 3 vacancies in affected positions, and the core cause being peak business hours and insufficient manpower.

[0048] The model in this embodiment can accurately capture attendance anomaly patterns, significantly reducing false positive and false negative rates. Traditional anomaly detection models (such as ordinary LSTM and CNN) can only learn historical attendance data in one direction, easily overlooking periodic anomalies and anomalies related to scheduling constraints, leading to false positives or false negatives. This model effectively solves this problem through bidirectional temporal learning and anomaly feature filtering: the BiLSTM layer learns bidirectionally, fully covering anomaly correlation information. The forward LSTM focuses on learning the historical attendance trends of employees, accurately capturing periodic anomaly patterns through temporal analysis of multi-source features (such as commuting time and clock-in deviation), avoiding false negatives caused by focusing only on data from a single time period; the backward LSTM learns scheduling constraints simultaneously. The fusion of bidirectional temporal features improves the model's accuracy in identifying time-related anomalies (such as the causal relationship between overtime and the next day's anomalies), significantly reducing false positives and false negatives caused by incomplete information. The model selectively filters interference from features strongly correlated with anomalies from the bidirectional temporal features output by the BiLSTM. To avoid the model's attention being distracted by the redundancy of non-critical features, the accuracy of anomaly detection is further improved. In particular, the ability to identify weak signal anomalies (such as potential anomalies where attendance deviation is close to the threshold but commuting time increases sharply) is significantly better than that of traditional models.

[0049] The core outputs of attendance anomaly prediction, such as the probability of lateness (0.65) and the probability of exceeding overtime limits (0.85), clearly define the most likely types of anomalies and their risk intensity, directly determining the direction of the scheduling plan.

[0050] As an optional implementation of this embodiment, the method further includes: in response to a request to generate a scheduling plan for the target employee, performing attendance pattern modeling on the target employee to obtain a scheduling adaptation vector for the target employee; obtaining pre-constructed business constraints, generating a scheduling plan for the target employee based on the adaptation vector of the target employee and the business constraints; and generating an approval request based on the scheduling plan after the scheduling plan is confirmed, so as to send the approval request to the approval end.

[0051] In this optional implementation, the steps for determining the scheduling adaptation vector of the target employee will be disclosed in detail later. Based on the adaptation vector, it can be automatically matched with business constraints to obtain a scheduling plan.

[0052] Business constraints refer to the constraints generated from business demand analysis, including time-based manpower requirements (e.g., 4 people needed for the Saturday afternoon shift), rigid job requirements (e.g., a certificate is required for a cashier position), and resource pool gaps (e.g., 1 person currently needed for the afternoon shift). These clearly define the business boundaries that scheduling must meet. Flexibility tolerance is the quantified range of allowable fluctuations set under a flexible working hours system. Essentially, it's a controllable threshold for flexible working hours, clearly defining the limits of how flexibly employees can adjust their hours while avoiding excessive flexibility that could lead to attendance chaos, manpower shortages, or compliance risks. Its core logic is to set an additional flexible buffer zone above the legal compliance baseline (e.g., ≤3 hours of overtime per day, ≤36 hours of overtime per month). Minor deviations within this zone (e.g., 15 minutes late, 20 minutes of overtime) are not considered attendance abnormalities and do not trigger compliance penalties, while ensuring no manpower shortages during core business periods. The upper limit of flexibility tolerance must strictly comply with regulations. Based on this, companies formulate internal rules according to their own business characteristics and organizational culture to define the basic range of flexibility tolerance.

[0053] Both serve as the two input sources for decision-making: individual patterns determine the rationality of the suggested direction (whether employees can adapt), and business constraints determine the feasibility of the suggested implementation (whether the business allows it); neither is dispensable. When generating scheduling plans, the matching of the eight dimensions of the individual scheduling adaptation vector (early shift adaptation score, afternoon shift adaptation score, evening shift adaptation score, flexibility tolerance, maximum reasonable overtime hours, peak season adaptation score, off-peak season adaptation score, and low-peak season adaptation score) with business constraints is achieved through a three-layer logic of dimension correspondence, threshold verification, and conflict reconciliation. Each dimension forms a precise matching rule for the specific requirements of the business constraints, as detailed below: A first scheduling scheme is generated based on the early shift adaptation score, middle shift adaptation score, and evening shift adaptation score, as well as the time-period manpower demand constraint in the business constraints. A second scheduling scheme is generated based on the flexibility tolerance and the job flexibility rule constraint in the business constraints. A third scheduling scheme is generated based on the maximum reasonable overtime hours and the overtime control requirements constraint in the business constraints. A fourth scheduling scheme is generated based on the peak period adaptation score, off-peak period adaptation score, low-peak period adaptation score, and peak-valley period manpower allocation constraint. When there is overlap in the results of different scheduling schemes, the results are selected based on the real-time weights of different business constraints.

[0054] Under the constraint of time-based manpower demand, highly adaptable time periods can be selected to fill manpower gaps during business periods; under the constraint of job flexibility rules, it can ensure that employees' flexible needs do not exceed the boundaries of business rules; under the constraint of overtime control requirements, it can avoid the occurrence of abnormalities the next day due to employees working overtime beyond the limit due to scheduling; under the constraint of business load adaptability, it can match employees' adaptability under different business intensities.

[0055] The following steps are included when generating a scheduling plan: Step 1: Transform individual scheduling adaptation vectors and business constraints into a standardized data format to provide a unified input basis for subsequent calculations.

[0056] For example, this includes structured processing of individual shift scheduling adaptation vectors: using employee ID as the unique primary key, multiple dimension vectors are decomposed into numeric data with key-value correspondences and stored in an in-memory database. For instance, the adaptation vector for employee E001 is transformed into: [Employee ID: E001; Shift adaptation: Morning shift 0.5 / Afternoon shift 0.9 / Evening shift 0.8; Flexibility tolerance: 30 minutes; Maximum overtime: 2 hours; Peak-valley adaptation: Peak 0.4 / Off-peak 0.9 / Valley 0.7]. Vector dimensions are automatically extracted using data cleaning tools (such as ETL), and textual descriptions (e.g., high flexibility tolerance) are converted into specific numerical values ​​(30 minutes), ensuring that each dimension is a computer-calcifiable integer / floating-point number.

[0057] When structuring business constraints, various constraints are transformed into a three-dimensional data table (such as a MySQL table) of constraint type, associated parameters, and threshold, with each constraint corresponding to a unique ID. For example, a business constraint table might contain: [Constraint ID: C001; Type: Time Period Manpower Demand; Associated Parameters: Date 20251016, Shift System (Middle Shift); Threshold: 5 people needed / 3 people currently (2 people short); Initial Weight: 0.4] and [Constraint ID: C002; Type: Flexible Position Rule; Associated Parameters: Position: Administrative; Threshold: Allowable Deviation ≤ 10 minutes; Initial Weight: 0.3]. Constraint data is automatically synchronized through the business system interface, replacing natural language rules with conditional thresholds (e.g., flexible position rules are converted to allowable deviation ≤ 30 minutes), ensuring that constraints can be verified through numerical comparison.

[0058] Step 2: The correspondence between individual adaptation vectors and business constraints is automatically generated through condition judgment and numerical calculation to create a scheduling plan.

[0059] For example, when the first solution is generated, the individual's shift system adaptation score and the time-bound manpower requirements (number of people needed / current number of people / gap) constrained by the business are used as inputs to filter effective shift systems. During execution, the system iterates through the morning / afternoon / evening shifts, and determines whether two conditions are met simultaneously by comparing values. For example, the shift system adaptation score ≥ 0.6 (a preset basic adaptation threshold stored in the system configuration table); the manpower gap for that time period > 0 (gap = number of people needed - current number of people, obtained through subtraction). For the filtered effective shift systems, the score is calculated: priority score = shift system adaptation score × (gap / number of people needed), where gap / number of people needed is the urgency of the gap (the larger the value, the more urgent the business needs it). To determine the optimal shift system, the computer calls a sorting algorithm (such as bubble sort) to sort the effective shift systems from high to low priority scores, and selects the shift system with the highest score as the result of the first solution, outputting, for example, shift system: afternoon shift; priority score: 0.9 × (2 / 5) = 0.36. For example, when generating the second solution, the individual's flexibility tolerance and the job flexibility rules (allowable deviation threshold) are used as inputs. The relationship between the employee's flexibility tolerance and the job's allowable deviation is determined by numerical comparison. If the employee's flexibility tolerance is less than or equal to the allowable deviation threshold: the rule is fully met, and the flexibility range is ± the employee's flexibility tolerance. If the employee's flexibility tolerance is greater than the allowable deviation threshold: the rule is exceeded, and the flexibility range is forcibly set to ± the allowable deviation threshold. The output result is as follows: Flexible on-duty range: ±10 minutes (10 minutes allowable deviation for administrative positions, 30 minutes for employee tolerance exceeds the rule).

[0060] For example, when generating the third solution, the maximum reasonable overtime hours for an individual, the overtime control rules for the business (monthly overtime hours already worked / monthly limit), and the required overtime hours for the business are taken as inputs to calculate the remaining overtime allowance. For example, the remaining monthly overtime hours can be obtained by subtraction: monthly limit - already worked overtime hours. A two-condition judgment is performed: the computer uses a logical AND operation to determine whether two conditions are met simultaneously: required overtime hours for the business ≤ maximum reasonable overtime hours for the employee; required overtime hours for the business ≤ remaining monthly overtime hours. If both conditions are met, overtime is allowed, and the duration is the required overtime hours for the business. If either condition is not met, overtime is not allowed.

[0061] When generating the fourth solution, the individual's peak-valley adaptation score and the business's peak-valley manpower requirements (current peak type / required additional personnel) are used as inputs. Current peak-valley adaptation is determined by comparing numerical values ​​to see if the employee's current peak-valley (e.g., peak period) adaptation score is ≥0.6: If ≥0.6, it is recommended to work during the current peak period; if <0.6, other peak periods (e.g., off-peak / valley) are automatically filtered, and a sorting algorithm is used to select the peak period with the highest employee adaptation score as the recommended work period. The output result is as follows: Recommended peak period: Off-peak; Peak period adaptation score: 0.9 (Peak adaptation 0.4 < 0.6, Off-peak adaptation is the highest).

[0062] Step 3: When multiple options conflict (e.g., the first option recommends the middle shift, while the fourth option suggests avoiding the middle shift peak hours due to low peak adaptability), the overall score is automatically determined and the option is discarded based on real-time weight calculation, without any subjective human judgment.

[0063] For example, during the dynamic calculation of real-time weights, business scenario parameters (whether it is a peak period, employee abnormality level, urgency of compliance requirements) are used as input data. The initial weights of each constraint are read from the configuration table (e.g., time period demand 0.4, flexible rule 0.3, overtime control 0.3, peak-valley demand 0.4). The weights are automatically adjusted according to the business scenario parameters. For example, if it is a peak period: peak-valley demand weight +0.1; if an employee has a high abnormality level (abnormal for 3 consecutive days): time period demand weight +0.1. Furthermore, the total adjusted weights are normalized to 1.0 (e.g., if the total adjusted weight is 1.1, each weight ÷ 1.1) to avoid numerical deviations affecting decision-making. The output result is as follows: real-time weights: time period demand 0.45, flexible rule 0.27, overtime control 0.27, peak-valley demand 0.45. In the process of comprehensively scoring and selecting conflicting solutions, the scores and real-time weights of each solution are used as input data to calculate the comprehensive score for each solution: The overall score for the first option = class system priority score × real-time weight of time period demand; The fourth option's overall score = peak period adaptation score × real-time weight of peak and valley demand; The overall score for the second / third scheme (rule-based) is 1.0 × corresponding weight (since it is only necessary to determine whether it conforms to the rules, if it does, the score is 1.0).

[0064] Finally, the comprehensive scores are sorted from highest to lowest using a sorting algorithm, and the solution with the highest score is selected: If the score of the first solution (0.36 × 0.45 = 0.162) > the score of the fourth solution (0.9 × 0.45 = 0.405): the shift system of the first solution is retained first, and the peak duty period of the fourth solution is adjusted (such as the off-peak period within the middle shift); if the score difference is < 0.05 (close): the solution with higher potential for employee abnormality improvement is automatically selected (calculated by the difference between the original abnormality rate and the target abnormality rate; the larger the difference, the higher the improvement potential). The output result is as follows: middle shift (10:00-18:00), flexible range ±10 minutes, no overtime, off-peak duty period (14:00-16:00). For example, the original anomaly rate mentioned above refers to the actual proportion of anomalies occurring in the current / historical period for a certain object. It is the result of statistical analysis based on real data. For example, the lateness rate of a department in the past 30 days (number of late employees / total number of employees) = 30%; the monthly overtime exceeding rate of an employee (number of overtime days / number of working days) = 25%. The target anomaly rate refers to the acceptable upper limit of anomalies set by the enterprise based on compliance requirements, business needs, and management objectives. It is a predefined reasonable threshold. For example, the enterprise sets a department lateness rate target of 10% (a maximum of 10% of employees being late each month); and an overtime exceeding rate target of 5% (a maximum of 5% of working days exceeding the overtime limit each month).

[0065] By implementing scheduling optimization plans (such as shift adjustments, substitute scheduling, and remote work), there is a high potential and room to reduce the "original abnormality rate" to the "target abnormality rate". This means that the optimization can significantly reduce the abnormality rate and bring significant compliance benefits.

[0066] For example, entities with high improvement potential (such as Department A with a difference of 25%) are prioritized for strong intervention solutions (such as dual optimization of "substitute scheduling solution + flexible working hours solution"), and more resources are invested (such as increasing substitute employees and adjusting core shifts); entities with low improvement potential (such as Department B with a difference of 3%) are matched with weak intervention solutions (such as only fine-tuning the flexibility tolerance), without excessive investment.

[0067] This approach can address the pain point of rapidly changing business needs in a timely manner, and also improve the compatibility between employees and business operations.

[0068] As an optional implementation of this embodiment, attendance pattern modeling for the target employee includes: calculating the attendance anomaly rate of the target employee in different shifts within a specified historical period to obtain time period adaptation information; calculating the arrival time deviation between the actual arrival time and the stipulated arrival time in the target employee's attendance data to calculate the corresponding flexibility tolerance information for the target employee; determining the maximum reasonable overtime hours for the target employee based on the target employee's overtime hours on the current day and the attendance anomaly rate on the next day; calculating the anomaly rate information for the target employee during peak hours, off-peak hours, and low-peak hours; and vectorizing the extracted specified information, wherein, based on the adaptation information, a shift adaptation score is determined, and based on the anomaly rate information of the target employee during peak hours, off-peak hours, and low-peak hours, adaptation scores for different time periods are determined to obtain the target employee's shift adaptation vector [early shift adaptation score, afternoon shift adaptation score, evening shift adaptation score, flexibility tolerance, maximum reasonable overtime hours, peak hours adaptation score, off-peak hours adaptation score, low-peak hours adaptation score]. During modeling, time-dimensional features (corresponding to early / mid / late shift fit scores) can be pre-extracted. This includes defining early shifts (e.g., 8:00-16:00), mid shifts (10:00-18:00), and late shifts (14:00-22:00) according to the company's scheduling rules. For each shift, the number of anomalies and total attendance are counted, using the formula: Shift Anomaly Rate = Number of Anomalies in that Shift ÷ Total Attendance in that Shift. Example: An employee attended the early shift 20 times in the past 3 months and was late 5 times → Early Shift Anomaly Rate = 5 / 20 = 25%. The lower the anomaly rate, the stronger the employee's attendance stability and the higher the fit for that shift.

[0069] When calculating the fit score for the morning, afternoon, or evening shifts, it can be based on the calculated anomaly rate. For example, the fit score can be obtained as fit score = 1 - shift anomaly rate.

[0070] Furthermore, rule-based features can be extracted. Specifically, when calculating the deviation between the actual arrival time and the stipulated arrival time in the attendance data of the target employee, and determining the elastic tolerance information corresponding to the target employee, the maximum deviation value with an abnormal probability of K is used as the elastic tolerance information based on the abnormality rate of the target employee under different specified deviation values. For example, when the deviation is ≤30 minutes, the abnormality probability is 3%; when it is >30 minutes, the abnormality probability jumps to 30% → elastic tolerance = 30 minutes.

[0071] When determining the maximum reasonable overtime hours, statistical data is collected on the correlation between the employee's daily overtime hours and the abnormality rate the following day (e.g., 1 hour of overtime, 5% abnormality rate the following day; 3 hours of overtime, 40% abnormality rate the following day). The maximum reasonable overtime hours are taken when the abnormality rate the following day is less than or equal to a specified value, such as 5%. Example: If the overtime is ≤2 hours, the abnormality rate the following day is 4%; if it is >2 hours, it rises to 25% → maximum reasonable overtime hours = 2 hours.

[0072] Furthermore, during modeling, the abnormality rate information of target employees during peak, off-peak, and low-peak periods can be extracted based on business load dimensions. First, pre-defined peak periods (e.g., retail holidays, daily 10:00-12:00), off-peak periods (weekdays during non-peak hours), and low-peak periods (late night, off-season) are obtained according to business scenarios. For each peak / valley period, the ratio of abnormal occurrences to attendance is calculated. For example, peak / valley period abnormality rate = number of abnormal occurrences during that peak / valley period ÷ total attendance during that peak / valley period. Example: An employee attends 15 times during peak hours and has 6 abnormal occurrences → peak abnormality rate = 6 / 15 = 40%. The lower the peak / valley period abnormality rate, the stronger the employee's attendance stability and the higher their adaptability under the corresponding business intensity.

[0073] When determining the peak adaptation score, off-peak adaptation score, and valley adaptation score, the adaptation score is based on the formula: Adaptation score = 1 - Peak anomaly rate / Off-peak anomaly rate / Valley anomaly rate.

[0074] In this optional time limit method, traditional scheduling often relies on uniform rules such as random allocation of shifts, ignoring individual differences among employees in terms of time slot adaptability, flexibility, and overtime tolerance. This results in unsuitable shifts and increased employee irregularities. This process, however, accurately captures individual differences through multi-dimensional indicator calculation and vectorization. The multi-dimensional indicators calculated in this process essentially identify employee attendance risk points and transform these risks into avoidable scoring signals through adaptation vectors, providing risk warnings for scheduling. In labor-intensive industries, scheduling conflicts often stem from the mismatch between the need for manpower and employee suitability. The scheduling adaptation vectors generated by this process provide a quantitative basis for balancing these two factors.

[0075] The core value of this process is to transform employee attendance patterns from vague, experience-based judgments into precise, quantifiable metrics, providing actionable, comparable, and optimizable data for scheduling optimization. Ultimately, it achieves the triple goals of meeting business needs, reducing employee anomalies, and improving management efficiency, perfectly aligning with the scheduling management needs of labor-intensive industries characterized by large workforces, complex operations, and a high demand for efficiency.

[0076] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0077] According to an embodiment of the present invention, a real-time attendance anomaly handling system is also provided, including a voice processing unit for responding to a voice command input by a user, performing semantic parsing on the voice command, and retrieving multi-source data associated with the target employee to be queried in real time based on the parsed content. The multi-source data includes at least employee identity data, time-series attendance data, commuting feature data, shift scheduling data, and business scenario data. An attendance anomaly identification unit is used to extract specified features from the multi-source data and input the specified features into a pre-trained anomaly detection model to identify attendance anomaly events of the target employee. The anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer.

[0078] According to embodiments of the present invention, the present invention also provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to implement the methods described in any of the above embodiments.

[0079] According to embodiments of the present invention, the present invention also provides a readable storage medium storing computer instructions that enable a computer to perform the methods described in any of the above embodiments when executed.

[0080] According to embodiments of the present invention, the present invention also provides a computer program product that, when executed by a processor, can implement the methods described in any of the above embodiments.

[0081] Figure 2A schematic block diagram of an example electronic device 300 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.

[0082] like Figure 2 As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the electronic device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0083] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, such as keyboard, mouse, etc.; output unit 307, such as various types of displays, speakers, etc.; storage unit 308, such as disk, optical disk, etc.; and communication unit 309, such as network card, modem, wireless transceiver, etc. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0084] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as the object matching method. For example, in some embodiments, the object matching method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 303 and executed by the computing unit 301, one or more steps of the methods described above may be performed.

[0085] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0086] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0087] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

Claims

1. A method for real-time handling of attendance anomalies, characterized in that, include: In response to a user's voice command, the system performs semantic parsing on the voice command and retrieves multi-source data associated with the target employee in real time based on the parsed content. The multi-source data includes at least employee identity data, time-series attendance data, commuting feature data, shift scheduling data, and business scenario data. Specified features are extracted from the multi-source data and input into a pre-trained anomaly detection model to identify attendance anomalies of the target employee. The anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer.

2. The real-time attendance anomaly handling method according to claim 1, characterized in that, The method also includes: In response to the request to generate a scheduling plan for the target employees, the attendance patterns of the target employees are modeled to obtain the scheduling adaptation vector of the target employees; Obtain pre-built business constraints, and generate a scheduling plan for the target employee based on the adaptation vector of the target employee and the business constraints; Once the scheduling plan is confirmed, an approval request is generated based on the scheduling plan and sent to the approval end.

3. The real-time attendance anomaly handling method according to claim 2, characterized in that, Modeling the attendance patterns of target employees includes: calculating the attendance anomaly rate of target employees in different shifts within a specified historical period to obtain time period adaptation information; calculating the arrival time deviation between the actual arrival time and the stipulated arrival time in the attendance data of target employees to determine the corresponding flexibility tolerance information of target employees; determining the maximum reasonable overtime time information of target employees based on the overtime hours of target employees on the current day and the attendance anomaly rate of the next day; and calculating the anomaly rate information of target employees during peak hours, off-peak hours, and low-peak hours. The extracted specified information is vectorized, wherein the shift adaptation score is determined based on the adaptation information, and the adaptation score for different time periods is determined based on the abnormality rate information of the target employees during peak, off-peak, and low-peak periods, to obtain the shift adaptation vector of the target employees [early shift adaptation score, middle shift adaptation score, evening shift adaptation score, flexibility tolerance, maximum reasonable overtime hours, peak adaptation score, off-peak adaptation score, low-peak adaptation score].

4. The real-time attendance anomaly handling method according to claim 3, characterized in that, Obtaining pre-built business constraints and generating a scheduling scheme for the target employee based on the target employee's adaptation vector and the business constraints includes: The first shift scheduling scheme is generated based on the early shift adaptation score, the middle shift adaptation score, the evening shift adaptation score, and the time period manpower demand constraint in the business constraints. A second shift scheduling scheme is generated based on the flexibility tolerance and the job flexibility rule constraints in the aforementioned business constraints. A third scheduling scheme is generated based on the maximum reasonable overtime hours and the overtime control requirements in the aforementioned business constraints. The fourth scheduling scheme is generated based on peak-peak adaptation score, off-peak adaptation score, low-peak adaptation score and peak-valley period manpower allocation constraints. When there is overlap in the results of different scheduling schemes, the results are selected based on the real-time weights of different business constraints.

5. The real-time attendance anomaly handling method according to claim 1, characterized in that, The anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer. The training method of the anomaly detection model includes: extracting multi-source data from the historical attendance data of different employees, and extracting specified features from the multi-source data; and labeling the features with anomaly labels. The labeled features are input into the anomaly detection model to train the model. The model learns the historical attendance trends of employees through the forward LSTM of the BiLSTM layer to capture periodic anomaly patterns, and learns the scheduling constraints through the backward LSTM layer to obtain bidirectional time-series features through the output of the BiLSTM layer. For the output layer, a combined loss function of cross-entropy loss and mean squared error loss is used to quantify the difference between the model's predicted value and the labeled value, and the model is optimized based on the difference information.

6. A real-time attendance anomaly handling system, characterized in that, include: The voice processing unit is used to respond to the voice command input by the user, perform semantic parsing on the voice command, and retrieve multi-source data associated with the target employee to be queried in real time based on the parsed content. The multi-source data includes at least employee identity data, time-series attendance data, commuting feature data, shift scheduling data, and business scenario data. The attendance anomaly identification unit is used to extract specified features from the multi-source data and input the specified features into a pre-trained anomaly detection model to identify attendance anomaly events of the target employee. The anomaly detection model includes an input layer, a BiLSTM layer, an Attention layer, and an output layer.

7. The real-time attendance anomaly handling system according to claim 6, characterized in that, The system also includes: a scheduling adaptation vector generation unit, which, in response to a request to generate a scheduling plan for the target employee, models the attendance patterns of the target employee to obtain the scheduling adaptation vector of the target employee; The scheduling scheme generation unit is used to obtain pre-built business constraints and generate a scheduling scheme for the target employee based on the adaptation vector of the target employee and the business constraints. Once the scheduling plan is confirmed, the approval unit generates an approval request based on the scheduling plan and sends the approval request to the approval end.

8. The real-time attendance anomaly handling system according to claim 7, characterized in that, Modeling the attendance patterns of target employees includes: calculating the attendance anomaly rate of target employees in different shifts within a specified historical period to obtain time period adaptation information; calculating the arrival time deviation between the actual arrival time and the stipulated arrival time in the attendance data of target employees to determine the corresponding flexibility tolerance information of target employees; determining the maximum reasonable overtime time information of target employees based on the overtime hours of target employees on the current day and the attendance anomaly rate of the next day; and calculating the anomaly rate information of target employees during peak hours, off-peak hours, and low-peak hours. The extracted specified information is vectorized, wherein the shift adaptation score is determined based on the adaptation information, and the adaptation score for different time periods is determined based on the abnormality rate information of the target employees during peak, off-peak, and low-peak periods, to obtain the shift adaptation vector of the target employees [early shift adaptation score, middle shift adaptation score, evening shift adaptation score, flexibility tolerance, maximum reasonable overtime hours, peak adaptation score, off-peak adaptation score, low-peak adaptation score].

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method according to any one of claims 1-5.

10. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the method according to any one of claims 1-5.