Job worker fatigue state evaluation method and terminal device based on operation log

CN122991607APending Publication Date: 2026-10-27QINGDAO WINTEC SYSTEM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611156115.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0004]上述两类检测方案均存在难以规模化落地的缺陷

Benefits of technology

[0015]在本申请实施例中,该计算方式充分利用全部上岗基准样本的分布特征,均衡拟合不同商品总难度对应的标准操作耗时规律,不会被少量极端订单样本干扰拟合结果,保证斜率、截距能够真实还原员工精力充沛时的操作特性;同时整套求解运算仅包含基础四则运算、累加、平方运算,配合前文线性回归模型,相比复杂拟合算法计算量更低,适配收银终端轻量化部署;基于精准求解得到的斜率系数与截距系数搭建标准耗时模型,能够输出高度贴合员工个人基准状态的预测单位难度耗时,减小耗时残差计算误差,进一步提升后续疲劳特征提取与评估结果的准确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122991607A_ABST
    Figure CN122991607A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on operation log's job personnel fatigue state evaluation method and terminal equipment.This method obtains transaction processing length and commodity total difficulty coefficient to calculate actual unit difficulty time consumption, obtain predicted unit difficulty time consumption by standard time consumption model, and difference value is generated residual error;Residual error sequence is constructed by collecting continuous residual error, and residual error mean, residual error coefficient of variation, positive residual error proportion, residual skewness are extracted;After normalization to feature, weighted fusion is obtained comprehensive fatigue coefficient, and fatigue grade is determined according to classification threshold value.The terminal equipment includes memory, processor, and processor runs program to realize the above-mentioned evaluation method.This scheme uses cash register terminal native transaction log, does not need additional acquisition hardware, eliminates the business load interference of passenger flow, commodity complexity, relies on multi-dimensional feature quantization fatigue, avoids hardware cost, privacy disclosure problem, reduces the evaluation misjudgment caused by business fluctuation, realizes no invasion, high-precision job personnel fatigue real-time evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of human-machine behavior intelligent monitoring technology, and in particular relates to a method and terminal device for assessing the fatigue status of operators based on operation logs. Background Technology

[0002] Retail store cashiers are required to perform repetitive, mechanical tasks such as scanning barcodes, collecting payments, and verifying orders for extended periods. As their shifts accumulate, their physical energy is continuously depleted, making them highly susceptible to fatigue. Fatigued cashiers experience reduced reaction time and difficulty concentrating, leading to issues such as missed items, incorrect calculations, and mishandled refunds. This not only lengthens customer wait times and reduces store efficiency but can also result in financial losses, customer complaints, and other negative impacts on store operations and management. Therefore, real-time and consistent fatigue monitoring of cashiers is essential.

[0003] Currently, fatigue detection solutions for cashiers in the industry are mainly divided into two categories. The first category is based on physiological signal acquisition. This solution relies on specialized hardware such as pressure sensors, electroencephalography (EEG) equipment, and terahertz bio-radar to collect physiological parameters such as the operator's heart rate, respiration, and hand grip strength, and combines them with biometric models to complete fatigue identification. The second category is based on visual image processing. This method continuously captures facial images of cashiers through cameras, extracts facial features such as blinking frequency and eye closure status, and calculates fatigue levels to determine the degree of fatigue.

[0004] Both of the aforementioned detection solutions suffer from the drawback of being difficult to implement on a large scale. Both solutions require additional purchase and deployment of dedicated data acquisition hardware, significantly increasing the hardware procurement and subsequent maintenance costs for stores; wearable physiological sensors restrict cashiers' hand movements, affecting normal checkout operations, resulting in low employee acceptance; visual camera solutions are susceptible to interference from lighting and backlighting environments, leading to unstable detection accuracy, and continuous facial recording poses a privacy risk, resulting in significant resistance from cashiers. Summary of the Invention

[0005] This application provides a method and terminal device for assessing worker fatigue based on operation logs. By extracting the native transaction time-series logs of the POS terminal, the unit time consumption of product scanning load is obtained through normalization. A personalized energy benchmark model is constructed based on the worker's initial shift data, and a fatigue residual sequence is calculated. Multi-dimensional residual statistical features are extracted and combined with time-period benchmarks and fatigue inertia to achieve adaptive weighted fusion. Fatigue levels are divided based on individual historical percentiles, and linkage warning signals are output. No additional sensing or camera hardware is required, effectively solving the problems of high deployment costs due to the need for dedicated hardware for fatigue detection, privacy disputes due to camera acquisition, interference of wearable devices with POS operations, and difficulty in large-scale application in existing technologies.

[0006] Firstly, a method for assessing worker fatigue based on operation logs is provided, including: Obtain the transaction processing time for the target transaction period and the total difficulty coefficient of all traded goods within the target transaction period, and calculate the actual time consumed per unit of difficulty; Input the total difficulty coefficient into a pre-built standard time consumption model, and output the predicted time consumption per unit of difficulty; Based on the difference between the actual unit difficulty time and the predicted unit difficulty time, calculate the time residual for the current target transaction period; Obtain the time-consuming residuals corresponding to multiple consecutive target transaction periods, and construct a time-consuming residual sequence; Statistical features are extracted from the time-consuming residual sequence, and the residual mean, residual coefficient of variation, proportion of positive residuals, and residual skewness are calculated respectively. After normalizing the residual mean, residual coefficient of variation, positive residual ratio, and residual skewness, a weighted fusion operation is performed to obtain the comprehensive fatigue coefficient. The fatigue level of the worker is determined by judging the comprehensive fatigue coefficient based on the threshold condition.

[0007] In this embodiment, the standardized actual unit difficulty time is calculated based on the processing time and product difficulty coefficient inherent in the transaction log. Then, a personalized standard time consumption model is used to output the predicted unit difficulty time and calculate the time residual, eliminating the business load interference caused by customer traffic and product complexity. Furthermore, a sequence is constructed based on continuous residuals, and multi-dimensional statistical features such as mean, coefficient of variation, positive residual ratio, and skewness are extracted. After weighted fusion of these features, a comprehensive fatigue coefficient is obtained, and the fatigue level is graded. The entire solution uses only the native operation logs of the POS terminal, eliminating the need for additional physiological and image acquisition hardware. This avoids issues such as hardware deployment costs, facial privacy leaks, and interference from wearable devices. Moreover, by quantifying fatigue through load normalization and multi-dimensional residual features, compared to a single operation time statistical method, it significantly reduces assessment errors caused by business fluctuations, achieving non-intrusive, high-precision real-time assessment of operator fatigue.

[0008] In conjunction with the first aspect, in certain implementations of the first aspect, the transaction processing time for the target transaction period and the total difficulty coefficient of all traded goods within that target transaction period are obtained, and the actual time consumed per unit of difficulty is calculated, including: Obtain the start time and end time of the transaction corresponding to the target transaction period, and calculate the transaction processing time of the target transaction period based on the difference between the end time and the start time. Based on a pre-set database of product difficulty coefficients, the difficulty coefficients of each product within the target transaction period are obtained, and the difficulty coefficients of all products are summed to obtain the total difficulty coefficient of a single transaction. The actual time consumed per unit of difficulty is calculated based on the ratio of the transaction processing time to the total difficulty coefficient of a single transaction.

[0009] In this embodiment, the method uniformly quantifies the operational burden caused by the quantity of goods in different orders and the complexity of operations for different product categories. It not only solves the problem that the total transaction volume of multi-product orders is large and the original operation time is naturally longer, but also takes into account the situation that some single-item scanning verification, weighing and registration processes are cumbersome and the processing time for a single item is even higher. It uniformly converts the two interfering factors of order quantity and product operation difficulty into standardized indicators, avoiding misjudgment of personnel fatigue due to the influence of order size and product type when directly using the original operation time. It provides unified benchmark data for subsequent residual calculation that is not affected by business load, and improves the comparability of the underlying data for fatigue assessment.

[0010] In conjunction with the first aspect, in some implementations of the first aspect, the construction of the standard time consumption model includes: Obtain the transaction processing time for multiple consecutive target transaction periods during the initial stage of the operation, as well as the total difficulty coefficient for all commodities within each target transaction period; The transaction processing time and total difficulty coefficient corresponding to multiple target transaction periods are integrated to form a benchmark sample dataset; The model is trained using the benchmark sample dataset to obtain a standard time consumption model with the total difficulty coefficient as input and the time consumption per unit of difficulty as output.

[0011] In this embodiment, employees do not experience fatigue during the initial period of employment. The corresponding transaction data can objectively reflect the inherent operating rhythm of the employee in a fatigue-free state. Based on this, a unique model is trained, which can distinguish the individual differences in the operating speed of different employees. If a uniform and universal model is used, employees with a slower operating rhythm will be directly judged as fatigued. However, this solution uses the employee's own baseline data as a comparison benchmark, which can avoid the evaluation bias caused by the difference in the innate operating habits of the personnel. Subsequently, the predicted unit difficulty time output by the model is used as a reference benchmark to ensure that the calculation of the time residual only reflects the slowdown of operation caused by fatigue, rather than the operating characteristics of the personnel themselves, thereby improving the accuracy of fatigue assessment results from the data source level.

