A real-time attendance method and system based on cache preheating and hotspot peak shaving

By adopting cache preheating and hot spot peak cutting technology in the attendance system, the performance bottlenecks and stability problems of traditional systems during high concurrent access are solved, and fast response and high reliability attendance data processing is achieved.

CN119248378BActive Publication Date: 2025-03-14COFCO INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411774770.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-14
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

Traditional attendance systems face the risk of sharp increase in database load, response delays and system crashes when handling high concurrent access, and lack effective traffic control, asynchronous processing and exception detection mechanisms.

Method used

Real-time attendance method based on cache preheating and hot spot peak cutting is adopted. By preloading hot spot data to the cache before the system starts or high concurrent access, the number of concurrent access is monitored in real time and the number of target processing is set for asynchronous processing, and abnormality is judged based on the offset coefficient of the data processing response time and alarms.

Benefits of technology

It significantly improves the system response speed, reduces the database load, avoids the risk of system crashes, and ensures stable operation and data accuracy in high concurrent access states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248378B_ABST
    Figure CN119248378B_ABST
Patent Text Reader

Abstract

The present invention proposes a real-time attendance method and system based on cache preheating and hotspot peak shaving. The real-time attendance method based on cache preheating and hotspot peak shaving includes: before the real-time attendance system is started or the number of concurrent accesses exceeds the preset first concurrent access number threshold, pre-loading the hotspot data into the cache area; real-time monitoring of the number of concurrent accesses to the attendance system, when the number of concurrent accesses exceeds the preset second concurrent access number threshold, setting the target concurrent access processing number, and using the target concurrent access processing number to asynchronously process the access request; judging whether there is a data processing anomaly based on the data processing response time offset coefficient corresponding to the employee punch-in data processing response time, and issuing an anomaly alarm when there is a data processing anomaly. The system includes modules corresponding to the steps of the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention provides a real-time attendance method and system based on cache preheating and hot spot peak shaving, belonging to the technical field of attendance data processing. Background Art

[0002] With the rapid development of information technology, enterprises have an increasing demand for employee attendance management systems, especially in large enterprises and multi-branch corporate environments, where real-time attendance systems have become an indispensable management tool. The above system not only needs to efficiently and accurately record employees' time at get off work, but also needs to be able to cope with high-concurrency access scenarios to ensure stable operation of the system during the period when employees punch in and out. However, traditional attendance systems face many challenges in handling high-concurrency access.

[0003] First, traditional attendance systems usually use direct database query to process attendance requests. During peak hours when employees punch in, a large number of concurrent access requests will directly lead to a sharp increase in database load, which not only prolongs the employee's punch-in response time, but may also cause database server overload and even system crash. This "cold start" processing method, that is, reading data from the database only when needed, obviously cannot meet the performance requirements in high-concurrency scenarios.

[0004] Secondly, the existing attendance system lacks effective flow control and asynchronous processing mechanisms when dealing with high concurrent access. When the number of concurrent accesses exceeds the system's processing capacity, the system often has problems such as response delays and request loss, which seriously affects the accuracy and integrity of attendance data. In addition, the lack of effective anomaly detection and alarm mechanisms makes it impossible for the system to respond in time when data processing anomalies occur, further exacerbating the severity of the problem. Summary of the invention

[0005] The present invention provides a real-time attendance method and system based on cache preheating and hotspot peak shaving to solve the technical problems existing in the above-mentioned prior art. The technical solutions adopted are as follows:

[0006] A real-time attendance method based on cache preheating and hot spot peak shaving, the real-time attendance method based on cache preheating and hot spot peak shaving comprising:

[0007] Before the real-time attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number threshold, the hotspot data is pre-loaded into the cache area;

[0008] Real-time monitoring of the number of concurrent accesses to the attendance system, when the number of concurrent accesses exceeds a preset second concurrent access number threshold, setting a target concurrent access processing number, and using the target concurrent access processing number to asynchronously process access requests;

[0009] It is determined whether there is a data processing anomaly based on the data processing response time offset coefficient corresponding to the employee punch-in data processing response time, and an anomaly alarm is issued when there is a data processing anomaly.

[0010] Furthermore, before the real-time attendance system is started or highly concurrently accessed, the hotspot data is pre-loaded into the cache area, including:

[0011] Identify and analyze historical attendance data, and obtain data information during high concurrent access periods where the number of requests exceeds a preset request number threshold as hot data information;

[0012] Before the attendance system is started or the number of concurrent accesses exceeds a preset first number of concurrent accesses, the hotspot data information is retrieved and loaded into a cache.

[0013] Further, the number of concurrent accesses to the attendance system is monitored in real time, and when the number of concurrent accesses exceeds a preset second concurrent access number threshold, a target concurrent access processing number is set, and the access request is asynchronously processed using the target concurrent access processing number; including:

[0014] Real-time monitoring of the number of concurrent accesses;

[0015] Compare the concurrent access quantity with a preset second concurrent access quantity threshold; wherein the second concurrent access quantity threshold is greater than the first concurrent access quantity threshold;

[0016] When the number of concurrent accesses exceeds a preset second concurrent access number threshold, placing concurrent access requests exceeding the preset second concurrent access number threshold into a task queue;

[0017] Set the target concurrent access processing number according to the current concurrent access number;

[0018] Access requests having the same number as the target concurrent access processing quantity are retrieved from the task queue in sequence according to the order of the access request times and the target concurrent access processing quantity for processing.

[0019] Furthermore, the process of processing the target concurrent access quantity is as follows:

[0020] Retrieving the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0021] Acquire the adjustment coefficient using the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0022] The adjustment coefficient is obtained by the following formula:

[0023]

[0024] in, f represents the adjustment coefficient; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; J represents a first adjustment factor, and the first adjustment factor is obtained by the following formula:

[0025]

[0026] in, J represents the first adjustment factor; N d Indicates the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N fmax express n exceeds the floating maximum value of the number of concurrent accesses corresponding to the preset first concurrent access number threshold; N b express n The standard deviation of the number of concurrent accesses corresponding to the preset first concurrent access number threshold is exceeded for the times;

[0027] Utilizing the adjustment coefficient in combination with a preset initial concurrent access processing quantity to obtain a target concurrent access processing quantity;

[0028] The target concurrent access processing quantity is obtained by the following formula:

[0029]

[0030] in, F Indicates the number of concurrent access processing of the target; F 0 indicates the preset initial concurrent access processing number; f Represents the adjustment coefficient.

[0031] Further, judging whether there is a data processing anomaly according to the data processing response time offset coefficient corresponding to the employee punch-in data processing response time, and issuing an anomaly alarm when there is a data processing anomaly, including:

[0032] Real-time monitoring of the punch-in data processing response time corresponding to each punch-in record during the employee punch-in process;

[0033] The data processing response time offset coefficient is obtained according to the punch-in data processing response time corresponding to each punch-in record; wherein the data processing response time offset coefficient is obtained by the following formula:

[0034] The data processing response time offset coefficient is obtained by the following formula:

[0035]

[0036] in, P Indicates the data processing response time offset coefficient; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T max express n The maximum processing time corresponding to the processing of punch-in data; K represents the second adjustment factor, and the second adjustment factor is obtained by the following formula:

[0037]

[0038] in, K represents the second regulatory factor; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T cIndicates the preset reference value of processing time; T b express n Standard deviation of processing time corresponding to the processing of punch-in data; T fmax and T fmin Respectively n During the processing of the punch-in data, the maximum and minimum values ​​of the processing time corresponding to each two adjacent punch-in data processing; K represents the second regulatory factor;

[0039] Comparing the data processing response time offset coefficient with a preset offset coefficient threshold;

[0040] When the data processing response time deviation coefficient exceeds a preset deviation coefficient threshold, it is determined that a data processing anomaly exists and an anomaly alarm is issued.

