Work order time limit reminding method and system based on time wheel

By constructing a time wheel data structure and dynamically adjusting the time slot interval, the problems of low efficiency and task backlog in existing work order deadline reminder methods are solved, achieving high efficiency, accuracy, and system adaptability in work order deadline reminders.

CN121390658APending Publication Date: 2026-01-23STATE GRID JIANGSU ELECTRIC POWER CO LTD MARKETING SERVICE CENT
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511374195.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-25
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Existing work order deadline reminder methods rely on manual monitoring or simple scheduled tasks, which are difficult to adapt to large-scale, high-efficiency work order processing, and do not provide flexible time allocation and task early warning mechanisms, resulting in task backlog or processing delays.

Method used

A time wheel data structure is constructed by dividing the time into multiple fixed-length time slots and connecting them in a circular linked list. The target object is determined based on the work order type, object load, and historical processing efficiency. The time slot interval is dynamically adjusted, and the time wheel is driven to roll by a timer to extract overdue work orders for reminders.

Benefits of technology

It achieves high efficiency and accuracy in work order deadline reminders and system adaptability, avoids task backlog, ensures rapid response to high-priority work orders, and reduces system resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121390658A_ABST
    Figure CN121390658A_ABST
Patent Text Reader

Abstract

The invention discloses a work order time limit reminding method and system based on a time wheel, and the method comprises the steps: constructing a time wheel data structure, dividing a time wheel into a plurality of fixed-length time slots, and enabling the time slots to be connected in an annular chain table form; according to the time slot task chain table length, the work order priority, the system load, the work order priority weight and the system load weight, the time slot interval of the time wheel of the layer is adjusted, the corresponding target time slot position is determined according to the work order time limit and the current time, and the work order is registered in the target time slot; driving a time wheel to roll through a timer, wherein the current time slot is activated during each rolling; and extracting an expired work order from the activated time slot, checking whether a task corresponding to the expired work order is completed or not, and triggering a reminding logic corresponding to the expired work order if the task is not completed. The work order processing accuracy and efficiency are improved, and the method has high flexibility and expandability, is suitable for various enterprises, and assists in improving the efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of work order technology, and in particular relates to a work order time limit reminder method and system based on a time wheel. Background Technology

[0002] As business expands and scales, existing work order deadline reminder methods often rely on manual monitoring or simple scheduled tasks, which are difficult to adapt to the needs of large-scale, high-efficiency work order processing.

[0003] Against this backdrop, there is an urgent need for a more efficient and intelligent method for reminding work order deadlines.

[0004] Prior art document (CN 112181614 A) discloses a task timeout monitoring method, apparatus, device, system, and storage medium. This method is based on a time wheel structure. It determines the task's timeout by searching for the first target time slot corresponding to the current time in a pre-stored N-level time wheel and mapping it level by level to the time slots of the first-level time wheel according to a hierarchical relationship. The time slots of the N-level time wheel are associated with a task linked list, where task nodes represent the timeout of a specific task. When a target time slot matches, the system determines the target task node based on that time slot, generates a task closure command accordingly, and finally sends the task closure command to close the task identifier corresponding to the target task node.

[0005] However, existing technical documents only focus on the shutdown process after a task times out, without providing a more flexible time allocation and task early warning mechanism. Furthermore, the static structure of the N-level time wheel is difficult to dynamically adjust based on factors such as task priority and system load, resulting in low response efficiency for high-priority tasks. Simultaneously, this method only performs a shutdown operation after a task times out, failing to provide effective early intervention measures for tasks about to time out, which can easily lead to task backlog or processing delays. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a time wheel-based work order deadline reminder method and system, which can rationally allocate time resources and improve response efficiency, thereby improving the efficiency and accuracy of large-scale work order deadline reminders.

[0007] The present invention adopts the following technical solution.

[0008] The first aspect of the present invention provides a work order deadline reminder method based on a time wheel, comprising the following:

[0009] Construct a time wheel data structure, divide the time wheel into multiple time slots of fixed length, and connect the time slots in the form of a circular linked list;

[0010] Determine the target object based on the work order type, the current load of the object, and its historical processing efficiency;

[0011] The interval of the time slot corresponding to this layer of time wheel is adjusted according to the length of the time slot task chain, the work order priority, the system load, the work order priority weight and the system load weight. The position of the target time slot corresponding to the work order is determined according to the work order time limit and the current time, and the work order is registered to the target time slot of the target object.

[0012] The time wheel is driven to scroll using a timer, and the current time slot is activated with each scroll.