[0012] In conjunction with the first aspect, in some implementations of the first aspect, the model training is implemented using linear regression, including: Based on the benchmark sample dataset, calculate the average total difficulty coefficient and the average time per unit difficulty for all samples; Based on the average total difficulty coefficient and the average time taken per unit of difficulty, and relying on the benchmark sample dataset, the slope coefficient of the linear regression model is calculated. Based on the slope coefficient, the average total difficulty coefficient, and the average time consumed per unit of difficulty, the intercept coefficient of the linear regression model is obtained. Based on the slope coefficient and the intercept coefficient, the standard time consumption model is constructed and generated.

[0013] In this embodiment, linear regression can accurately depict the linear correspondence between the total difficulty of goods and the standard operation time when employees are not fatigued. The model has simple operation logic and low training and inference overhead. Compared with complex model training methods such as neural networks, the implementation process is simpler and more efficient, and the terminal computing power is smaller, which is suitable for the lightweight operation requirements of the POS terminal. The model automatically completes the fitting based solely on the employee's own on-the-job benchmark sample, without the need for manual parameter calibration. The slope and intercept parameters can fully depict the basic operation characteristics of employees. Compared with the method of roughly estimating the predicted time using a fixed ratio, it can accurately output the predicted unit difficulty time that fits the individual's operating habits, reduce the deviation between the predicted time and the actual time of the employee's operation without fatigue, thereby improving the accuracy of the subsequent calculation of the time residual and reducing fatigue assessment error.

[0014] In conjunction with the first aspect, in some implementations of the first aspect, based on the average total difficulty coefficient and the average time consumed per unit of difficulty, and relying on a benchmark sample dataset, the slope coefficient of the linear regression model is calculated, including: Based on the difference between the total difficulty coefficient and the mean total difficulty coefficient of each sample in the benchmark sample dataset, and the difference between the unit difficulty time and the mean unit difficulty time of each sample, the product of the two sets of differences is calculated for each sample, and all the products are summed to obtain the total numerator. The total denominator is obtained by summing the squares of the differences between the total difficulty coefficient and the mean total difficulty coefficient of each sample in the benchmark dataset. The slope coefficient of the linear regression model is calculated based on the ratio of the total numerator to the total denominator. Based on the slope coefficient, the average total difficulty coefficient, and the average time consumed per unit of difficulty, the intercept coefficient of the linear regression model is obtained, including: The intermediate calculated value is calculated based on the product of the slope coefficient and the average of the total difficulty coefficient; The intercept coefficient of the linear regression model is calculated based on the difference between the average time taken per unit of difficulty and the intermediate calculated value.

[0015] In this embodiment, the calculation method fully utilizes the distribution characteristics of all on-the-job benchmark samples to evenly fit the standard operation time patterns corresponding to the total difficulty of different products. It will not be affected by a small number of extreme order samples, ensuring that the slope and intercept can truly reflect the operation characteristics of employees when they are energetic. At the same time, the entire solution calculation only includes basic arithmetic operations, summation, and squaring operations. Combined with the linear regression model mentioned above, it has a lower computational load compared to complex fitting algorithms and is suitable for lightweight deployment of POS terminals. Based on the slope coefficient and intercept coefficient obtained by accurate solution, a standard time consumption model is built, which can output the predicted unit difficulty time that closely matches the individual benchmark state of employees, reduce the calculation error of time consumption residuals, and further improve the accuracy of subsequent fatigue feature extraction and evaluation results.

[0016] In conjunction with the first aspect, in certain implementations of the first aspect, the residual coefficient of variation is calculated, including: Based on the time-consuming residual sequence, the standard deviation corresponding to the time-consuming residual sequence is calculated; The denominator of the coefficient of variation is calculated by summing the absolute value of the residual mean with the preset zero-prevention coefficient. The residual coefficient of variation is calculated based on the ratio of the standard deviation to the denominator of the coefficient of variation.

[0017] In this embodiment, the coefficient of variation eliminates the scale interference caused by the magnitude of the residual mean, and can independently and objectively reflect the stability of the operator's operating rhythm. It accurately captures the disordered work characteristics of the operator's operation under fatigue, which fluctuates between fast and slow, and makes up for the deficiency that the residual mean can only reflect the average operation deviation. The zero-prevention coefficient can prevent the denominator from returning to zero when the residual mean infinitely approaches 0, ensuring the stable operation of the algorithm and preventing computational crashes. The residual fluctuation characteristics are used as an independent identification dimension to participate in subsequent feature fusion, enriching the basis for fatigue judgment and reducing the probability of misjudgment caused by single indicator evaluation.

[0018] In conjunction with the first aspect, in certain implementations of the first aspect, the residual skewness is calculated, including: Calculate the difference between the time residual of each term in the time residual sequence and the mean residual, and then calculate the cube of each difference to obtain the third-order deviation value of each term. The skewness numerator is calculated based on the ratio of the sum of all third-order deviations to the total number of sequence samples. The skewness denominator is calculated based on the result of the cube power operation of the standard deviation of the time-consuming residual sequence; The residual skewness is calculated based on the ratio of the skewness numerator to the skewness denominator.

[0019] In this embodiment, the indicator can characterize the asymmetric characteristics of the overall distribution of time-consuming residuals: when operators enter a state of fatigue, they are more likely to exceed the time limit for extended periods, the number and magnitude of positive residuals increase significantly, the residual distribution shifts positively, and the skewness value increases significantly. This can identify one-sided time-consuming abnormal behaviors that cannot be reflected by the mean or coefficient of variation. The addition of statistical features in the distribution morphology dimension enriches the criteria for fatigue identification and improves the sensitivity to changes in mild and latent fatigue. The entire calculation relies only on basic exponentiation, addition, and division, resulting in low computational complexity. This adapts to the lightweight computational needs of POS terminals, and when combined with other statistical features, it can further reduce fatigue assessment errors.

[0020] In conjunction with the first aspect, in certain implementations of the first aspect, the fatigue level of the worker is determined by judging the comprehensive fatigue coefficient based on a threshold condition, including: If the overall fatigue coefficient is lower than the first threshold, then the fatigue level of the worker is determined to be the first level. If the overall fatigue coefficient is equal to or higher than the first threshold and lower than the second threshold, then the fatigue level of the worker is determined to be the second level. If the overall fatigue coefficient is equal to or higher than the second threshold and lower than the third threshold, then the fatigue level of the worker is determined to be the third level. If the comprehensive fatigue coefficient is equal to or higher than the third threshold, then the fatigue level of the worker is determined to be the fourth level. The first threshold, the second threshold, and the third threshold increase sequentially.

[0021] In this embodiment, the comprehensive fatigue coefficient is a continuous value. Directly using this value makes it difficult to intuitively distinguish the severity of fatigue. This solution transforms the continuous quantitative indicator into a standardized and distinguishable discrete fatigue level through a hierarchical threshold range. The progressively increasing threshold rules have a clear logic, clearly distinguishing four states: no fatigue, mild fatigue, moderate fatigue, and severe fatigue. This facilitates the system in configuring differentiated control strategies for different levels, such as pop-up prompts for mild fatigue and scheduling shifts for rest for severe fatigue, solving the problem that a single value cannot be implemented for hierarchical management. The unified grading judgment logic ensures consistent evaluation standards across all stores, avoiding the standard confusion caused by subjective human judgment, and making fatigue control measures executable.

[0022] In conjunction with the first aspect, some implementations of the first aspect also include: When the fatigue level of the worker is determined to be level two or level three, the baseline weights corresponding to the residual mean, residual coefficient of variation, positive residual percentage, and residual skewness are obtained. The initial value of the amplification weight of the residual mean is calculated based on the product of the baseline weight of the residual mean and the preset amplification factor. The initial value of the amplification weight of the residual coefficient of variation is calculated based on the product of the baseline weight of the residual coefficient of variation and the amplification factor. The initial values ​​of the amplification weights for the residual mean, the residual coefficient of variation, the baseline weights for the proportion of positive residuals, and the baseline weights for the residual skewness are normalized to obtain the amplification weights corresponding to the residual mean, residual coefficient of variation, proportion of positive residuals, and residual skewness, respectively. A weighted fusion operation is performed based on the amplification weights corresponding to the residual mean, residual coefficient of variation, positive residual proportion, and residual skewness to obtain the comprehensive fatigue coefficient. The amplification factor is greater than 1.