[0041] A real-time attendance system based on cache preheating and hot spot peak shaving, the real-time attendance system based on cache preheating and hot spot peak shaving comprising:

[0042] A cache processing module, used to pre-load hotspot data into a cache area before the real-time attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number threshold;

[0043] A concurrent access processing module is used to monitor the number of concurrent accesses to the attendance system in real time, and when the number of concurrent accesses exceeds a preset second concurrent access number threshold, a target concurrent access processing number is set, and the access request is asynchronously processed using the target concurrent access processing number;

[0044] The clock-in processing module is used to determine whether there is a data processing anomaly based on the data processing response time offset coefficient corresponding to the employee clock-in data processing response time, and to issue an anomaly alarm when there is a data processing anomaly.

[0045] Furthermore, the cache processing module includes:

[0046] A hot data information acquisition module is used to identify and analyze historical attendance data, and obtain data information during high concurrent access when the number of requests exceeds a preset request number threshold as hot data information;

[0047] The cache execution module is used to retrieve the hot data information and load the hot data information into the cache before the attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number.

[0048] Furthermore, the concurrent access processing module includes:

[0049] Concurrent real-time monitoring module, used to monitor the number of concurrent accesses in real time;

[0050] A first comparison module, configured to compare the concurrent access quantity with a preset second concurrent access quantity threshold; wherein the second concurrent access quantity threshold is greater than the first concurrent access quantity threshold;

[0051] A task queue processing module, configured to put concurrent access requests exceeding the preset second concurrent access number threshold into a task queue when the concurrent access number exceeds the preset second concurrent access number threshold;

[0052] A target concurrent access processing quantity setting module is used to set the target concurrent access processing quantity according to the current concurrent access quantity;

[0053] The concurrent access processing execution module is used to sequentially retrieve access requests with the same target concurrent access processing number from the task queue according to the order of access request time and the target concurrent access processing number for processing.

[0054] Furthermore, the process of processing the target concurrent access quantity is as follows:

[0055] Retrieving the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0056] Acquire the adjustment coefficient using the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0057] The adjustment coefficient is obtained by the following formula:

[0058]

[0059] in, f represents the adjustment coefficient; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; J represents a first adjustment factor, and the first adjustment factor is obtained by the following formula:

[0060]

[0061] in, J represents the first adjustment factor; N d Indicates the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N fmax express n exceeds the floating maximum value of the number of concurrent accesses corresponding to the preset first concurrent access number threshold; N b express n The standard deviation of the number of concurrent accesses corresponding to the preset first concurrent access number threshold is exceeded for the times;

[0062] Utilizing the adjustment coefficient in combination with a preset initial concurrent access processing quantity to obtain a target concurrent access processing quantity;

[0063] The target concurrent access processing quantity is obtained by the following formula:

[0064]

[0065] in, F Indicates the number of concurrent access processing of the target; F 0 indicates the preset initial concurrent access processing number; f Represents the adjustment coefficient.

[0066] Furthermore, the punch-in processing module includes:

[0067] The time detection monitoring module is used to monitor the processing response time of the punch-in data corresponding to each punch-in record during the employee punch-in process in real time;

[0068] The data processing response time offset coefficient acquisition module is used to acquire the data processing response time offset coefficient according to the punch-in data processing response time corresponding to each punch-in record; wherein the data processing response time offset coefficient is acquired by the following formula:

[0069] The data processing response time offset coefficient is obtained by the following formula:

[0070]

[0071] in, P Indicates the data processing response time offset coefficient; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T max express n The maximum processing time corresponding to the processing of punch-in data; K represents the second adjustment factor, and the second adjustment factor is obtained by the following formula:

[0072]

[0073] in, K represents the second regulatory factor; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T b express n Standard deviation of processing time corresponding to the processing of punch-in data; T fmax and T fmin Respectively n During the processing of the punch-in data, the maximum and minimum values ​​of the processing time corresponding to each two adjacent punch-in data processing; K represents the second regulatory factor;

[0074] A second comparison module, used for comparing the data processing response time offset coefficient with a preset offset coefficient threshold;

[0075] The abnormality determination and alarm module is used to determine that there is a data processing abnormality and issue an abnormality alarm when the data processing response time deviation coefficient exceeds a preset deviation coefficient threshold.

[0076] Beneficial effects of the present invention:

[0077] The present invention proposes a real-time attendance method and system based on cache preheating and hot spot peak shaving. Through cache preheating, the system can directly read data from the cache during high-concurrency access without accessing the database, thereby significantly improving the system response speed. The cache preheating and hot spot peak shaving mechanism effectively reduces the number of times the system accesses the database, thereby reducing the database load and extending the service life of the database. Through asynchronous processing and anomaly detection and alarm mechanisms, the system can maintain stable operation under high-concurrency access conditions, promptly discover and handle potential problems, and avoid the risk of system crashes. Fast system response and stable service quality can improve employee satisfaction and trust in the attendance system, thereby improving the management efficiency of the enterprise and the work efficiency of employees. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 A flowchart corresponding to the method of the present invention;

[0079] Figure 2 The figure is a system block diagram corresponding to the system described in the present invention. DETAILED DESCRIPTION

[0080] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0081] The embodiment of the present invention proposes a real-time attendance method based on cache preheating and hot spot peak shaving, such as Figure 1 As shown, the real-time attendance method based on cache preheating and hotspot peak shaving includes:

[0082] S1, before the real-time attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number threshold, the hotspot data is pre-loaded into the cache area;

[0083] S2, real-time monitoring of the number of concurrent accesses to the attendance system, when the number of concurrent accesses exceeds a preset second concurrent access number threshold, setting a target concurrent access processing number, and using the target concurrent access processing number to asynchronously process access requests;

[0084] S3. Determine whether there is a data processing anomaly based on the data processing response time offset coefficient corresponding to the employee punch-in data processing response time, and issue an anomaly alarm if there is a data processing anomaly.

[0085] The working principle of the above technical solution is: during the startup phase of the real-time attendance system, or before predicting high concurrent access (such as employee commuting peak hours), the system pre-loads hot data (such as frequently used departments, employee information, etc.) into the cache area. The cache area is usually located in memory, and the access speed is much faster than traditional database queries. In this way, when a large number of concurrent access requests arrive, the system can read data directly from the cache without accessing the database, thereby reducing the database load and improving the system response speed.

[0086] The system monitors the number of concurrent accesses to the attendance system in real time. When the number of concurrent accesses exceeds the preset second concurrent access threshold, the system considers that it is currently in a high concurrent access state and needs to take measures to reduce the peak. The system sets a target concurrent access processing number, which is usually determined based on the actual processing capacity of the system to ensure that the system can maintain stable operation under high concurrency. The target concurrent access processing number is used to process access requests asynchronously, that is, the request will not be responded to immediately, but will be placed in a queue to wait for processing. This method can smooth the request flow and avoid system overload.

[0087] The system determines whether there is a data processing anomaly based on the data processing response time deviation coefficient corresponding to the employee punch-in data processing response time. The data processing response time deviation coefficient is an indicator that measures the difference between the actual processing response time and the expected processing response time. When the actual processing response time exceeds the expected processing response time by a certain range, it is considered that there is a data processing anomaly. Once a data processing anomaly is detected, the system will immediately issue an abnormality alarm and notify relevant personnel to handle it to ensure the accuracy and completeness of the attendance data.

[0088] The effect of the above technical solution is: through cache preheating, the system can read data directly from the cache during high-concurrency access without accessing the database, thereby significantly improving the system response speed. Cache preheating and hot spot peak shaving mechanisms effectively reduce the number of system accesses to the database, thereby reducing the database load and extending the service life of the database. Through asynchronous processing and anomaly detection and alarm mechanisms, the system can maintain stable operation under high-concurrency access conditions, promptly detect and handle potential problems, and avoid the risk of system crashes. Fast system response and stable service quality can improve employee satisfaction and trust in the attendance system, thereby improving the management efficiency of the enterprise and the work efficiency of employees.