[0013] Extract due work orders from the activated time slot, check whether the tasks corresponding to the due work orders have been completed, and trigger the reminder logic for the due work orders if they have not been completed.

[0014] Optionally, the target time slot position can be determined based on the work order's time limit and the current time, including:

[0015] Calculate the difference between the work order deadline and the current time to obtain the remaining time:

[0016] Divide the remaining duration by the interval of the time slot corresponding to the current time wheel to obtain the slot index;

[0017] The target time slot position is determined based on the slot index.

[0018] Optionally, the interval of the time slot corresponding to this layer of the time wheel can be adjusted based on the length of the time slot task list, work order priority, system load, work order priority weight, and system load weight, including:

[0019] If the length of the time slot task list exceeds the preset length threshold, adjust the time slot interval.

[0020] The interval of the time slot corresponding to this layer's time wheel is adjusted based on the work order priority, system load, work order priority weight, and system load weight.

[0021] Optionally, if the length of the time slot task list exceeds a preset length threshold, the time slot interval can be adjusted, including:

[0022] Multiply the number of time slots in this layer of the time wheel by the preset adjustment coefficient to obtain the new number of time slots;

[0023] Divide the maximum coverage time of the current time wheel by the new number of time slots to obtain the new time slot interval of the current time wheel.

[0024] Optionally, the time slot interval of this layer's time wheel can be adjusted based on work order priority, system load, work order priority weight, and system load weight, including:

[0025] The first degree of dependence between time slot interval and work order priority is calculated based on the joint probability distribution of time slot interval and work order priority, the marginal probability distribution of time slot interval, and the marginal probability distribution of work order priority.

[0026] The second degree of dependence between time slot interval and system load is calculated based on the joint probability distribution of time slot interval and system load, the marginal probability distribution of time slot interval and system load.

[0027] The time slot interval is dynamically adjusted based on the first degree of dependence, the second degree of dependence, the work order priority weight, and the system load weight.

[0028] Optionally, the time slot interval of the current time wheel can be adjusted according to the following formula based on work order priority, system load, work order priority weight, and system load weight:

[0029]

[0030] In the formula, T is the adjusted time slot interval, T base The time slot interval before adjustment is given, where U is the quantized value of work order priority, L is the quantized value of system load, wU is the work order priority weight, and wL is the system load weight.

[0031] Optionally, the target object can be determined based on the work order type, the object's current load, and historical processing efficiency, including:

[0032] The current load of each object is evaluated to obtain the load index corresponding to each object;

[0033] Analyze historical processing efficiency and calculate efficiency indicators for each object in processing different types of work orders;

[0034] An intelligent matching model is constructed based on work order type, object load index, and efficiency indicators to determine the target object.

[0035] Optionally, the method further includes:

[0036] When the time limit of a work order exceeds the maximum coverage time of the current time wheel, multiple time wheels are constructed, with different time wheels corresponding to different time levels; the scrolling of the slot of the upper time wheel triggers the registration operation of the lower time wheel.

[0037] Optionally, the method further includes:

[0038] Extract due work orders from the activated time slot, encapsulate the due work orders into messages, and send them to the message queue according to the priority of the due work orders. Remind users in the order of the messages in the message queue. If the message queue fails to send, it will be automatically resent until it is successfully sent.

[0039] A second aspect of the present invention provides a time-wheel-based work order deadline reminder system. The system includes a message queue and a business Redis. The message queue is used to receive, buffer, and forward work order tasks, and the business Redis is used to store the time wheel status and work order registration information. The system also includes a work order deadline reminder device, which comprises:

[0040] The time wheel construction module is used to build the time wheel data structure, which divides the time wheel into multiple time slots of fixed length, and the time slots are connected in the form of a circular linked list;

[0041] The target object determination module is used to determine the target object based on the work order type, the current load of the object, and historical processing efficiency.

[0042] The time slot determination module is used to adjust the time slot interval of the current time wheel based on the length of the time slot task chain, work order priority, system load, work order priority weight, and system load weight. It also determines the corresponding target time slot position based on the work order time limit obtained from the message queue and the current time, registers the work order to the target time slot, and sends the work order registration information and time wheel status to the business Redis for storage.

[0043] The time wheel scrolling module is used to drive the time wheel to scroll via a timer, activating the current time slot with each scroll.

[0044] The reminder trigger module is used to extract due work orders from the active time slot and trigger the reminder logic corresponding to the due work orders.

[0045] A third aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when loaded onto the processor, implements the above-described time wheel-based work order time limit reminder method.