[0023] In this embodiment, when employees are in the mild or moderate fatigue range, the most direct manifestations of fatigue are deviations in operating time and disordered operation. Amplifying the weights of the two types of features can increase their proportion in the overall fatigue coefficient, strengthening the ability to capture the two core fatigue signals: operation deviation and disordered operation. The proportion of positive residuals and the weight of residual skewness remain unchanged to avoid excessive weight amplification and the introduction of invalid noise. Unified normalization processing can constrain the relative proportions of all feature weights, preventing weight imbalance from causing distortion of the overall fatigue coefficient. Calculating the overall fatigue coefficient based on the adaptively adjusted amplified weights can improve the sensitivity of identifying mild and moderate fatigue stages, promptly capture the trend of deepening fatigue, facilitate early intervention, and prevent continuous fatigue accumulation from causing operational errors.

[0024] Secondly, a terminal device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the operator fatigue assessment method based on operation logs as described above.

[0025] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more apparent, specific embodiments of this application are given below. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a schematic flowchart illustrating the operator fatigue assessment method based on operation logs, as described in this application.

[0028] Figure 2 This is a schematic flowchart illustrating the calculation of the actual unit difficulty time in the operator fatigue state assessment method based on operation logs in this application embodiment.

[0029] Figure 3 This is a schematic flowchart illustrating the generation of the standard time consumption model using linear regression in the operator fatigue state assessment method based on operation logs, as described in this application embodiment.

[0030] Figure 4 This is a schematic diagram illustrating the calculation of the residual variation coefficient in the operator fatigue state assessment method based on operation logs according to an embodiment of this application.

[0031] Figure 5 This is a schematic diagram illustrating the calculation of residual skewness in the operator fatigue state assessment method based on operation logs according to an embodiment of this application. Detailed Implementation

[0032] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.

[0033] In this application's embodiments, prefixes such as "first" and "second" are used merely to distinguish different descriptive objects and do not limit the position, order, priority, quantity, or content of the described objects. Furthermore, in the description of this embodiment, unless otherwise stated, "multiple" means two or more.

[0034] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0035] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system.

[0036] In a retail checkout scenario, the process for a cashier to complete a single transaction is as follows: After the customer selects several items, they submit them to the checkout counter. The cashier picks up each item in turn, locates the corresponding barcode area on the item's surface, and scans the barcode one by one using the barcode scanner. The system records the operation information for each item in real time. After all items have been scanned, the cashier verifies the order details and clicks to confirm payment. The customer pays, and the transaction is complete.

[0037] When cashiers work continuously for extended periods and become fatigued, their reaction speed slows down significantly, and their operational accuracy drops drastically. This makes them highly susceptible to various errors during operations, such as missing product scans, miscalculation of amounts, incorrect change, and mishandling of refund procedures. These problems lengthen customer waiting times, reduce overall store checkout efficiency, severely damage the customer experience, and frequent accounting errors can lead to direct financial losses for the store, increasing daily reconciliation and customer complaint handling costs. Therefore, there is a real need to conduct routine monitoring of cashier fatigue.

[0038] In existing technologies, fatigue detection for cashiers mainly falls into two categories. The first is fatigue detection based on physiological signal acquisition. This method relies on specialized hardware devices such as pressure sensors, EEG acquisition devices, terahertz bio-radar, and heart rate wristbands as data acquisition carriers. The hardware continuously collects physiological characteristic parameters of the cashier during their work, including heart rate changes, respiratory rate, hand grip strength, and EEG fluctuations. Based on the physiological laws of human fatigue, various physiological signals will show stable and differentiated characteristics when a person is energetic and fatigued. By inputting the real-time collected physiological parameters into a preset biometric model and comparing the normal range and fatigue range of physiological indicators, the current fatigue level of the cashier can be determined. The second method is fatigue detection based on visual image processing. This solution continuously collects real-time images of the cashier's face using a camera attached to the checkout counter. It uses image segmentation and key point recognition algorithms to locate key areas such as the eyes and facial contours, and extracts visual fatigue features such as blinking frequency, eyelid closure duration, head drooping degree, and blank facial expression frame by frame. Based on a trained image classification model, the extracted facial visual features are quantified and scored, and the cashier's fatigue level is divided according to the score range to complete the fatigue judgment.

[0039] Both of the aforementioned fatigue detection solutions suffer from inherent limitations due to their own data acquisition principles, making large-scale deployment difficult. Regarding the physiological signal acquisition solution: Firstly, its recognition logic relies entirely on dedicated hardware continuously collecting human physiological data to function properly. Without corresponding sensors, physiological indicators cannot be obtained. This fundamental principle dictates that stores must additionally purchase and deploy a complete set of data acquisition hardware in bulk, resulting in high hardware procurement and regular equipment maintenance costs. Secondly, physiological data acquisition requires sensors to be in direct contact or close-range with the human body's hands, head, etc. Wearable devices restrict cashiers' hand movements when scanning codes and handling goods, and the close contact between the device and the body causes discomfort, leading to operational interference and low acceptance among employees from the perspective of the data acquisition medium. For visual image processing solutions: First, image recognition algorithms rely on stable and uniform facial lighting as the basis for recognition. Store checkout areas are prone to lighting variations such as backlighting, strong light, and occlusion, and fluctuations in image quality can directly lead to the failure of extracting key points on the eyes and face. The underlying image acquisition principle makes the detection accuracy of this solution highly susceptible to environmental interference. Second, this solution requires continuous capture and storage of complete facial images of cashiers for feature extraction. Facial images are sensitive personal privacy data, and the underlying logic of continuously collecting faces inherently carries the risk of privacy leaks, easily triggering resistance from cashiers. Furthermore, both types of solutions require additional external acquisition devices as data sources, and the hardware-dependent underlying characteristics prevent low-cost, large-scale deployment in numerous offline stores.

[0040] To address the above issues, this application provides a method for assessing worker fatigue based on operation logs, and the application of this method on a terminal device.

[0041] Based on the above application scenarios, this application provides a method for assessing worker fatigue status based on operation logs.

[0042] Figure 1 This is a schematic flowchart illustrating a method for assessing worker fatigue based on operation logs, as provided in this embodiment. The method includes the following steps.

[0043] S1. Obtain the transaction processing time for the target transaction period and the total difficulty coefficient of all traded goods within the target transaction period, and calculate the actual time consumed per unit of difficulty.

[0044] See Figure 2 In one embodiment of this application, obtaining the transaction processing time of the target transaction period and the total difficulty coefficient of all traded goods within the target transaction period, and calculating the actual time consumed per unit of difficulty, includes: Obtain the start time and end time of the transaction corresponding to the target transaction period, and calculate the transaction processing time of the target transaction period based on the difference between the end time and the start time. Based on a pre-set database of product difficulty coefficients, the difficulty coefficients of each product within the target transaction period are obtained, and the difficulty coefficients of all products are summed to obtain the total difficulty coefficient of a single transaction. The actual time consumed per unit of difficulty is calculated based on the ratio of the transaction processing time to the total difficulty coefficient of a single transaction.

[0045] It should be noted that when the cashier picks up the first item and triggers the first barcode scanning operation, the POS system simultaneously records the current system time as the transaction start time. The system records the current system time as the transaction completion time the moment all items are scanned, the cashier clicks the confirm payment button, and the order is successfully submitted. No manual entry of time information is required.

[0046] When calculating the transaction processing time for the target trading period, the system retrieves the stored timestamps of the transaction start and end times. Both times are standard Unix timestamps from the POS terminal, using milliseconds as the minimum unit of time. The difference between the timestamp corresponding to the transaction end time and the timestamp corresponding to the transaction start time is the total millisecond duration of the complete transaction. The milliseconds can be converted to seconds as needed for further calculations; the converted duration is the transaction processing time for the target trading period. , .

[0047] This calculation method only counts the total effective operation time of the cashier from picking up the goods, finding the barcode, scanning each item, to confirming payment. It automatically eliminates idle intervals that are not within the scope of the cashier's product operation, such as waiting for customers to select goods, scan the barcode to pay, and wait for cash change. The resulting transaction processing time can accurately reflect the actual operation time of the cashier for the order goods, avoiding irrelevant waiting time from interfering with the accuracy of subsequent time indicators.

[0048] The product difficulty coefficient database, which is pre-built and stored on the local server of the POS terminal, is a structured mapping data table. The database uses the unique product code as the primary key. Each product code is bound to the corresponding product category, difficulty coefficient value, and difficulty labeling basis. The database content is pre-calibrated, entered, and solidified offline according to the actual POS operation complexity of various products. It can be supplemented and maintained at any time according to the new product categories added to the store.

[0049] The database is divided into multiple levels based on the product's dimensions, weight, barcode placement, and the complexity of the scanning operations. The specific labeling rules are as follows: The first category is ordinary small items, typically including chewing gum, lighters, stationery, and bagged snacks. The difficulty level is usually set at 1.0. These items are small in size, and cashiers can easily grab them with one hand. The barcodes are exposed and easy to locate. They can be identified by simply pointing them at the barcode scanner. The operation threshold is the lowest, so a basic difficulty level is assigned to them.