[0089] In summary, the real-time attendance method based on cache preheating and hotspot peak shaving effectively solves the problems of traditional attendance systems in high concurrent access scenarios through a series of technical means, and improves the system's performance, stability and user experience.

[0090] One embodiment of the present invention pre-loads hotspot data into a cache area before the real-time attendance system is started or highly concurrently accessed, including:

[0091] S101, identifying and analyzing historical attendance data, obtaining data information in which the number of requests during high concurrent access exceeds a preset request number threshold as hot data information;

[0092] S102: before the attendance system is started or the number of concurrent accesses exceeds a preset first number of concurrent accesses, the hotspot data information is retrieved and loaded into a cache.

[0093] The working principle of the above technical solution is as follows: First, the system will conduct in-depth analysis and identification of historical attendance data. The above historical data usually contains key content such as the time, location, and department information of employees punching in. During the analysis process, the system will pay special attention to data information whose number of requests exceeds the preset request number threshold during high concurrent access. The above data information usually represents the content that employees frequently access or query within a specific time period, and is therefore regarded as hot data information. Through this step, the system can accurately identify which data is hot data, providing a reliable basis for subsequent cache loading.

[0094] Before the attendance system is started, or when the system predicts that it will face high concurrent access (such as rush hour for employees), the system will retrieve the previously identified hot data information in advance. The above hot data information is then loaded into the cache area in the memory. The cache area usually has a faster access speed and can significantly improve the data reading efficiency. By loading the hot data into the cache, the system can read the data directly from the cache during high concurrent access without accessing the slower database, thereby reducing the database load and improving the system's response speed.

[0095] The effect of the above technical solution is: since the hot data is loaded into the cache in advance, the system can read the data directly from the cache during high concurrent access, significantly reducing the number of database accesses. This significantly improves the response speed of the system, and employees can get feedback faster when punching in or querying attendance information. The cache mechanism effectively shares the access pressure of the database. During high concurrent access, the system relies more on the cache to provide data services. This not only reduces the load on the database, but also extends the service life of the database, and reduces the risk of performance degradation or failure caused by frequent access. Fast system response and stable service quality can significantly improve employee satisfaction with the attendance system. Employees can feel the smoothness and efficiency of the system when punching in or querying attendance information, thereby enhancing their trust and sense of belonging to the company. By identifying and analyzing historical attendance data, the system can accurately identify hot data and load it into the cache in advance. This enables the system to allocate resources more reasonably and ensure that stable and efficient services can be provided during high concurrent access.

[0096] In summary, this technical solution significantly improves the system's response speed, reduces database load, improves user experience, and optimizes resource management by identifying and loading hot data into the cache in advance. The above technical effects jointly promote the stability and efficiency of the attendance system.

[0097] An embodiment of the present invention monitors the number of concurrent accesses to an attendance system in real time, sets a target concurrent access processing number when the number of concurrent accesses exceeds a preset second concurrent access number threshold, and uses the target concurrent access processing number to asynchronously process access requests; comprising:

[0098] S201, real-time monitoring of the number of concurrent accesses;

[0099] S202, comparing the concurrent access quantity with a preset second concurrent access quantity threshold; wherein the second concurrent access quantity threshold is greater than the first concurrent access quantity threshold;

[0100] S203, when the number of concurrent accesses exceeds a preset second concurrent access number threshold, placing concurrent access requests exceeding the preset second concurrent access number threshold into a task queue;

[0101] S204, setting a target concurrent access processing number according to the current concurrent access number;

[0102] S205 , access requests with the same target concurrent access processing number are retrieved from the task queue in sequence according to the order of access request times and the target concurrent access processing number for processing.

[0103] The working principle of the above technical solution is: the system tracks and records the number of concurrent accesses to the attendance system in real time through a built-in monitoring module or component. This usually involves monitoring system resources, such as CPU usage, memory occupancy, and network bandwidth, to indirectly reflect the concurrent access pressure of the system. The system compares the number of concurrent accesses monitored in real time with the preset second concurrent access threshold. This threshold is set based on factors such as the system's processing power, hardware resources, and business requirements, and is used to determine whether the system is in a high concurrency state. It is worth noting that this threshold is greater than the first concurrent access threshold mentioned above, which is usually used to trigger the cache warm-up mechanism. When the number of concurrent accesses exceeds the preset second concurrent access threshold, the system considers that it is currently in a high concurrency state. In order to avoid system overload and request loss, the system puts concurrent access requests that exceed the threshold into a task queue. This queue is usually a first-in-first-out data structure for storing requests to be processed. The system dynamically sets a target concurrent access processing number based on the current number of concurrent accesses and the system's processing power. This number represents the maximum number of concurrent requests that the system can stably process in the current state. By dynamically adjusting this number, the system can maximize processing efficiency while ensuring stability. The system retrieves access requests with the same number of concurrent access processing as the target from the task queue in the order of access request time. This asynchronous processing method allows the system to continue to receive new requests and put them into the queue while processing the current request. This helps smooth the request flow and avoid system overload.

[0104] The effect of the above technical solution is: by real-time monitoring of the number of concurrent accesses and setting the target number of concurrent access processing, the system can maintain stable operation under high concurrency. This helps to avoid system overload and crash, and ensure the continuity and availability of the attendance system. The asynchronous processing mechanism enables the system to use resources more efficiently. When processing high-concurrency requests, the system can dynamically adjust the number of processing to ensure that resources are reasonably allocated and utilized. This helps to reduce system overhead and improve overall performance. By smoothing the request flow and avoiding request loss, the system can provide employees with more stable and efficient attendance services. This helps to improve employee satisfaction and trust in the attendance system, thereby enhancing the cohesion and centripetal force of the enterprise. This technical solution provides more possibilities for future expansion of the system by dynamically adjusting the number of concurrent processing and the asynchronous processing mechanism. As the business develops and the user scale expands, the system can easily adapt to higher concurrent access requirements.

[0105] In summary, this technical solution effectively improves the stability and performance of the attendance system in high-concurrency scenarios through mechanisms such as real-time monitoring of the number of concurrent accesses, dynamic setting of the target concurrent access processing number, and asynchronous processing of requests.

[0106] In one embodiment of the present invention, the process of processing the target concurrent access quantity is as follows:

[0107] Step 1, retrieve the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0108] Step 2, obtaining an adjustment coefficient using the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0109] The adjustment coefficient is obtained by the following formula:

[0110]

[0111] in, f represents the adjustment coefficient; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; J represents a first adjustment factor, and the first adjustment factor is obtained by the following formula:

[0112]

[0113] in, J represents the first adjustment factor; N d Indicates the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N fmax express nexceeds the floating maximum value of the number of concurrent accesses corresponding to the preset first concurrent access number threshold; N b express n The standard deviation of the number of concurrent accesses corresponding to the preset first concurrent access number threshold is exceeded for the times;

[0114] Step 3: Utilize the adjustment coefficient and the preset initial concurrent access processing quantity to obtain the target concurrent access processing quantity;

[0115] The target concurrent access processing quantity is obtained by the following formula:

[0116]

[0117] in, F Indicates the number of concurrent access processing of the target; F 0 indicates the preset initial concurrent access processing number; f Represents the adjustment coefficient.