[0046] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described time wheel-based work order time limit reminder method.

[0047] Compared with the prior art, the beneficial effects of the present invention include at least the following:

[0048] This invention enables the system to flexibly adjust the interval length of the time slot based on the urgency of the work order, the current load, and historical processing data through a mechanism of dynamically adjusting the time slot interval. This allows for more rational allocation of time resources, reduced system resource consumption, improved response efficiency, and increased accuracy of timeout reminders.

[0049] This invention employs an intelligent work order allocation mechanism that matches work orders upon entering the time wheel based on work order type, current workload, and historical processing efficiency. This achieves balanced task distribution, avoids task backlog, and ensures faster response times for high-priority work orders. This invention enhances the system's adaptability to work orders of varying urgency by optimizing work order allocation strategies, balancing the load, reducing task backlog, improving overall processing efficiency, and mitigating the risks associated with task timeouts, making the system more intelligent and adaptive. Attached Figure Description

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

[0051] Figure 1 This is a schematic diagram of a work order time limit reminder method based on a time wheel provided in an embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of another work order time limit reminder method based on a time wheel provided in an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of a work order time limit reminder system based on a time wheel provided in an embodiment of the present invention. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.

[0055] Combination Figure 1 As shown, Embodiment 1 of the present invention provides a work order time limit reminder method based on a time wheel, including:

[0056] S1: Construct a time wheel data structure, divide the time wheel into multiple time slots of fixed length, and connect the time slots in the form of a circular linked list.

[0057] Specifically, the time wheel data structure is constructed by dividing time into multiple time slots of fixed length, which are connected in a circular linked list to form a cyclic structure. For example, the time slot interval of the first layer of the time wheel is set to 10 minutes, covering a time range of 1 hour, for a total of 6 time slots. The current time is 14:00, and the time wheel includes 6 time slots, namely time slot 0 to time slot 5. When the time reaches 15:00, the time wheel returns to time slot 0, forming a cyclic structure.

[0058] S2: Determine the target object based on the work order type, the current load of the object, and historical processing efficiency. S2 specifically includes:

[0059] S2.1: Receive newly entered work orders, parse the work order information, and obtain the work order type.

[0060] It should be noted that the work order types include urgent, regular, high priority, low priority, etc.

[0061] S2.2: Evaluate the current load of each object to obtain the load index corresponding to each person in charge. Specifically:

[0062] Monitor the working status of each object in real time and obtain its current load, including the number of work orders being processed, the estimated completion time, and the system resource utilization rate, such as but not limited to CPU and memory utilization.

[0063] Set a load threshold and quantify the load index of the object by comparing the current load with the load threshold. The load index can be set to a value between 1 and 5, where 1 represents the minimum load index value and 5 represents the maximum load index value. The specific value is dynamically adjusted according to the actual load situation.

[0064] S2.3: Analyze historical processing efficiency and calculate the efficiency index of each object in processing different types of work orders.

[0065] The system collects and stores historical data on the processing of different types of work orders by each object, including processing time, completion rate, user feedback, etc.

[0066] Based on historical data, efficiency indicators for each object in handling different types of work orders are calculated, such as average processing time and success rate, and quantified as an efficiency index. The efficiency index can also be set to a value between 1 and 5, where 1 represents the lowest efficiency and 5 represents the highest efficiency.

[0067] S2.4: Construct an intelligent matching model based on work order type, object load index, and efficiency indicators to determine the target object. Specifically:

[0068] The product of work order type and its weight is summed with the product of the inverse of load index and its weight, and then added to the product of efficiency index and its weight to construct an intelligent matching model, calculate the matching score for each object, and select the object with the highest matching score for assignment.

[0069] Specifically, the intelligent matching model can set the weight of each factor according to the actual situation in order to achieve the most reasonable work order allocation.

[0070] One of the key features of this invention is the use of a matching model to evaluate each new work order, calculate the matching score for each object, and select the object with the highest matching score for allocation. This allocation decision aims to ensure that high-priority work orders are processed quickly while avoiding task backlog for certain objects, thus achieving a balanced task distribution. During the allocation process, the system monitors the load of objects in real time. If an object is found to be overloaded, its load index can be dynamically adjusted, and the matching score can be recalculated to ensure a balanced task allocation.

[0071] S3: Adjust the interval of the time slot corresponding to this layer of time wheel according to the length of the time slot task chain, work order priority, system load, work order priority weight and system load weight, and determine the corresponding target time slot position according to the work order time limit and the current time, and register the work order to the target time slot.

[0072] S3 specifically includes:

[0073] S3.1: Adjust the time slot interval of this layer's time wheel based on the length of the time slot task list, work order priority, system load, work order priority weight, and system load.

[0074] Optionally, in S3.1, the time slot interval of this layer's time wheel is adjusted based on the length of the time slot task list, work order priority, system load, work order priority weight, and system load, including:

[0075] S3.1.1: If the length of the time slot task list exceeds the preset length threshold, adjust the time slot interval.

[0076] S3.1.1 specifically includes: multiplying the number of time slots in the current time wheel by a preset adjustment coefficient to obtain a new number of time slots; dividing the maximum coverage time of the current time wheel by the new number of time slots to obtain a new time slot interval for the current time wheel.

[0077] If the task list length within a certain time slot exceeds 10 tasks, the system automatically expands the number of time slots. For example, during peak periods, such as at 14:15, if the task list length in the third time slot of the first-level time wheel (14:20-14:30) exceeds 10 tasks, the system will automatically expand the number of time slots, such as increasing it to 1.5 times the original number, i.e., 9 time slots. The new time slot interval may be adjusted to 6.67 minutes to accommodate higher task density.

[0078] It is understood that the specific value of the preset adjustment coefficient can be set according to the actual situation, and this embodiment does not impose any restrictions.

[0079] S3.1.2: Adjust the time slot interval of the time wheel in this layer according to the work order priority, system load, work order priority weight, and system load.

[0080] Optionally, the time slot intervals corresponding to different priority work orders can be set according to the work order priority, and the time slots can be extended or shortened proportionally according to the system load.

[0081] Different time slot intervals are set based on the urgency of the work orders. For example, the time slot interval T1 for high-priority work orders is set to 1 minute, and the time slot interval T2 for low-priority work orders is set to 10 minutes. The time slot interval is dynamically adjusted according to the system load. When the system load is high, such as when the CPU utilization exceeds 80%, the time slot interval ΔT is extended by 5 minutes; when the system load is low, such as when the CPU utilization is below 30%, the time slot interval is shortened to 80% of the original. Here, the determination of high system load is based on obtaining the system CPU utilization through an interface, and ultra-high and ultra-low thresholds are defined, and adjustments are made according to the thresholds.

[0082] The time slot intervals for different priority work orders are set based on their priority. This means that high-priority work orders should be processed faster, and their corresponding time slot intervals should be shorter, ensuring that urgent or important work orders receive timely attention and processing. The time slot intervals are dynamically adjusted according to system load. When the system load is high, extending the time slot interval can reduce the immediate processing pressure on the system and avoid system overload. Conversely, when the system load is low, shortening the time slot interval can improve the system's response speed, utilize system resources more efficiently, and help maintain system stability and efficiency.

[0083] Optionally, adjusting the time slot interval of this layer's time wheel based on work order priority, system load, work order priority weight, and system load includes:

[0084] The time slot interval of this layer's time wheel is adjusted according to the following formula based on work order priority, system load, work order priority weight, and system load weight:

[0085]

[0086] In the formula, T is the adjusted time slot interval, T base The time slot interval is shown before adjustment. U is the priority quantization value of the work order, L is the system load quantization value, wU is the work order priority weight, and wL is the system load weight. U can be set according to priority; for example, the highest priority U quantization value is 3, decreasing by 1 for each subsequent priority. When the CPU utilization is 30%, L is 30. As shown in the formula, the higher the priority, the smaller the time slot interval; the higher the load, the larger the time slot interval.

[0087] In this embodiment, the time slot interval of the current time wheel is adjusted based on work order priority, system load, and their weights. When adjusting the time slot interval, the relative importance (i.e., weight) of each factor is considered. This allows system administrators to flexibly adjust the impact of different factors on the time slot interval according to actual needs. Combining work order priority and system load to comprehensively determine the time interval can reduce system resource consumption and improve response efficiency.

[0088] Optionally, the time slot interval of this layer's time wheel can be adjusted based on work order priority, system load, work order priority weight, and system load weight, including:

[0089] The first degree of dependence between time slot interval and work order priority is calculated based on the joint probability distribution of time slot interval and work order priority, the marginal probability distribution of time slot interval, and the marginal probability distribution of work order priority.

[0090] The second degree of dependence between time slot interval and system load is calculated based on the joint probability distribution of time slot interval and system load, the marginal probability distribution of time slot interval, and the marginal probability distribution of system load.

[0091] The time slot interval is dynamically adjusted based on the first degree of dependence, the second degree of dependence, the work order priority weight, and the system load weight.