[0050] The second category is medium-sized irregularly shaped packaged goods, typically including shampoo, boxed milk, bottled beverages, canned products, etc., with a uniform difficulty coefficient usually set at 1.5. These goods are irregularly shaped and relatively large, making it impossible to easily search for barcodes with one hand. Both hands are required to flip and rotate the goods to search for the barcode location. During the scanning process, it is often necessary to repeatedly focus 2 to 3 times before the barcode can be successfully scanned, making the overall operation time longer. Therefore, the difficulty coefficient is higher than that of ordinary small items.

[0051] The third category consists of large, heavy items or goods with barcodes located on the bottom. Typical examples include cases of drinking water, large bottles of cooking oil, and large-capacity bottles of daily necessities. The difficulty level is usually set between 2.5 and 3.0. These items are heavy and difficult to handle. The barcodes are mostly printed in hidden positions on the bottom or back of the box. Cashiers need to move and lift the heavy items and adjust the placement angle multiple times to align them with the scanning area. The operation process is cumbersome and physically demanding. This is the type of goods with the highest operational burden in the checkout scenario, so the highest difficulty level is set.

[0052] During a single transaction settlement, the POS system retrieves the codes of all items in the current order, matches them line by line against preset difficulty coefficient values ​​in the database, and sums up the difficulty coefficients corresponding to all items in an order to finally calculate the total difficulty coefficient of the transaction. This is used to quantify the overall operational burden of the order.

[0053] The calculated transaction processing time is used as the dividend, and the total difficulty coefficient of a single transaction obtained by summing the difficulty coefficients of all goods is used as the divisor. The two are then divided to obtain the ratio, and the final result is the actual time consumed per unit of difficulty. , .

[0054] Actual unit difficulty time refers to the operation time required for a cashier to complete one standardized unit of operational difficulty. The following two examples of cashier orders illustrate its core function: Order 1 involves a single stick of chewing gum, a common small item. The preset single-item difficulty coefficient is 1.0, and the total difficulty coefficient is 1. The cashier completes the entire scanning and payment process in 3 seconds. Therefore, the actual unit difficulty time = 3 ÷ 1 = 3 seconds / unit. Order 2 involves a case of bottled water, a large and heavy item. The preset single-item difficulty coefficient is 2.8, and the total difficulty coefficient is 2.8. This type of item is difficult to handle, and the barcode is hidden low, requiring multiple adjustments to the angle for successful scanning. The overall operation takes longer, totaling 8.4 seconds. Therefore, the actual unit difficulty time = 8.4 ÷ 2.8 = 3 seconds / unit. Order 2 took significantly longer than Order 1. Judging solely by total transaction time could easily lead to the mistaken conclusion that the cashier's operation was slower. However, the time taken per unit of difficulty was exactly the same for both orders, demonstrating that the cashier's efficiency in both orders did not decrease. Therefore, this normalized indicator completely eliminates the natural time differences caused by variations in the number, size, and complexity of barcode scanning between different orders. It avoids misinterpreting increased time due to the complexity of the product itself as staff fatigue, and purely quantifies the cashier's operational status, providing a unified, objective, and comparable standardized basis for subsequent fatigue assessment.

[0055] In this embodiment, the actual unit difficulty time is obtained by dividing the total transaction processing time by the total order difficulty coefficient. The total order operation time is coupled with the overall order operation load for calculation, which eliminates the influence of two types of interference variables on the time data from the underlying mathematical logic: First, for orders with multiple items, the more items there are, the more frequent the scanning action will be, and the original total time will continue to increase as the number of items increases; Second, for large, irregularly shaped, or complex items that require weighing and verification, there are more steps involved in finding the barcode, moving and placing, and verifying and registering each item, which will occupy a longer operation time for each item.

[0056] This solution pre-determines a fixed difficulty coefficient based on the complexity of the actual checkout operations for each item, and then accumulates these coefficients to obtain the total difficulty coefficient for the entire order. The total difficulty coefficient accurately represents the overall operational burden of an order. The calculation method of dividing the total time by the total operational burden is equivalent to distributing the entire operational load evenly across each standardized difficulty unit. The final output unit time eliminates the inherent time deviations caused by the total number of items in the order and the difficulty of operating individual items.

[0057] If the original total transaction time is used directly as the evaluation criterion, the total time will be influenced by order size and product category, making it impossible to distinguish whether the increase in time is due to excessive product handling load or cashier's slow reaction or physical and mental fatigue. However, the actual unit difficulty time after conversion only retains the cashier's individual operation speed characteristics, completely eliminating the external impact of store business load. When using this data for subsequent calculations, each group of transaction samples has equal horizontal comparison conditions, avoiding the problem of fatigue misjudgment from the data source, and significantly improving the accuracy and reliability of subsequent cashier fatigue status assessment results.

[0058] S2. Input the total difficulty coefficient into the pre-built standard time consumption model and output the predicted time consumption per unit of difficulty.

[0059] Specifically, the total difficulty coefficient obtained by summing up individual orders is input into a pre-built standard time consumption model. This model is trained on historical transaction data accumulated when cashiers are in a good physical and mental state and not fatigued. Internally, the model establishes a correspondence between different operational loads and standard operating rates. Operational load refers to the total difficulty coefficient corresponding to the cashier processing an order when fatigue-free, while standard operating rate refers to the unit difficulty time corresponding to the cashier's high energy level. Upon receiving the input parameter of the current order's total difficulty coefficient, the model can retrieve the corresponding data and output the predicted unit difficulty time under that operational load. The predicted unit difficulty time is the theoretical unit difficulty time that a cashier should achieve when processing orders with the same operational load without fatigue. This is used as a benchmark value for difference calculation and comparative analysis with the actual unit difficulty time.

[0060] In one embodiment of this application, the construction of the standard time consumption model includes: Obtain the transaction processing time for multiple consecutive target transaction periods during the initial stage of the operation, as well as the total difficulty coefficient for all commodities within each target transaction period; The transaction processing time and total difficulty coefficient corresponding to multiple target transaction periods are integrated to form a benchmark sample dataset; The model is trained using the benchmark sample dataset to obtain a standard time consumption model with the total difficulty coefficient as input and the time consumption per unit of difficulty as output.

[0061] Specifically, the process begins by collecting multiple consecutive transaction data from the cashier's initial period of employment. Typically, the first 20 transactions completed after the cashier officially starts work are selected, corresponding to various target transaction time periods. The transaction processing time for each transaction is extracted, and the total difficulty coefficient for all items in each order is calculated. The corresponding transaction processing times and total difficulty coefficients are then paired and aggregated in batches to construct a clean benchmark dataset. This dataset is entirely taken from the initial working phase when the cashier is energetic and has not yet experienced work fatigue, ensuring the data is not affected by slowed operations due to physical or mental exhaustion. Subsequently, the model is trained using this benchmark dataset to uncover the inherent correlation between the total difficulty coefficient and the time consumed per unit of difficulty. Finally, a standard time consumption model is trained, using the total difficulty coefficient of the order as the input variable and the predicted time consumed per unit of difficulty as the output. This model accurately represents the inherent operational efficiency of the cashier in a fatigue-free state, providing a personalized benchmark assessment effect.

[0062] It should be noted that this solution adopts a personalized construction logic of one model per person and continuous dynamic updates: whenever a cashier arrives at their post to start work, the system will first collect the data of the first 20 transactions completed in the early part of their shift to generate a standard time consumption model for that day.

[0063] As on-the-job operations progress, cashiers' proficiency in retrieving goods, searching barcodes, and scanning for payment will gradually improve through continuous practice, resulting in slight variations in overall operational efficiency. If the fixed model generated at the beginning of the shift is consistently used, it will be unable to accurately reflect the cashier's current, fatigue-free operational level. Therefore, the system continuously updates throughout the cashier's shift, constantly collecting valid transaction sample data generated when the cashier is in a good physical and mental state and has not yet shown signs of fatigue. This allows for continuous iteration and optimization of its proprietary standard time consumption model, ensuring that the model always closely matches the cashier's basic operational speed during the day.

[0064] The continuously updated personal model will serve the cashier's calculation of all cashier orders for the day. The total difficulty coefficient of each order calculated after the cashier's shift can be input into the updated personal standard time consumption model, which will output the corresponding predicted unit difficulty time consumption, providing a benchmark reference that fits the individual's actual work ability on the day for subsequent time consumption difference calculation and fatigue level judgment.