[0118] The working principle of the above technical solution is: when the number of concurrent accesses to the attendance system exceeds the preset second concurrent access number threshold, the system will first retrieve two key data: one is the current number of concurrent accesses (i.e. the number of concurrent accesses when it exceeds the second threshold), and the other is the historical operation data of the past concurrent access number exceeding the preset first concurrent access number threshold. The above data provides the basis for the subsequent calculation of the adjustment coefficient. Using the retrieved data, the system calculates the adjustment coefficient (f) through a specific formula. This coefficient reflects the change of the current concurrent access pressure relative to the past historical data. The formula takes into account multiple factors, including the current number of concurrent accesses, the first and second concurrent access number thresholds, the number of concurrent accesses that exceeded the first threshold in the past and the corresponding concurrent access number, and the floating maximum value and standard deviation of the above numbers. The above factors jointly determine the size of the adjustment coefficient, thereby affecting the setting of the target concurrent access processing number. After obtaining the adjustment coefficient, the system combines it with the preset initial concurrent access processing number (F0) and calculates the target concurrent access processing number (F) through another formula. This number is the maximum number of concurrent requests that the system can stably process under the current concurrent access pressure. By dynamically adjusting this number, the system can maximize processing efficiency while ensuring stability.

[0119] The effect of the above technical solution is: the solution introduces an adjustment coefficient, so that the system can dynamically adjust the processing quantity according to the actual concurrent access situation. When the number of concurrent access exceeds the preset first concurrent access number threshold, the system will calculate the adjustment coefficient according to the number of times exceeded and the number of concurrent access each time exceeded, so as to achieve precise regulation of concurrent processing capacity. This dynamic adaptability helps the system maintain stable performance and response speed when facing burst traffic or periodic traffic changes. By associating the adjustment coefficient with the target concurrent access processing number, the system can optimize resource utilization while ensuring service quality. When the concurrent access demand is low, the system can reduce the processing number and reduce resource consumption; when the concurrent access demand surges, the system can quickly increase the processing number to meet user needs. This optimization of resource utilization helps to reduce operating costs and improve overall economic benefits. The calculation of the adjustment coefficient in the solution involves the standard deviation and floating maximum value of the concurrent access number, which helps the system to more accurately evaluate the fluctuation of concurrent access. By considering the above statistics, the system can better predict future concurrent access needs, so as to allocate resources and load balance in advance to avoid system overload or resource idleness. This predictive resource management helps improve the stability and reliability of the system. The design of this solution enables the system to flexibly respond to changes in the number of concurrent accesses. As the business develops and the number of users grows, the system can adapt to new needs by adjusting the preset concurrent access threshold and the initial concurrent access processing number. This scalability helps the system maintain long-term competitiveness and meet changing market needs. By dynamically adjusting the number of concurrent access processing, the system can better respond to user requests, reduce waiting time and response time, and thus improve user experience. Especially in high-concurrency scenarios, the system can maintain a stable response speed and avoid request failures or delays caused by system overload. This improvement in user experience helps to enhance user stickiness and satisfaction and promote the long-term development of the business. The solution introduces complex calculation formulas and statistics to evaluate concurrent access, which helps to promote the development of the system in an intelligent direction. By continuously learning and optimizing the calculation method of the adjustment coefficient, the system can more accurately predict and respond to changes in concurrent access requirements, and achieve more intelligent resource management and load balancing.

[0120] In summary, this technical solution achieves stable and efficient operation of the attendance system under different concurrent access pressures by dynamically adjusting the target number of concurrent access processing. This not only improves the flexibility and availability of the system, but also optimizes resource utilization, improves stability and user experience. The technical effects of this technical solution on performance indicators are mainly reflected in enhanced dynamic adaptability, optimized resource utilization, improved system stability, enhanced scalability, improved user experience, and promotion of system intelligence. The above effects together constitute the unique advantages and competitiveness of this solution in the field of concurrent access processing.

[0121] In one embodiment of the present invention, it is determined whether there is a data processing anomaly according to the data processing response time offset coefficient corresponding to the employee punch-in data processing response time, and an abnormality alarm is issued when there is a data processing anomaly, including:

[0122] S301, real-time monitoring of the punch-in data processing response time corresponding to each punch-in record during the employee punch-in process;

[0123] S302: Obtain a data processing response time offset coefficient according to the punch-in data processing response time corresponding to each punch-in record; wherein the data processing response time offset coefficient is obtained by the following formula:

[0124] The data processing response time offset coefficient is obtained by the following formula:

[0125]

[0126] in, P Indicates the data processing response time offset coefficient; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T max express n The maximum processing time corresponding to the processing of punch-in data; K represents the second adjustment factor, and the second adjustment factor is obtained by the following formula:

[0127]

[0128] in, K represents the second regulatory factor; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T b express n Standard deviation of processing time corresponding to the processing of punch-in data; T fmax and T fmin Respectively nDuring the processing of the punch-in data, the maximum and minimum values ​​of the processing time corresponding to each two adjacent punch-in data processing; K represents the second regulatory factor;

[0129] S303, comparing the data processing response time offset coefficient with a preset offset coefficient threshold;

[0130] S304: When the data processing response time deviation coefficient exceeds a preset deviation coefficient threshold, it is determined that a data processing abnormality exists, and an abnormality alarm is issued.

[0131] The working principle of the above technical solution is as follows: the system will monitor the employee's punch-in records in real time, and record the processing response time of each punch-in data accordingly. This is the basic data for anomaly detection and is used for subsequent analysis and comparison. The data processing response time offset coefficient (P) is calculated by a specific formula using the processing response time of each punch-in data, combined with the preset processing time reference value, processing time standard deviation, and the maximum and minimum values ​​of the processing time change range. This coefficient reflects the degree of deviation of the punch-in data processing response time from the preset reference value, and is an important basis for judging whether there is an anomaly. The calculated data processing response time offset coefficient is compared with the preset offset coefficient threshold. This threshold is set according to the data processing response time characteristics when the system is operating normally, and is used to distinguish between normal and abnormal states. If the data processing response time offset coefficient exceeds the preset offset coefficient threshold, the system determines that there is a data processing anomaly and triggers the anomaly alarm mechanism. This helps to detect problems in a timely manner and take corresponding treatment measures.

[0132] The effect of the above technical solution is: the technical solution can monitor the processing response time of employee punch-in data in real time, and quickly alarm when an abnormality is found. This helps to discover and deal with potential problems in a timely manner, avoiding adverse effects on the normal operation of the attendance system. By calculating the data processing response time deviation coefficient and comparing it with the preset threshold, it is possible to more accurately determine whether there is an abnormality in the data processing. This helps to improve the accuracy and reliability of data processing in the attendance system. The technical solution can discover and deal with data processing anomalies in a timely manner, thereby avoiding system performance degradation or crashes caused by abnormal data processing. This helps to optimize the overall performance of the attendance system and improve the stability and availability of the system. Through real-time monitoring and abnormal alarm mechanisms, the attendance system can respond to user needs and problems more quickly. This helps to improve user satisfaction and trust in the attendance system, thereby enhancing the management efficiency of the enterprise and the work efficiency of employees.