[0092] Optionally, the first degree of dependence between the time slot interval and the work order priority, and the second degree of dependence between the time slot interval and the system load are calculated using the following formula:

[0093]

[0094] In the formula, I(T;U) represents the first degree of dependence between the time slot interval T and the work order priority U, I(T;L) represents the second degree of dependence between the time slot interval and the system load, p(x,y) represents the joint probability distribution of the time slot interval and the work order priority, p(x) represents the marginal probability distribution of the time slot interval, p(y) represents the marginal probability distribution of the work order priority, p(x,z) represents the joint probability distribution of the time slot interval T and the system load L, and p(z) represents the marginal probability distribution of the system load.

[0095] Optionally, the time slot interval can be dynamically adjusted according to the first dependency level, the second dependency level, the work order priority weight, and the system load weight using the following formula:

[0096] T = T base ×(1+wU×I(T;U)-wL×I(T;L)),

[0097] In the formula, T is the adjusted time slot interval, T base The time slot interval before adjustment is given. I(T;U) represents the first degree of dependence between the time slot interval T and the work order priority U, and I(T;L) represents the second degree of dependence between the time slot interval and the system load. wU is the priority weight, and wL is the system load weight. If I(T;U) is high, it indicates that the time slot interval and the work order priority have a strong dependency relationship.

[0098] In this embodiment, I(T;U) and I(T;L) are used to adjust the impact of priority and system load on the time interval, respectively. In practical applications, these two parameters can be set through training / configuration to conform to business strategies, such as emphasizing task priority or system resource protection, providing good adjustability and adaptability. Moreover, by quantifying the degree of dependency and dynamically adjusting the time slot interval based on these relationships, it can more intelligently adapt to different task priorities and system load conditions, thereby improving system performance.

[0099] S3.2: Determine the corresponding target time slot position based on the work order time limit and the current time.

[0100] Optionally, S3.2 includes: calculating the difference between the work order time limit and the current time to obtain the remaining time; dividing the remaining time by the time slot interval of this layer to obtain the slot index; and determining the target time slot position based on the slot index.

[0101] Optionally, the target time slot location can be determined based on the slot index, including:

[0102] When the time limit of a work order exceeds the maximum coverage time of the current time wheel, multiple time wheels are constructed, with different time wheels corresponding to different time levels; the scrolling of the slot of the upper time wheel triggers the registration operation of the lower time wheel.

[0103] Specifically, the multi-layered time wheel design is used for scheduling high-precision, long-latency tasks. Each slot in the first-layer time wheel is responsible for tasks with shorter time intervals, such as seconds or minutes. When the current slot in the first-layer time wheel reaches its end and contains tasks that need to be delayed, these tasks are transferred and re-registered to the second-layer time wheel. Each slot in the second-layer time wheel corresponds to a longer time interval, such as hours or days. This process continues, with tasks being passed down layer by layer until they finally reach the target time slot to trigger an alert.

[0104] The hierarchical structure effectively reduces the number of slots and memory consumption in each time wheel while maintaining the accuracy of task scheduling.

[0105] Specifically, after the current time wheel's time slot finishes rolling, the tasks within the time slot are checked, their remaining time limits are calculated, and it is determined whether they need to be passed to the next time wheel. If the work order's time limit exceeds the current layer's maximum coverage time, a cross-layer registration operation is triggered, adding the work order to the target time slot of the next time wheel.

[0106] In some embodiments, assuming the current time is 14:00, a work order needs to trigger a reminder at 15:30. The remaining time is calculated to be 90 minutes. Based on the first-level time wheel's time slot interval of 10 minutes, the target time slot is 9. However, since 9 exceeds the first-level time wheel's maximum coverage time of 60 minutes, the work order will be registered in the second-level time wheel's 15:00-16:00 time slot. When 15:00 arrives, the work order is downgraded to a lower-level time wheel and reassigned to an appropriate time slot.

[0107] In this embodiment, cross-layer registration via multi-layer time wheels ensures efficient task scheduling and accurate reminders, making it particularly suitable for large-scale, high-latency distributed work order scenarios, while also improving the system's scalability and stability.

[0108] S4: Drive the time wheel to scroll via a timer, activating the current time slot with each scroll.

[0109] S4 specifically includes:

[0110] Each time the scroll occurs, the scheduling pointer moves one time slot.

[0111] When the scheduling pointer moves to the next time slot, the time slot is activated and the corresponding work order task is read.

[0112] If the current time slot is empty, the scheduling pointer moves to the next time slot.