[0065] In this embodiment, the cashier is not yet fatigued from long hours of continuous work at the beginning of the shift, and is in good physical and mental condition. There are no issues of slowed movements or decreased concentration due to fatigue. The transaction processing time and total order difficulty coefficient samples collected at this stage can objectively and realistically restore the cashier's inherent scanning, picking up, and settlement operation rhythm under fatigue-free working conditions. The exclusive model generated based on this set of pure samples fully incorporates the individual differences in operation speed, hand movement habits, scanning focus preferences, and other characteristics of different people, and can accurately adapt to the exclusive work benchmark of a single person.

[0066] If a uniform standard time consumption model is used to judge all cashiers, the model can only set a fixed operation rate threshold. For cashiers with a naturally slow movement rhythm and meticulous scanning habits, their inherent normal time consumption will be higher than the general standard threshold. The system will mistakenly identify the person's own operation characteristics as fatigue and slowing down. However, this solution abandons the global uniform standard and uses the cashier's own historical data in a fatigue-free state during their shift as the only comparison benchmark. This eliminates the risk of misjudgment caused by the inherent differences in the person's operation from the root of the comparison benchmark.

[0067] Meanwhile, the model continuously absorbs effective transaction data from the cashier's most energetic periods throughout the shift, iterating and updating to consistently match the cashier's real-time basic operational efficiency on duty, incorporating minor daily changes in proficiency into the benchmark. Subsequently, the real-time total difficulty coefficient of orders is input into the dynamically updated personalized model, and the output predicted time per unit of difficulty is a purely theoretical standard time, excluding individual operating habits and daily proficiency variations. When the difference between this value and the cashier's actual time per unit of difficulty is calculated, the final residual time only reflects the decrease in operating speed caused by physical and mental fatigue, without incorporating irrelevant variables such as innate characteristics or proficiency fluctuations. This rigorously defines the criteria for fatigue judgment from the underlying data comparison logic, significantly improving the accuracy and rationality of cashier fatigue assessment results.

[0068] See Figure 3 In one embodiment of this application, the model training is implemented using linear regression, including: Based on the benchmark sample dataset, calculate the average total difficulty coefficient and the average time per unit difficulty for all samples; Based on the average total difficulty coefficient and the average time taken per unit of difficulty, and relying on the benchmark sample dataset, the slope coefficient of the linear regression model is calculated. Based on the slope coefficient, the average total difficulty coefficient, and the average time consumed per unit of difficulty, the intercept coefficient of the linear regression model is obtained. Based on the slope coefficient and the intercept coefficient, the standard time consumption model is constructed and generated.

[0069] Specifically, the process begins by retrieving the previously integrated benchmark dataset. Each set of data in this dataset corresponds to a total difficulty coefficient and the actual time spent per unit of difficulty. The entire dataset is then iterated through, and the arithmetic mean of the total difficulty coefficient and the arithmetic mean of the time spent per unit of difficulty are calculated for all samples. Subsequently, using these two means as a basis, and combining them with each paired set of data from the benchmark dataset, the slope coefficient of the linear regression equation is obtained according to the rules of linear regression. Then the obtained slope coefficient Substituting the average total difficulty coefficient and the average time per unit of difficulty into the linear regression intercept calculation formula, the intercept coefficient corresponding to the linear regression model is obtained. Finally, the slope coefficients after the solution is obtained. With intercept coefficient By combining these equations, a complete univariate linear regression equation is constructed. This equation is the final trained standard time consumption model. The model takes the total difficulty coefficient of the order as the input variable and outputs the corresponding predicted unit difficulty time consumption.

[0070] The linear regression equation for the standard time-consuming model is: ; in, The time required to predict the unit of difficulty.

[0071] In this embodiment, when employees are in a stable, fatigue-free working state, the overall operational load of an order, i.e., the total difficulty coefficient and the time consumed per unit difficulty, exhibits a stable positive linear variation. The higher the total difficulty, the more uniformly the standard operation time increases. Linear regression can accurately fit the inherent linear mapping relationship between the two. The overall computational architecture of linear regression is simple, relying only on a few basic mathematical operations such as mean calculation, slope solution, and intercept derivation to complete the model building. During the model training phase, only basic arithmetic operations on the sample data are required. The subsequent reasoning process of deriving the total difficulty coefficient from the POS terminal to predict the time consumed per unit difficulty involves extremely low computational load and does not generate huge matrix operations or multi-layer network iteration computation overhead. Compared with complex deep learning models such as neural networks, the overall computing power consumption is greatly reduced. It can be adapted to lightweight deployment and operation of various POS terminals in supermarkets and convenience stores with ordinary processors, and can stably complete modeling and real-time calculation without the need for high-performance hardware equipment.

[0072] The entire fitting process automatically generates the core parameters of slope and intercept based on the baseline sample dataset collected at the beginning of the cashier's shift. This eliminates the need for staff to manually set thresholds or adjust various hyperparameters based on experience, thus avoiding subjective biases caused by manual calibration. The slope parameter characterizes the inherent time increase for employees handling a unit of operational difficulty, while the intercept parameter compensates for the inherent preparation time during scanning and retrieving goods. These two parameters work together to perfectly replicate the unique operating rhythm and behavioral habits of each cashier. Unlike the crude method of uniformly estimating time using a fixed multiplier, this approach can output a personalized theoretical standard time for each individual, maximizing the difference between the predicted unit difficulty time and the actual time spent working without fatigue. With improved accuracy in predicting the baseline time, the residual value obtained from calculating the actual unit difficulty time and the predicted unit difficulty time will more closely match the actual operational delay caused by fatigue, reducing data bias from the calculation source and ultimately effectively reducing the overall assessment error in identifying cashier fatigue.

[0073] In one embodiment of this application, the slope coefficient of a linear regression model is calculated based on the average total difficulty coefficient and the average time per unit of difficulty, and relying on a benchmark sample dataset, including: Based on the difference between the total difficulty coefficient and the mean total difficulty coefficient of each sample in the benchmark sample dataset, and the difference between the unit difficulty time and the mean unit difficulty time of each sample, the product of the two sets of differences is calculated for each sample, and all the products are summed to obtain the total numerator. The total denominator is obtained by summing the squares of the differences between the total difficulty coefficient and the mean total difficulty coefficient of each sample in the benchmark dataset. The slope coefficient of the linear regression model is calculated based on the ratio of the total numerator to the total denominator. Based on the slope coefficient, the average total difficulty coefficient, and the average time consumed per unit of difficulty, the intercept coefficient of the linear regression model is obtained, including: The intermediate calculated value is calculated based on the product of the slope coefficient and the average of the total difficulty coefficient; The intercept coefficient of the linear regression model is calculated based on the difference between the average time taken per unit of difficulty and the intermediate calculated value.

[0074] Specifically, this involves calculating the slope coefficient of the linear regression model. During the process, the complete benchmark dataset was retrieved, and the arithmetic mean of the total difficulty coefficient of all samples was calculated. The arithmetic mean of the time taken per unit of difficulty for all samples. .

[0075] Take out each group of sample data in the dataset one by one, and calculate the difference between the total difficulty coefficient of a single sample and the average of the total difficulty coefficients. The difference between the time taken per unit of difficulty for a single sample and the average time taken per unit of difficulty. ), which involves multiplying the differences between two sets of samples corresponding to the same sample, i.e. .

[0076] The products calculated from each sample are summed sequentially, and the final sum is the total numerator required for slope calculation. The total numerator is... .

[0077] Then, iterate through all samples, calculating the square of the difference between the total difficulty coefficient and the mean of the total difficulty coefficient for each group. Sum all the squared results to obtain the total denominator for the slope calculation, and the total numerator is... .

[0078] Dividing the total numerator by the total denominator yields the slope coefficient of the linear regression model. , .

[0079] The slope coefficient is obtained by solving. Then, the intercept coefficient was developed. Calculation of the slope coefficient. Multiply by the average of the total difficulty coefficients Calculate the intermediate values; then use the average time taken per unit of difficulty. Subtracting this intermediate calculated value, the final difference is the intercept coefficient of the linear regression model. , .

[0080] In this embodiment, the slope and intercept are calculated using the classical least squares solution logic. The calculation process traverses all valid transaction samples in the benchmark dataset, comprehensively incorporating the total difficulty coefficient and unit difficulty time information for each group of samples. It performs an overall fitting operation based on the overall distribution trend of all samples, ensuring that all samples have equal weight in the parameter solution process. This allows for a complete understanding of the inherent variation patterns between operational load and time under fatigue-free conditions, ensuring that the final slope and intercept parameters accurately reflect the cashier's individual pickup, scanning, and settlement operation rhythm and work habits. The entire parameter solution process only includes the four basic arithmetic operations: subtraction, multiplication, squaring, accumulation, and division. It avoids complex calculation steps such as gradient iteration and multidimensional matrix operations, resulting in simple calculation logic, low computational load, and compatibility with the lightweight linear regression architecture. It can efficiently complete parameter calculation, real-time model building, and iterative updates on POS terminals with ordinary hardware configurations, and can run stably without the need for high-performance computing hardware. The slope coefficient and intercept coefficient obtained through this step-by-step mathematical calculation method have higher accuracy. The standard time consumption model built based on the two sets of parameters outputs a predicted unit difficulty time that closely matches the actual working level of cashiers when they are energetic, effectively reducing the deviation between the actual unit difficulty time and the predicted unit difficulty time. After the accuracy of the time consumption residual calculation is guaranteed, the residual value only reflects the decline in operation rate caused by physical and mental fatigue, without introducing calculation errors caused by the calculation process. This greatly reduces the interference of irrelevant factors on fatigue feature extraction, and further improves the accuracy and reliability of the subsequent cashier fatigue status assessment results.