[0133] At the same time, the solution ensures the real-time and accuracy of the data by real-time monitoring the processing time corresponding to each punch-in record during the employee punch-in process. This real-time monitoring method enables the system to quickly capture any abnormal fluctuations in the punch-in data processing process, providing a solid foundation for subsequent abnormal judgment. At the same time, by introducing a preset processing time reference value, a clear benchmark is provided for evaluating the rationality of the processing time, further improving the accuracy of abnormal judgment. The calculation of the data processing response time offset coefficient comprehensively considers the processing time of multiple punch-in data, the maximum processing time, the standard deviation of the processing time, and the maximum and minimum values ​​of the processing time change range. This multi-dimensional consideration method enables the system to more comprehensively evaluate the abnormal situation in the punch-in data processing process, thereby improving the sensitivity of abnormal detection. In particular, when the processing time fluctuates significantly or has abnormal values, the offset coefficient can quickly reflect this change, providing a strong basis for abnormal judgment. The introduction of the second adjustment factor provides additional flexibility for the system. By comprehensively considering the information of the number of punch-in data processing times, the standard deviation of the processing time, and the change range of the processing time, the K factor can dynamically adjust the calculation method of the offset coefficient to adapt to the punch-in data processing needs in different scenarios. This adaptive design enables the system to better cope with various complex situations and improves overall stability and reliability. When the data processing response time deviation coefficient exceeds the preset deviation coefficient threshold, the system can immediately determine that there is a data processing anomaly and trigger the abnormal alarm mechanism. This timely and effective alarm method can quickly attract the attention of relevant personnel so that they can take timely measures to solve the problem and avoid the abnormal situation from having a greater impact on business operations. At the same time, the triggering of abnormal alarms also provides an important monitoring method for enterprises, which helps to discover and correct potential problems in a timely manner. Through real-time monitoring and anomaly detection, the solution can promptly discover and handle abnormal situations in the punch-in data processing process, thereby avoiding resource waste and cost increase caused by improper exception handling. At the same time, by optimizing the punch-in data processing process and improving the efficiency of exception handling, enterprises can further reduce operating costs and improve overall economic benefits. Finally, the solution can significantly improve employees' punch-in experience by improving the accuracy and efficiency of punch-in data processing. When employees feel that the punch-in process is smooth and efficient, their satisfaction and loyalty will also increase accordingly. This is an intangible asset for enterprises and helps to enhance the cohesion and competitiveness of enterprises.

[0134] In summary, this technical solution monitors the processing response time of employee punch-in data in real time and calculates the data processing response time offset coefficient to determine whether there is an anomaly. It has the technical effects of real-time monitoring and rapid response, improving data processing accuracy, optimizing system performance, and improving user experience. At the same time, the technical effects of this technical solution in terms of performance indicators are mainly reflected in the improvement of real-time and accuracy, enhanced sensitivity of anomaly detection, adaptability and flexibility, timely and effective anomaly alarm, optimization of resource utilization and cost control, and improvement of user experience and satisfaction. These effects together constitute the unique advantages and competitiveness of this solution in the field of employee punch-in data processing.

[0135] The embodiment of the present invention proposes a real-time attendance system based on cache preheating and hot spot peak shaving, such as Figure 2 As shown, the real-time attendance system based on cache preheating and hotspot peak shaving includes:

[0136] A cache processing module, used to pre-load hotspot data into a cache area before the real-time attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number threshold;

[0137] A concurrent access processing module is used to monitor the number of concurrent accesses to the attendance system in real time, and when the number of concurrent accesses exceeds a preset second concurrent access number threshold, a target concurrent access processing number is set, and the access request is asynchronously processed using the target concurrent access processing number;

[0138] The clock-in processing module is used to determine whether there is a data processing anomaly based on the data processing response time offset coefficient corresponding to the employee clock-in data processing response time, and to issue an anomaly alarm when there is a data processing anomaly.

[0139] The working principle of the above technical solution is: during the startup phase of the real-time attendance system, or before predicting high concurrent access (such as employee commuting peak hours), the system pre-loads hot data (such as frequently used departments, employee information, etc.) into the cache area. The cache area is usually located in memory, and the access speed is much faster than traditional database queries. In this way, when a large number of concurrent access requests arrive, the system can read data directly from the cache without accessing the database, thereby reducing the database load and improving the system response speed.

[0140] The system monitors the number of concurrent accesses to the attendance system in real time. When the number of concurrent accesses exceeds the preset second concurrent access threshold, the system considers that it is currently in a high concurrent access state and needs to take measures to reduce the peak. The system sets a target concurrent access processing number, which is usually determined based on the actual processing capacity of the system to ensure that the system can maintain stable operation under high concurrency. The target concurrent access processing number is used to process access requests asynchronously, that is, the request will not be responded to immediately, but will be placed in a queue to wait for processing. This method can smooth the request flow and avoid system overload.

[0141] The system determines whether there is a data processing anomaly based on the data processing response time deviation coefficient corresponding to the employee punch-in data processing response time. The data processing response time deviation coefficient is an indicator that measures the difference between the actual processing response time and the expected processing response time. When the actual processing response time exceeds the expected processing response time by a certain range, it is considered that there is a data processing anomaly. Once a data processing anomaly is detected, the system will immediately issue an abnormality alarm and notify relevant personnel to handle it to ensure the accuracy and completeness of the attendance data.

[0142] The effect of the above technical solution is: through cache preheating, the system can read data directly from the cache during high-concurrency access without accessing the database, thereby significantly improving the system response speed. Cache preheating and hot spot peak shaving mechanisms effectively reduce the number of system accesses to the database, thereby reducing the database load and extending the service life of the database. Through asynchronous processing and anomaly detection and alarm mechanisms, the system can maintain stable operation under high-concurrency access conditions, promptly detect and handle potential problems, and avoid the risk of system crashes. Fast system response and stable service quality can improve employee satisfaction and trust in the attendance system, thereby improving the management efficiency of the enterprise and the work efficiency of employees.

[0143] In summary, the real-time attendance method based on cache preheating and hotspot peak shaving effectively solves the problems of traditional attendance systems in high concurrent access scenarios through a series of technical means, and improves the system's performance, stability and user experience.

[0144] In one embodiment of the present invention, the cache processing module includes:

[0145] A hot data information acquisition module is used to identify and analyze historical attendance data, and obtain data information during high concurrent access when the number of requests exceeds a preset request number threshold as hot data information;

[0146] The cache execution module is used to retrieve the hot data information and load the hot data information into the cache before the attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number.

[0147] The working principle of the above technical solution is as follows: First, the system will conduct in-depth analysis and identification of historical attendance data. The above historical data usually contains key content such as the time, location, and department information of employees punching in. During the analysis process, the system will pay special attention to data information whose number of requests exceeds the preset request number threshold during high concurrent access. The above data information usually represents the content that employees frequently access or query within a specific time period, and is therefore regarded as hot data information. Through this step, the system can accurately identify which data is hot data, providing a reliable basis for subsequent cache loading.

[0148] Before the attendance system is started, or when the system predicts that it will face high concurrent access (such as rush hour for employees), the system will retrieve the previously identified hot data information in advance. The above hot data information is then loaded into the cache area in the memory. The cache area usually has a faster access speed and can significantly improve the data reading efficiency. By loading the hot data into the cache, the system can read the data directly from the cache during high concurrent access without accessing the slower database, thereby reducing the database load and improving the system's response speed.

[0149] The effect of the above technical solution is: since the hot data is loaded into the cache in advance, the system can read the data directly from the cache during high concurrent access, significantly reducing the number of database accesses. This significantly improves the response speed of the system, and employees can get feedback faster when punching in or querying attendance information. The cache mechanism effectively shares the access pressure of the database. During high concurrent access, the system relies more on the cache to provide data services. This not only reduces the load on the database, but also extends the service life of the database, and reduces the risk of performance degradation or failure caused by frequent access. Fast system response and stable service quality can significantly improve employee satisfaction with the attendance system. Employees can feel the smoothness and efficiency of the system when punching in or querying attendance information, thereby enhancing their trust and sense of belonging to the company. By identifying and analyzing historical attendance data, the system can accurately identify hot data and load it into the cache in advance. This enables the system to allocate resources more reasonably and ensure that stable and efficient services can be provided during high concurrent access.

[0150] In summary, this technical solution significantly improves the system's response speed, reduces database load, improves user experience, and optimizes resource management by identifying and loading hot data into the cache in advance. The above technical effects jointly promote the stability and efficiency of the attendance system.

[0151] In one embodiment of the present invention, the concurrent access processing module includes:

[0152] Concurrent real-time monitoring module, used to monitor the number of concurrent accesses in real time;

[0153] A first comparison module, configured to compare the concurrent access quantity with a preset second concurrent access quantity threshold; wherein the second concurrent access quantity threshold is greater than the first concurrent access quantity threshold;