[0113] S5: Extract due work orders from the activated time slot, check whether the tasks corresponding to the due work orders have been completed, and trigger the reminder logic corresponding to the due work orders if they have not been completed.

[0114] In S5, due work orders are extracted from the active time slot, encapsulated into messages, and sent to the message queue according to the priority of the due work orders. Users are reminded in the order in the message queue. If the message queue fails to send, it is automatically resent until it is successfully sent.

[0115] The timer drives the time wheel to rotate according to the time slot intervals. For example, at 14:20, the first time wheel rotates to the second time slot 14:20-14:30 and checks whether there are any work orders to be triggered in that time slot.

[0116] For example, when the first-level time wheel scrolls to 15:20, the active 15:20-15:30 time slot contains overdue work orders. These work orders are encapsulated as messages and sent to the message queue. The message queue immediately pushes the overdue messages to consumers, such as user reminder services. For example, for work orders requiring SMS reminders, the message queue calls the SMS interface to send the reminder; for work orders requiring app push notifications, it calls the corresponding app push interface.

[0117] Optionally, the method further includes:

[0118] When a time slot in the upper-level time wheel is activated, all work orders in that slot are checked. Based on the remaining time of the work orders, it is determined whether the work orders need to be reallocated and whether they should be sent to the next level of the time wheel.

[0119] The criteria for determining whether a reallocation is necessary include at least one of the following:

[0120] The current time slot of the time wheel cannot cover the remaining duration of the work order, the work order time limit falls outside the next rolling cycle of the current time wheel, or the current time slot is about to roll, but the work order has not yet met the execution conditions.

[0121] Specifically, the slot index is calculated as ceil(remaining duration / current time slot interval), where ceil indicates a function name. If the calculated slot index exceeds the maximum index value of the current time wheel, it means the task cannot be precisely located in the current layer and will be reassigned to the corresponding slot in the next time wheel layer. After the task is "reduced," the system re-executes the above steps in the next time wheel layer until the most suitable time slot is found. For example, when the time reaches 15:00, the 15:00-16:00 time slot in the second time wheel layer is activated. At this time, work orders previously registered to this time slot, such as those needing to be triggered at 15:30, will be downgraded to the first time wheel layer and reassigned to a suitable time slot, such as 15:20-15:30. When the first time wheel layer scrolls to 15:20, the work order is retrieved and a reminder is triggered.

[0122] Optionally, message queues support message processing by priority. For example, messages for high-priority work orders will be sent first to ensure that urgent work orders are processed in a timely manner.

[0123] Optionally, if the notification is sent successfully, the message queue will receive an acknowledgment.

[0124] Optionally, if the app push notification for the work order fails to be sent, the message queue will automatically resend it according to the configuration.

[0125] For example, the resend count can be set to 3 times, with a 5-minute interval between each resend. If multiple resends still fail, the message will be persistently stored. Once the network is restored, the message queue will continue sending reminder messages until the reminder is successful.

[0126] In this embodiment, work order reminders are sent to users via a message queue, ensuring the real-time nature and reliability of the reminders. Using message queue technology, expired work order tasks in the time wheel are first encapsulated into messages and sent to the message queue. The message queue features asynchronous processing, a distributed architecture, and persistent storage capabilities, effectively preventing reminder loss due to high concurrency or network fluctuations. Real-time performance is achieved through the message queue's high throughput, meaning expired messages are immediately pushed to consumers, such as, but not limited to, user reminder services or notification systems. Reliability is guaranteed by the message queue's confirmation mechanism and retry strategy: if a reminder fails to send, the queue can automatically resend or persistently store the message according to its configuration until the reminder is successful. Furthermore, it supports message processing by priority; for example, urgent work order messages can be sent first, while ordinary tasks are queued and pushed in sequence, ensuring users receive critical information promptly. This mechanism also supports integration with various user notification methods, such as, but not limited to, SMS, email, and app push notifications, diversifying reminder methods. By introducing a message queue, not only are the real-time nature and reliability of the reminder system improved, but scalability and stability are also enhanced, making it suitable for work order reminder needs in high-concurrency task scenarios.

[0127] Optional, combined Figure 2 As shown, if a work order is not processed after the first reminder, a second reminder or automatic escalation will be performed.

[0128] The system can notify a higher-level manager to intervene or take other measures to ensure that work orders are processed in a timely manner. For example, if the system detects that a work order that should have been triggered at 15:30 has not been processed at 15:35, it will immediately issue a second reminder, notifying the responsible person simultaneously via email and telephone.