[0081] S3. Based on the difference between the actual unit difficulty time and the predicted unit difficulty time, calculate the time residual for the current target transaction period.

[0082] Specifically, the actual unit difficulty time calculated from the current order. And the predicted unit difficulty time output after inputting the total difficulty coefficient of the order into the personal standard time consumption model. The time residual for the current target trading period is calculated by subtracting the predicted time consumption per unit of difficulty from the actual time consumption per unit of difficulty. , .

[0083] S4. Obtain the time-consuming residuals corresponding to multiple consecutive target transaction periods and construct a time-consuming residual sequence.

[0084] Specifically, the time-consuming residuals calculated from each of multiple consecutive target transaction periods during the shift are collected sequentially. All time-consuming residuals are sequentially arranged and summarized according to the chronological order of the transactions to construct a time-consuming residual sequence. .

[0085] This sequence is typically constructed by selecting the time residuals corresponding to 20 consecutive transactions. .

[0086] It should be noted that if the calculated value reaches 5 times the historical normal unit difficulty time during the calculation of unit difficulty time, the transaction will be judged as abnormal data, the system will no longer perform time residual calculation for that transaction period, and this set of data will not be included in the construction scope of the time residual sequence.

[0087] S5. Statistical features are extracted from the time-consuming residual sequence, and the residual mean, residual coefficient of variation, positive residual ratio, and residual skewness are calculated respectively.

[0088] Specifically, the residual values ​​in the time-consuming residual sequence are summed one by one to obtain the total residual. Then, the total residual is divided by the total number of residual data in the sequence. The final result is the residual mean. .

[0089] To determine the percentage of positive residuals in the time-consuming residual sequence, divide the number of positive residuals by the total number of data points in the sequence. .

[0090] See Figure 4 In one embodiment of this application, calculating the residual coefficient of variation includes: Based on the time-consuming residual sequence, the standard deviation corresponding to the time-consuming residual sequence is calculated; The denominator of the coefficient of variation is calculated by summing the absolute value of the residual mean with the preset zero-prevention coefficient. The residual coefficient of variation is calculated based on the ratio of the standard deviation to the denominator of the coefficient of variation.

[0091] Specifically, the standard deviation of the time-consuming residual sequence is calculated. Suppose that the time-consuming residual sequence typically contains 20 residual data points, which are as follows: The mean of the residuals is ; Standard deviation .

[0092] Then, the absolute value of the mean residual is calculated. The absolute value is compared with the preset zero-prevention coefficient. The sums are taken as the denominator for calculating the coefficient of variation. The coefficient excluding zero is excluded. It is usually set to 0.001.

[0093] Finally, divide the calculated standard deviation by the denominator value mentioned above; the ratio of the two is the residual variation coefficient corresponding to the time-consuming residual sequence. , .

[0094] In this embodiment, the conventional residual mean can only reflect the overall average deviation of all time-consuming residuals, and can only characterize the average lag of the overall operation time compared to the benchmark level. It cannot reflect the fluctuation of time between each transaction. The coefficient of variation is obtained by combining the residual standard deviation with the mean, eliminating the scaling effect caused by the magnitude of the residual mean itself. Regardless of whether the residual mean is large or small, the magnitude of operation fluctuation can be compared horizontally, and the stability of the cashier's operation rhythm throughout the entire process can be independently and objectively quantified. When the staff gradually becomes fatigued, their concentration decreases, and their hand coordination deteriorates. The actions of picking up goods, scanning, and settling become sometimes slow and sometimes hurried, and the fluctuation of the time of each transaction increases significantly. The dispersion of the residual continues to rise, and the value of the coefficient of variation increases accordingly. It can accurately capture the disordered fluctuation characteristics of operation caused by fatigue, and effectively make up for the shortcoming of relying solely on the residual mean for evaluation, which cannot identify the disorder of operation rhythm. When calculating the coefficient of variation, the denominator is composed of the absolute value of the residual mean plus a preset zero-prevention coefficient. When the cashier is in excellent condition throughout the process, and the time consumed is almost in line with the benchmark level, the residual mean approaches zero, preventing division errors and program interruptions caused by a denominator of 0. This ensures the algorithm can operate stably and continuously under various working conditions, eliminating computational crashes. The coefficient of variation, which characterizes the fluctuation pattern of time consumption, is used as an independent feature, fused with multiple parameters such as the residual mean, the proportion of positive residuals, and residual skewness. This expands the criteria for fatigue state identification, overcoming the limitations of single statistical indicators, effectively reducing fatigue misjudgments caused by accidental operational delays or unexpected situations, and further improving the reliability of fatigue detection results.

[0095] See Figure 5 In one embodiment of this application, calculating the residual skewness includes: Calculate the difference between the time residual of each term in the time residual sequence and the mean residual, and then calculate the cube of each difference to obtain the third-order deviation value of each term. The skewness numerator is calculated based on the ratio of the sum of all third-order deviations to the total number of sequence samples. The skewness denominator is calculated based on the result of the cube power operation of the standard deviation of the time-consuming residual sequence; The residual skewness is calculated based on the ratio of the skewness numerator to the skewness denominator.

[0096] Specifically, iterate through each residual data point in the time-consuming residual sequence and calculate the individual time-consuming residual and the residual mean for each residual. The difference between the values ​​is calculated by cubically powering each difference to obtain the third-order deviation value for each data point. All third-order deviation values ​​of the sequence are summed and the sum is divided by the total number of samples in the time-consuming residual sequence to calculate the skewness numerator. The standard deviation of the time-consuming residual sequence is cubically powered to obtain the skewness denominator. Finally, the skewness numerator is divided by the skewness denominator, and the ratio of the two is the residual skewness corresponding to the time-consuming residual sequence.

[0097] When the time-consuming residual sequence contains 20 residual data points, the residual skewness .

[0098] In this embodiment, the residual mean only reflects the overall average deviation of the time-consuming residuals, and the coefficient of variation only reflects the overall fluctuation and dispersion of the residual data. Neither can precisely distinguish whether the overall residual distribution is biased towards the positive timeout side or the negative acceleration side, indicating an asymmetrical distribution pattern. As cashiers gradually become fatigued after working for a long time, their concentration decreases and their physical coordination weakens. Occasional speed-up operations resulting in time reduction become rare. More often, there will be slow product retrieval, barcode scanning lag, and sluggish cashier verification, continuously generating large positive timeout residuals. The number and magnitude of positive residuals continue to increase, and the overall distribution of the time-consuming residual sequence tilts in the positive direction. The residual skewness value increases significantly. This indicator can detect unilateral, continuous timeout abnormal operating behaviors that cannot be captured by the mean or the coefficient of variation. The residual skewness adds the data distribution pattern as a new evaluation dimension. Combined with other statistical features such as residual mean, coefficient of variation, and the proportion of positive residuals, it improves the fatigue identification and evaluation system. It can keenly capture subtle changes in operational status caused by mild fatigue and progressive latent fatigue, enhancing the system's sensitivity to the fatigue evolution process. Furthermore, the calculation of residual skewness only involves basic mathematical operations such as difference, cube power, accumulation, and division. The calculation logic is simple, and the computational power consumption is low, making it suitable for lightweight computing scenarios in POS terminals. The fusion of multiple statistical features effectively avoids misjudgments caused by random fluctuations in a single indicator, further reducing the overall error in fatigue state assessment.

[0099] S6. After normalizing the residual mean, residual coefficient of variation, positive residual ratio, and residual skewness, perform a weighted fusion operation to obtain the comprehensive fatigue coefficient.

[0100] Specifically, a min-max normalization algorithm is used to standardize the three statistical features—mean residual, coefficient of variation residual, and skewness residual—in sequence. The historical maximum and minimum values ​​for each feature are retrieved, and the original feature values ​​are linearly mapped to the 0-1 range using the maximum-minimum normalization formula. Furthermore, the historical maximum and minimum values ​​of each feature are continuously updated as the system runs, adapting to the data change patterns of long-term operations. The positive residual percentage itself falls within the 0-1 range, requiring no additional normalization. After this processing, the problems of different dimensions and excessively large differences in numerical ranges among the four types of features are eliminated, and each feature has a unified value standard, allowing for subsequent weighted fusion calculations.