[0154] A task queue processing module, configured to put concurrent access requests exceeding the preset second concurrent access number threshold into a task queue when the concurrent access number exceeds the preset second concurrent access number threshold;

[0155] A target concurrent access processing quantity setting module is used to set the target concurrent access processing quantity according to the current concurrent access quantity;

[0156] The concurrent access processing execution module is used to sequentially retrieve access requests with the same target concurrent access processing number from the task queue according to the order of access request time and the target concurrent access processing number for processing.

[0157] The working principle of the above technical solution is: the system tracks and records the number of concurrent accesses to the attendance system in real time through a built-in monitoring module or component. This usually involves monitoring system resources, such as CPU usage, memory occupancy, and network bandwidth, to indirectly reflect the concurrent access pressure of the system. The system compares the number of concurrent accesses monitored in real time with the preset second concurrent access threshold. This threshold is set based on factors such as the system's processing power, hardware resources, and business requirements, and is used to determine whether the system is in a high concurrency state. It is worth noting that this threshold is greater than the first concurrent access threshold mentioned above, which is usually used to trigger the cache warm-up mechanism. When the number of concurrent accesses exceeds the preset second concurrent access threshold, the system considers that it is currently in a high concurrency state. In order to avoid system overload and request loss, the system puts concurrent access requests that exceed the threshold into a task queue. This queue is usually a first-in-first-out data structure for storing requests to be processed. The system dynamically sets a target concurrent access processing number based on the current number of concurrent accesses and the system's processing power. This number represents the maximum number of concurrent requests that the system can stably process in the current state. By dynamically adjusting this number, the system can maximize processing efficiency while ensuring stability. The system retrieves access requests with the same number of concurrent access processing as the target from the task queue in the order of access request time. This asynchronous processing method allows the system to continue to receive new requests and put them into the queue while processing the current request. This helps smooth the request flow and avoid system overload.

[0158] The effect of the above technical solution is: by real-time monitoring of the number of concurrent accesses and setting the target number of concurrent access processing, the system can maintain stable operation under high concurrency. This helps to avoid system overload and crash, and ensure the continuity and availability of the attendance system. The asynchronous processing mechanism enables the system to use resources more efficiently. When processing high-concurrency requests, the system can dynamically adjust the number of processing to ensure that resources are reasonably allocated and utilized. This helps to reduce system overhead and improve overall performance. By smoothing the request flow and avoiding request loss, the system can provide employees with more stable and efficient attendance services. This helps to improve employee satisfaction and trust in the attendance system, thereby enhancing the cohesion and centripetal force of the enterprise. This technical solution provides more possibilities for future expansion of the system by dynamically adjusting the number of concurrent processing and the asynchronous processing mechanism. As the business develops and the user scale expands, the system can easily adapt to higher concurrent access requirements.

[0159] In summary, this technical solution effectively improves the stability and performance of the attendance system in high-concurrency scenarios through mechanisms such as real-time monitoring of the number of concurrent accesses, dynamic setting of the target concurrent access processing number, and asynchronous processing of requests.

[0160] In one embodiment of the present invention, the process of processing the target concurrent access quantity is as follows:

[0161] Retrieving the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0162] Acquire the adjustment coefficient using the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold;

[0163] The adjustment coefficient is obtained by the following formula:

[0164]

[0165] in, f represents the adjustment coefficient; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; Jrepresents a first adjustment factor, and the first adjustment factor is obtained by the following formula:

[0166]

[0167] in, J represents the first adjustment factor; N d Indicates the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N fmax express n exceeds the floating maximum value of the number of concurrent accesses corresponding to the preset first concurrent access number threshold; N b express n The standard deviation of the number of concurrent accesses corresponding to the preset first concurrent access number threshold is exceeded for the times;

[0168] Utilizing the adjustment coefficient in combination with a preset initial concurrent access processing quantity to obtain a target concurrent access processing quantity;

[0169] The target concurrent access processing quantity is obtained by the following formula:

[0170]

[0171] in, F Indicates the number of concurrent access processing of the target; F 0 indicates the preset initial concurrent access processing number; f Represents the adjustment coefficient.

[0172] The working principle of the above technical solution is: when the number of concurrent accesses to the attendance system exceeds the preset second concurrent access number threshold, the system will first retrieve two key data: one is the current number of concurrent accesses (i.e. the number of concurrent accesses when it exceeds the second threshold), and the other is the historical operation data of the past concurrent access number exceeding the preset first concurrent access number threshold. The above data provides the basis for the subsequent calculation of the adjustment coefficient. Using the retrieved data, the system calculates the adjustment coefficient (f) through a specific formula. This coefficient reflects the change of the current concurrent access pressure relative to the past historical data. The formula takes into account multiple factors, including the current number of concurrent accesses, the first and second concurrent access number thresholds, the number of concurrent accesses that exceeded the first threshold in the past and the corresponding concurrent access number, and the floating maximum value and standard deviation of the above numbers. The above factors jointly determine the size of the adjustment coefficient, thereby affecting the setting of the target concurrent access processing number. After obtaining the adjustment coefficient, the system combines it with the preset initial concurrent access processing number (F0) and calculates the target concurrent access processing number (F) through another formula. This number is the maximum number of concurrent requests that the system can stably process under the current concurrent access pressure. By dynamically adjusting this number, the system can maximize processing efficiency while ensuring stability.

[0173] The effect of the above technical solution is: the solution introduces an adjustment coefficient, so that the system can dynamically adjust the processing quantity according to the actual concurrent access situation. When the number of concurrent access exceeds the preset first concurrent access number threshold, the system will calculate the adjustment coefficient according to the number of times exceeded and the number of concurrent access each time exceeded, so as to achieve precise regulation of concurrent processing capacity. This dynamic adaptability helps the system maintain stable performance and response speed when facing burst traffic or periodic traffic changes. By associating the adjustment coefficient with the target concurrent access processing number, the system can optimize resource utilization while ensuring service quality. When the concurrent access demand is low, the system can reduce the processing number and reduce resource consumption; when the concurrent access demand surges, the system can quickly increase the processing number to meet user needs. This optimization of resource utilization helps to reduce operating costs and improve overall economic benefits. The calculation of the adjustment coefficient in the solution involves the standard deviation and floating maximum value of the concurrent access number, which helps the system to more accurately evaluate the fluctuation of concurrent access. By considering the above statistics, the system can better predict future concurrent access needs, so as to allocate resources and load balance in advance to avoid system overload or resource idleness. This predictive resource management helps improve the stability and reliability of the system. The design of this solution enables the system to flexibly respond to changes in the number of concurrent accesses. As the business develops and the number of users grows, the system can adapt to new needs by adjusting the preset concurrent access threshold and the initial concurrent access processing number. This scalability helps the system maintain long-term competitiveness and meet changing market needs. By dynamically adjusting the number of concurrent access processing, the system can better respond to user requests, reduce waiting time and response time, and thus improve user experience. Especially in high-concurrency scenarios, the system can maintain a stable response speed and avoid request failures or delays caused by system overload. This improvement in user experience helps to enhance user stickiness and satisfaction and promote the long-term development of the business. The solution introduces complex calculation formulas and statistics to evaluate concurrent access, which helps to promote the development of the system in an intelligent direction. By continuously learning and optimizing the calculation method of the adjustment coefficient, the system can more accurately predict and respond to changes in concurrent access requirements, and achieve more intelligent resource management and load balancing.

[0174] In summary, this technical solution achieves stable and efficient operation of the attendance system under different concurrent access pressures by dynamically adjusting the target number of concurrent access processing. This not only improves the flexibility and availability of the system, but also optimizes resource utilization, improves stability and user experience. The technical effects of this technical solution on performance indicators are mainly reflected in enhanced dynamic adaptability, optimized resource utilization, improved system stability, enhanced scalability, improved user experience, and promotion of system intelligence. The above effects together constitute the unique advantages and competitiveness of this solution in the field of concurrent access processing.