[0129] Through the above specific implementation methods, practical examples, and implementation steps in conjunction with the appendix document, this invention fully demonstrates the practical application effects of innovative features such as multi-layer time wheel structure, dynamic adjustment of time wheel parameters, and use of message queues to send work orders, significantly improving the accuracy and efficiency of work order processing.

[0130] In this embodiment, work order reminders are implemented through time wheel construction, work order registration, time wheel scrolling, and reminder triggering. The time wheel is initialized, dividing time into multiple fixed-length time slots connected by a circular linked list to form a loop structure. When a work order's deadline exceeds the range of a single-layer time wheel, the system constructs multiple layers of time wheels to store long-term tasks. After receiving work order information, the system calculates the remaining time between the current time and the work order's deadline and determines the target time slot. If the system load is high or work orders are unevenly distributed, the time slot interval is dynamically adjusted to ensure balanced processing. The timer is set to trigger at a frequency according to the time slot interval, pushing the time wheel forward and migrating higher-level tasks to lower-level execution. When a time slot is activated, the system retrieves due work orders, triggers reminders according to priority, and updates the task status. For unprocessed or overdue work orders, the system performs secondary reminders, reallocation, or escalation processing to ensure efficient task execution.

[0131] Combination Figure 2 As shown, Embodiment 2 of the present invention provides a time-wheel-based work order deadline reminder system. The system includes a message queue and a business Redis. The message queue is used to receive, buffer, and forward work order tasks, and the business Redis is used to store the time wheel status and work order registration information. The system also includes a work order deadline reminder device, which includes:

[0132] The time wheel construction module is used to build the time wheel data structure, which divides the time wheel into multiple time slots of fixed length, and the time slots are connected in the form of a circular linked list;

[0133] The target object determination module is used to determine the target object based on the work order type, the current load of the object, and historical processing efficiency.

[0134] The time slot determination module is used to adjust the time slot interval of the current time wheel based on the length of the time slot task chain, work order priority, system load, work order priority weight, and system load weight. It also determines the corresponding target time slot position based on the work order time limit obtained from the message queue and the current time, registers the work order to the target time slot, and sends the work order registration information and time wheel status to the business Redis for storage.

[0135] The time wheel scrolling module is used to drive the time wheel to scroll via a timer, activating the current time slot with each scroll.

[0136] The reminder trigger module is used to extract due work orders from the active time slot and trigger the reminder logic corresponding to the due work orders.

[0137] In this embodiment, Figure 3This describes a process from a Message Queue (MQ) to a Remote Dictionary Server (RDS) and then to microservice storage. The MQ is used to receive, buffer, and forward work order tasks, allowing asynchronous communication between different systems or applications. The RDS is a high-performance key-value store used to store time wheel states, work order registration information, etc. Its high-speed read / write capabilities make it suitable for implementing logic such as time wheel state tracking, task caching, and expiration control.

[0138] Specifically, after a monitoring MQ ticket receives a task, it is processed by the business Redis, and the execution order of the task is controlled according to the time wheel state. If a timeout occurs while saving a microservice, a corresponding timeout ticket status is triggered, and a monitoring IQ ticket is generated to monitor the operation of the entire system. As the time wheel rolls, the task is removed from the task list of the time slot after the time expires, the change information is updated in Redis, and the user is notified. This process summarizes the time wheel states of the microservices to facilitate monitoring of the overall system status.

[0139] Embodiment 3 of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements the time wheel-based work order time limit reminder method described in Embodiment 1.

[0140] Embodiment 4 of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the time-wheel-based work order time limit reminder method according to Embodiment 1.

[0141] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0142] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0143] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0144] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0145] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A work order deadline reminder method based on a time wheel, characterized in that, Includes the following: Construct a time wheel data structure, divide the time wheel into multiple time slots of fixed length, and connect the time slots in the form of a circular linked list; Determine the target object based on the work order type, the current load of the object, and its historical processing efficiency; The interval of the time slot corresponding to this layer of time wheel is adjusted according to the length of the time slot task chain, the work order priority, the system load, the work order priority weight and the system load weight. The position of the target time slot corresponding to the work order is determined according to the work order time limit and the current time, and the work order is registered to the target time slot of the target object. The time wheel is driven to scroll using a timer, and the current time slot is activated with each scroll. Extract due work orders from the activated time slot, check whether the tasks corresponding to the due work orders have been completed, and trigger the reminder logic for the due work orders if they have not been completed.