[0101] The weighting coefficients for the four features are manually set in advance by staff, and the weighting ratios can be configured differently according to different working hours of the cashier: During morning and evening peak hours (7:00-9:00, 17:00-19:00), the weights of residual mean, residual coefficient of variation, positive residual percentage, and residual skewness are usually set to 0.2, 0.3, 0.3, and 0.2 respectively; During daytime and evening off-peak hours (9:00-17:00, 19:00-22:00), the weights of the four features are equally distributed, usually 0.25 for each; During late night hours (22:00 to 7:00 the next day), the weights of residual mean, residual coefficient of variation, positive residual percentage, and residual skewness are usually set to 0.45, 0.25, 0.15, and 0.15 respectively.

[0102] During the weighted fusion calculation, the normalized feature values ​​are multiplied by the preset weights for the corresponding time periods, and the four product results are summed. The final summation value is the comprehensive fatigue coefficient.

[0103] S7. Based on the threshold condition, the comprehensive fatigue coefficient is judged to determine the fatigue level of the worker.

[0104] In this embodiment, the solution first calculates the standardized actual unit difficulty time based on the transaction processing time and product difficulty coefficient natively provided in the transaction log. Then, it combines this with a personalized standard time consumption model to output a predicted unit difficulty time adapted to individual work habits. The time residual is then calculated by the difference between the two. This preprocessing method effectively normalizes and eliminates business load disturbances caused by fluctuations in customer traffic at different times and differences in the complexity of different order products. It removes the interference of external business scenario variables on operation time, ensuring that the final time residual focuses only on changes in the operator's own operational state, guaranteeing high reliability and effectiveness of the fatigue assessment data source.

[0105] Building upon this foundation, this solution constructs a residual sequence based on the residuals of continuous transaction time consumption. It further extracts four types of differentiated statistical features: residual mean, residual coefficient of variation, proportion of positive residuals, and residual skewness. These features comprehensively characterize operational behavior distortions under fatigue conditions from multiple dimensions, including overall time consumption deviation, operational rhythm fluctuation stability, proportion of positive timeout behavior, and asymmetric residual distribution, overcoming the limitations of single-dimensional indicators. By normalizing multi-dimensional features and performing time-segmented weighted fusion, a comprehensive fatigue coefficient that accurately quantifies fatigue levels is generated. Combined with multi-level thresholds, a standardized determination of fatigue levels is achieved, enabling complete quantitative reasoning from micro-level operational deviations to macro-level fatigue states.

[0106] The entire assessment system is based on existing transaction and operation logs from the POS terminal, eliminating the need for external hardware such as image capture or physiological sensing devices. This avoids the additional costs associated with hardware procurement, deployment, and maintenance, as well as the privacy risks associated with facial recognition and the interference of wearable devices with normal POS operations. It truly achieves seamless, non-intrusive, and routine on-duty fatigue monitoring. Furthermore, this solution eliminates scene interference through workload normalization and compensates for random errors through multi-feature fusion and complementarity. Compared to traditional methods that rely solely on single-operation-duty-time statistical assessment, this significantly reduces misjudgments caused by business fluctuations and accidental operational deviations, greatly improving the stability and accuracy of fatigue assessment. It can efficiently, in real-time, and accurately identify changes in cashier fatigue status.

[0107] In one embodiment of this application, determining the fatigue level of an operator based on a threshold condition for the comprehensive fatigue coefficient includes: If the overall fatigue coefficient is lower than the first threshold, then the fatigue level of the worker is determined to be the first level. If the overall fatigue coefficient is equal to or higher than the first threshold and lower than the second threshold, then the fatigue level of the worker is determined to be the second level. If the overall fatigue coefficient is equal to or higher than the second threshold and lower than the third threshold, then the fatigue level of the worker is determined to be the third level. If the comprehensive fatigue coefficient is equal to or higher than the third threshold, then the fatigue level of the worker is determined to be the fourth level. The first threshold, the second threshold, and the third threshold increase sequentially.

[0108] Specifically, the values ​​for the first, second, and third thresholds, which are set to increase progressively, are typically 0.8, 0.9, and 0.95, respectively.

[0109] The rules for determining the work status corresponding to the fatigue level are as follows: Level 1 corresponds to the cashier's normal work status; Level 2 corresponds to the cashier's mild fatigue status; Level 3 corresponds to the cashier's moderate fatigue status; and Level 4 corresponds to the cashier's severe fatigue status.

[0110] When a cashier is determined to be in a state of moderate fatigue, the POS terminal automatically implements an interface adaptation and optimization strategy: it enlarges the display of high-frequency operations and high-risk core function buttons such as "Confirm Payment", "Refund for Entire Order" and "Close Transaction", and expands the touch operation area to 1.5 times the original size. At the same time, it automatically blocks and hides non-core promotional pop-ups, advertising pushes and other redundant interface elements, effectively reducing the cashier's visual search pressure and operational decision-making burden, and adapting to the operational capabilities characteristics of a fatigued state.

[0111] When a cashier is determined to be in a state of severe fatigue, the system activates a multi-level risk control warning and mandatory verification mechanism: On the one hand, the POS terminal pushes a high-priority fatigue warning notification to the store manager's mobile terminal and the remote monitoring center to achieve real-time back-end monitoring; on the other hand, in this fatigued state, if the cashier initiates a large refund operation with a single amount greater than 500 yuan, or an operation with a discount ratio greater than 30% for the entire order, the system will forcibly pop up a supervisor password verification pop-up window, requiring management personnel to verify and authorize before the operation can be executed, effectively avoiding the risk of financial misoperation caused by cashiers' inattention and slow reaction, and ensuring the safety of funds in the POS operation.

[0112] In this embodiment, the comprehensive fatigue coefficient is a continuously changing quantitative value. Relying solely on this continuous value cannot intuitively define the severity of cashier fatigue, making it difficult to implement targeted control measures. This solution sets up three progressively increasing threshold intervals, mapping the continuously measured comprehensive fatigue coefficient to four independent discrete fatigue levels. This transforms the abstract numerical quantification result into a clear and standardized fatigue state classification result. The progressively increasing threshold arrangement has clear logical boundaries, accurately identifying the differences in four progressive physical and mental states: normal, mild fatigue, moderate fatigue, and severe fatigue. The system can match corresponding differentiated control strategies such as interface optimization, risk control verification, and early warning reminders based on different fatigue levels, thus overcoming the deficiency of a single continuous value in classifying and handling work states. Meanwhile, the entire set of threshold grading judgment rules is fixed and unified. All cashiers in the store follow the same standard to carry out fatigue assessment, abandoning the previous method of relying on managers' subjective judgment of fatigue level. This eliminates the management chaos caused by inconsistent manual judgment standards, and makes the cashier fatigue monitoring and intervention control process have a unified execution basis, greatly improving the standardization and implementation of cashier staff status management.

[0113] In one embodiment of this application, the method for assessing worker fatigue based on operation logs further includes: When the fatigue level of the worker is determined to be level two or level three, the baseline weights corresponding to the residual mean, residual coefficient of variation, positive residual percentage, and residual skewness are obtained. The initial value of the amplification weight of the residual mean is calculated based on the product of the baseline weight of the residual mean and the preset amplification factor. The initial value of the amplification weight of the residual coefficient of variation is calculated based on the product of the baseline weight of the residual coefficient of variation and the amplification factor. The initial values ​​of the amplification weights for the residual mean, the residual coefficient of variation, the baseline weights for the proportion of positive residuals, and the baseline weights for the residual skewness are normalized to obtain the amplification weights corresponding to the residual mean, residual coefficient of variation, proportion of positive residuals, and residual skewness, respectively. A weighted fusion operation is performed based on the amplification weights corresponding to the residual mean, residual coefficient of variation, positive residual proportion, and residual skewness to obtain the comprehensive fatigue coefficient. The amplification factor is greater than 1.

[0114] Specifically, when the fatigue level of the worker is determined to be Level 2 mild fatigue or Level 3 moderate fatigue, the four statistical characteristics of residual mean, residual coefficient of variation, positive residual percentage and residual skewness are retrieved with their respective pre-set benchmark weights.

[0115] The initial amplification weight of the residual mean is calculated by multiplying the benchmark weight corresponding to the residual mean by a preset amplification factor; the initial amplification weight of the residual coefficient of variation is calculated by multiplying the benchmark weight corresponding to the residual coefficient of variation by the same amplification factor. The preset amplification factor is greater than 1, and in this scheme, it is typically set to 1.5.

[0116] Subsequently, the initial values ​​of the residual mean amplification weight, the initial values ​​of the residual coefficient of variation amplification weight, the baseline weight of the positive residual proportion, and the baseline weight of the residual skewness are all normalized. After normalization, the final amplification weights of each of the four features are obtained. Finally, the normalized amplification weights are used to perform a weighted fusion calculation on the four features of residual mean, residual coefficient of variation, positive residual proportion, and residual skewness to update and obtain a new comprehensive fatigue coefficient.