[0175] In one embodiment of the present invention, the punch-in processing module includes:

[0176] The time detection monitoring module is used to monitor the processing response time of the punch-in data corresponding to each punch-in record during the employee punch-in process in real time;

[0177] The data processing response time offset coefficient acquisition module is used to acquire the data processing response time offset coefficient according to the punch-in data processing response time corresponding to each punch-in record; wherein the data processing response time offset coefficient is acquired by the following formula:

[0178] The data processing response time offset coefficient is obtained by the following formula:

[0179]

[0180] in, P Indicates the data processing response time offset coefficient; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T max express n The maximum processing time corresponding to the processing of punch-in data; K represents the second adjustment factor, and the second adjustment factor is obtained by the following formula:

[0181]

[0182] in, K represents the second regulatory factor; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T b express n Standard deviation of processing time corresponding to the processing of punch-in data; T fmax and T fmin Respectively n During the processing of the punch-in data, the maximum and minimum values ​​of the processing time corresponding to each two adjacent punch-in data processing; K represents the second regulatory factor;

[0183] A second comparison module, used for comparing the data processing response time offset coefficient with a preset offset coefficient threshold;

[0184] The abnormality determination and alarm module is used to determine that there is a data processing abnormality and issue an abnormality alarm when the data processing response time deviation coefficient exceeds a preset deviation coefficient threshold.

[0185] The working principle of the above technical solution is as follows: the system will monitor the employee's punch-in records in real time, and record the processing response time of each punch-in data. This is the basic data for anomaly detection and is used for subsequent analysis and comparison. The data processing response time offset coefficient (P) is calculated by a specific formula using the processing response time of each punch-in data, combined with the preset processing time reference value, processing time standard deviation, and the maximum and minimum values ​​of the processing time change range. This coefficient reflects the degree of deviation of the punch-in data processing response time from the preset reference value, and is an important basis for judging whether there is an anomaly. The calculated data processing response time offset coefficient is compared with the preset offset coefficient threshold. This threshold is set according to the data processing response time characteristics when the system is operating normally, and is used to distinguish between normal and abnormal states. If the data processing response time offset coefficient exceeds the preset offset coefficient threshold, the system determines that there is a data processing anomaly and triggers the anomaly alarm mechanism. This helps to find problems in a timely manner and take corresponding treatment measures.

[0186] The effect of the above technical solution is: the technical solution can monitor the processing response time of employee punch-in data in real time, and quickly alarm when an abnormality is found. This helps to discover and deal with potential problems in a timely manner, avoiding adverse effects on the normal operation of the attendance system. By calculating the data processing response time deviation coefficient and comparing it with the preset threshold, it is possible to more accurately determine whether there is an abnormality in the data processing. This helps to improve the accuracy and reliability of data processing in the attendance system. The technical solution can discover and deal with data processing anomalies in a timely manner, thereby avoiding system performance degradation or crashes caused by abnormal data processing. This helps to optimize the overall performance of the attendance system and improve the stability and availability of the system. Through real-time monitoring and abnormal alarm mechanisms, the attendance system can respond to user needs and problems more quickly. This helps to improve user satisfaction and trust in the attendance system, thereby enhancing the management efficiency of the enterprise and the work efficiency of employees.

[0187] At the same time, the solution ensures the real-time and accuracy of the data by real-time monitoring the processing time corresponding to each punch-in record during the employee punch-in process. This real-time monitoring method enables the system to quickly capture any abnormal fluctuations in the punch-in data processing process, providing a solid foundation for subsequent abnormal judgment. At the same time, by introducing a preset processing time reference value, a clear benchmark is provided for evaluating the rationality of the processing time, further improving the accuracy of abnormal judgment. The calculation of the data processing response time offset coefficient comprehensively considers the processing time of multiple punch-in data, the maximum processing time, the standard deviation of the processing time, and the maximum and minimum values ​​of the processing time change range. This multi-dimensional consideration method enables the system to more comprehensively evaluate the abnormal situation in the punch-in data processing process, thereby improving the sensitivity of abnormal detection. In particular, when the processing time fluctuates significantly or has abnormal values, the offset coefficient can quickly reflect this change, providing a strong basis for abnormal judgment. The introduction of the second adjustment factor provides additional flexibility for the system. By comprehensively considering the information of the number of punch-in data processing times, the standard deviation of the processing time, and the change range of the processing time, the K factor can dynamically adjust the calculation method of the offset coefficient to adapt to the punch-in data processing needs in different scenarios. This adaptive design enables the system to better cope with various complex situations and improves overall stability and reliability. When the data processing response time deviation coefficient exceeds the preset deviation coefficient threshold, the system can immediately determine that there is a data processing anomaly and trigger the abnormal alarm mechanism. This timely and effective alarm method can quickly attract the attention of relevant personnel so that they can take timely measures to solve the problem and avoid the abnormal situation from having a greater impact on business operations. At the same time, the triggering of abnormal alarms also provides an important monitoring method for enterprises, which helps to discover and correct potential problems in a timely manner. Through real-time monitoring and anomaly detection, the solution can promptly discover and handle abnormal situations in the punch-in data processing process, thereby avoiding resource waste and cost increase caused by improper exception handling. At the same time, by optimizing the punch-in data processing process and improving the efficiency of exception handling, enterprises can further reduce operating costs and improve overall economic benefits. Finally, the solution can significantly improve employees' punch-in experience by improving the accuracy and efficiency of punch-in data processing. When employees feel that the punch-in process is smooth and efficient, their satisfaction and loyalty will also increase accordingly. This is an intangible asset for enterprises and helps to enhance the cohesion and competitiveness of enterprises.

[0188] In summary, this technical solution monitors the processing response time of employee punch-in data in real time and calculates the data processing response time offset coefficient to determine whether there is an anomaly. It has the technical effects of real-time monitoring and rapid response, improving data processing accuracy, optimizing system performance, and improving user experience. At the same time, the technical effects of this technical solution in terms of performance indicators are mainly reflected in the improvement of real-time and accuracy, enhanced sensitivity of anomaly detection, adaptability and flexibility, timely and effective anomaly alarm, optimization of resource utilization and cost control, and improvement of user experience and satisfaction. These effects together constitute the unique advantages and competitiveness of this solution in the field of employee punch-in data processing.

[0189] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if the above-mentioned modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include the above-mentioned modifications and variations.

Claims

1. A real-time attendance method based on cache preheating and hotspot peak shaving, characterized in that: The real-time attendance method based on cache preheating and hotspot peak shaving includes: Before the real-time attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number threshold, the hotspot data is pre-loaded into the cache area; Real-time monitoring of the number of concurrent accesses to the attendance system, when the number of concurrent accesses exceeds a preset second concurrent access number threshold, setting a target concurrent access processing number, and using the target concurrent access processing number to asynchronously process access requests; wherein the second concurrent access number threshold is greater than the first concurrent access number threshold; Determine whether there is a data processing anomaly based on the data processing response time deviation coefficient corresponding to the employee punch-in data processing response time, and issue an abnormality alarm if there is a data processing anomaly; Among them, judging whether there is a data processing anomaly according to the data processing response time offset coefficient corresponding to the employee punch-in data processing response time, and issuing an abnormal alarm when there is a data processing anomaly, including: Real-time monitoring of the punch-in data processing response time corresponding to each punch-in record during the employee punch-in process; The data processing response time offset coefficient is obtained according to the punch-in data processing response time corresponding to each punch-in record; wherein the data processing response time offset coefficient is obtained by the following formula: in, P Indicates the data processing response time offset coefficient; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T max express n The maximum processing time corresponding to the processing of punch-in data; K represents the second adjustment factor, and the second adjustment factor is obtained by the following formula: in, K represents the second regulatory factor; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T b express n Standard deviation of processing time corresponding to the processing of punch-in data; T fmax and T fmin Respectively n During the processing of the punch-in data, the maximum and minimum values ​​of the processing time corresponding to each two adjacent punch-in data processing; K represents the second regulatory factor; Comparing the data processing response time offset coefficient with a preset offset coefficient threshold; When the data processing response time deviation coefficient exceeds a preset deviation coefficient threshold, it is determined that a data processing anomaly exists and an anomaly alarm is issued.