2. The work order time limit reminder method based on time wheel according to claim 1, characterized in that: The target time slot position is determined based on the work order's time limit and the current time, including: Calculate the difference between the work order deadline and the current time to obtain the remaining time: Divide the remaining duration by the interval of the time slot corresponding to the current time wheel to obtain the slot index; The target time slot position is determined based on the slot index.

3. The work order time limit reminder method based on a time wheel according to claim 1, characterized in that: The interval of the time slot corresponding to this layer of the time wheel is adjusted based on the length of the time slot task list, work order priority, system load, work order priority weight, and system load weight, including: If the length of the time slot task list exceeds the preset length threshold, adjust the time slot interval. The interval of the time slot corresponding to this layer's time wheel is adjusted based on the work order priority, system load, work order priority weight, and system load weight.

4. The work order time limit reminder method based on a time wheel according to claim 3, characterized in that: If the length of the time slot task list exceeds a preset length threshold, the time slot interval will be adjusted, including: Multiply the number of time slots in this layer of the time wheel by the preset adjustment coefficient to obtain the new number of time slots; Divide the maximum coverage time of the current time wheel by the new number of time slots to obtain the new time slot interval of the current time wheel.

5. The work order time limit reminder method based on a time wheel according to claim 4, characterized in that: The time slot interval of this layer's time wheel is adjusted based on work order priority, system load, work order priority weight, and system load weight, including: The first degree of dependence between time slot interval and work order priority is calculated based on the joint probability distribution of time slot interval and work order priority, the marginal probability distribution of time slot interval, and the marginal probability distribution of work order priority. The second degree of dependence between time slot interval and system load is calculated based on the joint probability distribution of time slot interval and system load, the marginal probability distribution of time slot interval and system load. The time slot interval is dynamically adjusted based on the first degree of dependence, the second degree of dependence, the work order priority weight, and the system load weight.

6. The work order time limit reminder method based on time wheel according to claim 4, characterized in that: The time slot interval of this layer's time wheel is adjusted according to the following formula based on work order priority, system load, work order priority weight, and system load weight: In the formula, T is the adjusted time slot interval, T base The time slot interval before adjustment is given, where U is the quantized value of work order priority, L is the quantized value of system load, wU is the work order priority weight, and wL is the system load weight.

7. The work order time limit reminder method based on time wheel according to claim 1, characterized in that: The target objects are determined based on the work order type, the current load of the object, and historical processing efficiency, including: The current load of each object is evaluated to obtain the load index corresponding to each object; Analyze historical processing efficiency and calculate efficiency indicators for each object in processing different types of work orders; An intelligent matching model is constructed based on work order type, object load index, and efficiency indicators to determine the target object.

8. The work order time limit reminder method based on time wheel according to claim 1, characterized in that: The method further includes: When the time limit of a work order exceeds the maximum coverage time of the current time wheel, multiple time wheels are constructed, with different time wheels corresponding to different time levels; the scrolling of the slot of the upper time wheel triggers the registration operation of the lower time wheel.

9. The work order time limit reminder method based on time wheel according to claim 1, characterized in that: The method further includes: Extract due work orders from the activated time slot, encapsulate the due work orders into messages, and send them to the message queue according to the priority of the due work orders. Remind users in the order of the messages in the message queue. If the message queue fails to send, it will be automatically resent until it is successfully sent.

10. A time-wheel-based work order deadline reminder system, comprising the time-wheel-based work order deadline reminder method according to any one of claims 1-9, characterized in that, The system includes a message queue and a business Redis. The message queue is used to receive, buffer, and forward work order tasks, and the business Redis is used to store the time wheel status and work order registration information. The system also includes a work order time limit reminder device, which includes: The time wheel construction module is used to build the time wheel data structure, which divides the time wheel into multiple time slots of fixed length, and the time slots are connected in the form of a circular linked list; The target object determination module is used to determine the target object based on the work order type, the current load of the object, and historical processing efficiency. The time slot determination module is used to adjust the time slot interval of the current time wheel based on the length of the time slot task chain, work order priority, system load, work order priority weight, and system load weight. It also determines the corresponding target time slot position based on the work order time limit obtained from the message queue and the current time, registers the work order to the target time slot, and sends the work order registration information and time wheel status to the business Redis for storage. The time wheel scrolling module is used to drive the time wheel to scroll via a timer, activating the current time slot with each scroll. The reminder trigger module is used to extract due work orders from the active time slot and trigger the reminder logic corresponding to the due work orders.

11. An electronic device, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the time wheel-based work order time limit reminder method according to any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the time wheel-based work order time limit reminder method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Task timeout monitoring method, device, equipment and system and storage medium

    CN112181614A