[0117] In this embodiment, after cashiers enter the mild and moderate fatigue stages, the most direct external manifestations of operational fatigue are a continuous deviation in overall operation time compared to the standard time and chaotic fluctuations in the rhythm of each cashier operation. These two states are quantified by two indicators: residual mean and residual coefficient of variation. This solution introduces an amplification factor greater than 1 to increase the weight of these two core indicators, which can improve the weight allocation ratio of the two in the overall weighted fusion calculation process, amplify the influence of fatigue signals corresponding to time deviation and operation rhythm fluctuations, and effectively enhance the algorithm's ability to capture the two key fatigue features. The positive residual ratio and residual skewness continue to use the initial baseline weights without adjustment, which can avoid redundant interference signals caused by the simultaneous large amplification of multiple indicator weights, prevent random and accidental operation deviations from being over-interpreted as fatigue states, and reduce the interference of invalid noise on the evaluation results. After the initial weight amplification calculation is completed, the four weights are normalized as a whole. This constrains the sum of all feature weights to maintain a reasonable range, stabilizes the relative proportions between the weights, and prevents weight imbalance caused by the unlimited increase of some feature weights. This ensures that the calculated comprehensive fatigue coefficient is accurate and free from distortion. By recalculating the comprehensive fatigue coefficient with the adaptively dynamically adjusted amplified weights, the system's sensitivity to the gradual development of mild to moderate fatigue can be significantly improved. It can accurately perceive the dynamic trend of deepening fatigue, and managers can implement proactive intervention measures such as rest reminders and short-term shift rotations based on the updated assessment results. This prevents the continuous accumulation of fatigue and reduces the probability of cashiers making mistakes or violating risk control regulations due to physical and mental exhaustion.

[0118] This application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the terminal device implements the operator fatigue assessment method based on operation logs as described above.

[0119] Those skilled in the art will recognize that the modules, units, and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0120] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be covered. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for assessing worker fatigue based on operation logs, characterized in that, include: Obtain the transaction processing time for the target transaction period and the total difficulty coefficient of all traded goods within the target transaction period, and calculate the actual time consumed per unit of difficulty; Input the total difficulty coefficient into a pre-built standard time consumption model, and output the predicted time consumption per unit of difficulty; Based on the difference between the actual unit difficulty time and the predicted unit difficulty time, calculate the time residual for the current target transaction period; Obtain the time-consuming residuals corresponding to multiple consecutive target transaction periods, and construct a time-consuming residual sequence; Statistical features are extracted from the time-consuming residual sequence, and the residual mean, residual coefficient of variation, proportion of positive residuals, and residual skewness are calculated respectively. After normalizing the residual mean, residual coefficient of variation, positive residual ratio, and residual skewness, a weighted fusion operation is performed to obtain the comprehensive fatigue coefficient. The fatigue level of the worker is determined by judging the comprehensive fatigue coefficient based on the threshold condition.

2. The method for assessing worker fatigue based on operation logs according to claim 1, characterized in that, Obtain the transaction processing time for the target trading period and the total difficulty coefficient of all traded goods within that period, and calculate the actual time consumed per unit of difficulty, including: Obtain the start time and end time of the transaction corresponding to the target transaction period, and calculate the transaction processing time of the target transaction period based on the difference between the end time and the start time. Based on a pre-set database of product difficulty coefficients, the difficulty coefficients of each product within the target transaction period are obtained, and the difficulty coefficients of all products are summed to obtain the total difficulty coefficient of a single transaction. The actual time consumed per unit of difficulty is calculated based on the ratio of the transaction processing time to the total difficulty coefficient of a single transaction.

3. The method for assessing worker fatigue based on operation logs according to claim 1, characterized in that, The construction of the standard time consumption model includes: Obtain the transaction processing time for multiple consecutive target transaction periods during the initial stage of the operation, as well as the total difficulty coefficient for all commodities within each target transaction period; The transaction processing time and total difficulty coefficient corresponding to multiple target transaction periods are integrated to form a benchmark sample dataset; The model is trained using the benchmark sample dataset to obtain a standard time consumption model with the total difficulty coefficient as input and the time consumption per unit of difficulty as output.

4. The method for assessing worker fatigue based on operation logs according to claim 3, characterized in that, The model training is implemented using linear regression, including: Based on the benchmark sample dataset, calculate the average total difficulty coefficient and the average time per unit difficulty for all samples; Based on the average total difficulty coefficient and the average time taken per unit of difficulty, and relying on the benchmark sample dataset, the slope coefficient of the linear regression model is calculated. Based on the slope coefficient, the average total difficulty coefficient, and the average time consumed per unit of difficulty, the intercept coefficient of the linear regression model is obtained. Based on the slope coefficient and the intercept coefficient, the standard time consumption model is constructed and generated.

5. The method for assessing worker fatigue based on operation logs according to claim 4, characterized in that, Based on the average total difficulty coefficient and the average time per unit of difficulty, and relying on the benchmark sample dataset, the slope coefficient of the linear regression model is calculated, including: Based on the difference between the total difficulty coefficient and the mean total difficulty coefficient of each sample in the benchmark sample dataset, and the difference between the unit difficulty time and the mean unit difficulty time of each sample, the product of the two sets of differences is calculated for each sample, and all the products are summed to obtain the total numerator. The total denominator is obtained by summing the squares of the differences between the total difficulty coefficient and the mean total difficulty coefficient of each sample in the benchmark dataset. The slope coefficient of the linear regression model is calculated based on the ratio of the total numerator to the total denominator. Based on the slope coefficient, the average total difficulty coefficient, and the average time consumed per unit of difficulty, the intercept coefficient of the linear regression model is obtained, including: The intermediate calculated value is calculated based on the product of the slope coefficient and the average of the total difficulty coefficient; The intercept coefficient of the linear regression model is calculated based on the difference between the average time taken per unit of difficulty and the intermediate calculated value.

6. The method for assessing worker fatigue based on operation logs according to claim 1, characterized in that, Calculate the residual coefficient of variation, including: Based on the time-consuming residual sequence, the standard deviation corresponding to the time-consuming residual sequence is calculated; The denominator of the coefficient of variation is calculated by summing the absolute value of the residual mean with the preset zero-prevention coefficient. The residual coefficient of variation is calculated based on the ratio of the standard deviation to the denominator of the coefficient of variation.

7. The method for assessing worker fatigue based on operation logs according to claim 6, characterized in that, Calculating residual skewness includes: Calculate the difference between the time residual of each term in the time residual sequence and the mean residual, and then calculate the cube of each difference to obtain the third-order deviation value of each term. The skewness numerator is calculated based on the ratio of the sum of all third-order deviations to the total number of sequence samples. The skewness denominator is calculated based on the result of the cube power operation of the standard deviation of the time-consuming residual sequence; The residual skewness is calculated based on the ratio of the skewness numerator to the skewness denominator.

8. The method for assessing worker fatigue based on operation logs according to claim 1, characterized in that, The fatigue level of the worker is determined by judging the comprehensive fatigue coefficient based on threshold conditions, including: If the overall fatigue coefficient is lower than the first threshold, then the fatigue level of the worker is determined to be the first level. If the overall fatigue coefficient is equal to or higher than the first threshold and lower than the second threshold, then the fatigue level of the worker is determined to be the second level. If the overall fatigue coefficient is equal to or higher than the second threshold and lower than the third threshold, then the fatigue level of the worker is determined to be the third level. If the comprehensive fatigue coefficient is equal to or higher than the third threshold, then the fatigue level of the worker is determined to be the fourth level. The first threshold, the second threshold, and the third threshold increase sequentially.

9. The method for assessing worker fatigue based on operation logs according to claim 8, characterized in that, Also includes: When the fatigue level of the worker is determined to be level two or level three, the baseline weights corresponding to the residual mean, residual coefficient of variation, positive residual percentage, and residual skewness are obtained. The initial value of the amplification weight of the residual mean is calculated based on the product of the baseline weight of the residual mean and the preset amplification factor. The initial value of the amplification weight of the residual coefficient of variation is calculated based on the product of the baseline weight of the residual coefficient of variation and the amplification factor. The initial values ​​of the amplification weights for the residual mean, the residual coefficient of variation, the baseline weights for the proportion of positive residuals, and the baseline weights for the residual skewness are normalized to obtain the amplification weights corresponding to the residual mean, residual coefficient of variation, proportion of positive residuals, and residual skewness, respectively. A weighted fusion operation is performed based on the amplification weights corresponding to the residual mean, residual coefficient of variation, positive residual proportion, and residual skewness to obtain the comprehensive fatigue coefficient. The amplification factor is greater than 1.

10. A terminal device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the operator fatigue assessment method based on an operation log as described in any one of claims 1 to 9.