2. The real-time attendance method based on cache preheating and hotspot peak shaving according to claim 1 is characterized in that: Before the real-time attendance system is started or accessed with high concurrency, the hotspot data is pre-loaded into the cache area, including: Identify and analyze historical attendance data, and obtain data information during high concurrent access periods where the number of requests exceeds a preset request number threshold as hot data information; Before the attendance system is started or the number of concurrent accesses exceeds a preset first number of concurrent accesses, the hotspot data information is retrieved and loaded into a cache.

3. The real-time attendance method based on cache preheating and hotspot peak shaving according to claim 1 is characterized in that: Real-time monitoring of the number of concurrent accesses to the attendance system, when the number of concurrent accesses exceeds a preset second concurrent access number threshold, setting a target concurrent access processing number, and using the target concurrent access processing number to asynchronously process access requests; including: Real-time monitoring of the number of concurrent accesses; Comparing the concurrent access quantity with a preset second concurrent access quantity threshold; When the number of concurrent accesses exceeds a preset second concurrent access number threshold, placing concurrent access requests exceeding the preset second concurrent access number threshold into a task queue; Set the target concurrent access processing number according to the current concurrent access number; Access requests having the same number as the target concurrent access processing quantity are retrieved from the task queue in sequence according to the order of the access request times and the target concurrent access processing quantity for processing.

4. The real-time attendance method based on cache preheating and hotspot peak shaving according to claim 3 is characterized in that: The process of handling the target concurrent access quantity is as follows: Retrieving the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold; Acquire the adjustment coefficient using the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold; The adjustment coefficient is obtained by the following formula: in, f represents the adjustment coefficient; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; J represents a first adjustment factor, and the first adjustment factor is obtained by the following formula: in, J represents the first adjustment factor; N d Indicates the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N fmax express n exceeds the floating maximum value of the number of concurrent accesses corresponding to the preset first concurrent access number threshold; N b express n The standard deviation of the number of concurrent accesses corresponding to the preset first concurrent access number threshold is exceeded for the times; Utilizing the adjustment coefficient in combination with a preset initial concurrent access processing quantity to obtain a target concurrent access processing quantity; The target concurrent access processing quantity is obtained by the following formula: in, F Indicates the number of concurrent access processing of the target; F 0 indicates the preset initial concurrent access processing number; f Represents the adjustment coefficient.

5. A real-time attendance system based on cache preheating and hotspot peak shaving, characterized in that: The real-time attendance system based on cache preheating and hotspot peak shaving includes: A cache processing module, used to pre-load hotspot data into a cache area before the real-time attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number threshold; A concurrent access processing module is used to monitor the number of concurrent accesses to the attendance system in real time, and when the number of concurrent accesses exceeds a preset second concurrent access number threshold, a target concurrent access processing number is set, and the access request is asynchronously processed using the target concurrent access processing number; wherein the second concurrent access number threshold is greater than the first concurrent access number threshold; The clock-in processing module is used to determine whether there is a data processing anomaly based on the data processing response time offset coefficient corresponding to the employee clock-in data processing response time, and to issue an abnormality alarm when there is a data processing anomaly; Wherein, the punch-in processing module includes: The time detection monitoring module is used to monitor the processing response time of the punch-in data corresponding to each punch-in record during the employee punch-in process in real time; The data processing response time offset coefficient acquisition module is used to acquire the data processing response time offset coefficient according to the punch-in data processing response time corresponding to each punch-in record; wherein the data processing response time offset coefficient is acquired by the following formula: in, P Indicates the data processing response time offset coefficient; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T max express n The maximum processing time corresponding to the processing of punch-in data; K represents the second adjustment factor, and the second adjustment factor is obtained by the following formula: in, K represents the second regulatory factor; m Indicates the number of times the punch-in data is processed; T i Indicates i The processing time corresponding to the processing of the punch-in data; T c Indicates the preset reference value of processing time; T b express n Standard deviation of processing time corresponding to the processing of punch-in data; T fmax and T fmin Respectively n During the processing of the punch-in data, the maximum and minimum values ​​of the processing time corresponding to each two adjacent punch-in data processing; K represents the second regulatory factor; A second comparison module, used for comparing the data processing response time offset coefficient with a preset offset coefficient threshold; The abnormality determination and alarm module is used to determine that there is a data processing abnormality and issue an abnormality alarm when the data processing response time deviation coefficient exceeds a preset deviation coefficient threshold.

6. The real-time attendance system based on cache preheating and hotspot peak shaving according to claim 5 is characterized in that: The cache processing module includes: A hot data information acquisition module is used to identify and analyze historical attendance data, and obtain data information during high concurrent access when the number of requests exceeds a preset request number threshold as hot data information; The cache execution module is used to retrieve the hot data information and load the hot data information into the cache before the attendance system is started or the number of concurrent accesses exceeds a preset first concurrent access number.

7. The real-time attendance system based on cache preheating and hotspot peak shaving according to claim 5 is characterized in that: The concurrent access processing module includes: Concurrent real-time monitoring module, used to monitor the number of concurrent accesses in real time; A first comparison module, used for comparing the concurrent access quantity with a preset second concurrent access quantity threshold; A task queue processing module, configured to put concurrent access requests exceeding the preset second concurrent access number threshold into a task queue when the concurrent access number exceeds the preset second concurrent access number threshold; A target concurrent access processing quantity setting module is used to set the target concurrent access processing quantity according to the current concurrent access quantity; The concurrent access processing execution module is used to sequentially retrieve access requests with the same target concurrent access processing number from the task queue according to the order of access request time and the target concurrent access processing number for processing.

8. The real-time attendance system based on cache preheating and hotspot peak shaving according to claim 7 is characterized in that: The process of handling the target concurrent access quantity is as follows: Retrieving the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold; Acquire the adjustment coefficient using the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold and the concurrent access historical operation data when the concurrent access number exceeds the preset first concurrent access number threshold; The adjustment coefficient is obtained by the following formula: in, f represents the adjustment coefficient; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; J represents a first adjustment factor, and the first adjustment factor is obtained by the following formula: in, J represents the first adjustment factor; N d Indicates the concurrent access number corresponding to the moment when the concurrent access number exceeds the preset second concurrent access number threshold; N f01 and N f02 represent the first concurrent access quantity threshold and the second concurrent access quantity threshold respectively; n The number of concurrent accesses indicates that the number of concurrent accesses exceeds a preset first concurrent access number threshold; N i Indicates i The number of concurrent accesses that exceeds the preset first concurrent access number threshold value; N fmax express n exceeds the floating maximum value of the number of concurrent accesses corresponding to the preset first concurrent access number threshold; N b express n The standard deviation of the number of concurrent accesses corresponding to the preset first concurrent access number threshold is exceeded for the times; Utilizing the adjustment coefficient in combination with a preset initial concurrent access processing quantity to obtain a target concurrent access processing quantity; The target concurrent access processing quantity is obtained by the following formula: in, F Indicates the number of concurrent access processing of the target; F 0 indicates the preset initial concurrent access processing number; f Represents the adjustment coefficient.

Citation Information

Patent Citations

  • Data processing method and device, equipment and storage medium

    CN117082274A