Task processing method and device
By introducing multiple task -level overtime detection tasks in the task processing method, the problem of low detection task processing efficiency is solved, and more efficient service stability monitoring and response are achieved.
Patent Information
- Application Number
- CN202411536052.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-21
AI Technical Summary
On the Internet, the processing efficiency of detection tasks is inefficient, which makes it difficult to guarantee service stability. Especially in the field of conversations, how to better handle detection tasks has become a challenge.
By introducing multiple task -level overtime detection tasks in the task processing method, obtain the current time according to the time cycle of each level, match the storage block that has been over time, read the event data item, and perform timeout response according to the task level.
It improves the processing efficiency of the test task, ensures the stable operation of the service, and enhances the monitoring and response capabilities of the service operation status.
Smart Images

Figure CN119336473A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of data processing technology, and in particular to a task processing method and device. Background Art
[0002] With the continuous development of Internet technology and the continuous advancement of social information, more and more detection tasks are appearing on the Internet. The detection of detection tasks is used to ensure the stable operation of related services and reduce the frequency of emergencies during service operation. As the universality of service operation detection through detection tasks becomes higher and higher, the application areas of service operation detection through detection tasks are gradually expanding, such as the conversation field. In this process, how to better and more effectively handle detection tasks has become a challenge faced by task parties and has gradually attracted the attention of more task parties. Summary of the invention
[0003] One or more embodiments of the present specification provide a task processing method, including: obtaining the current time according to the time period of the timeout detection task of multiple task levels. Matching the current time with the preset timeout time of the storage block of the corresponding target timeout detection task to obtain the timed storage block. Reading the data item of the event stored in the timed storage block. According to the event processing method of the task level of the target timeout detection task, performing timeout response processing on the data item of the read event.
[0004] One or more embodiments of the present specification provide a task processing device, including: a time acquisition module, configured to acquire the current time according to the time period of the timeout detection task of multiple task levels. A matching processing module, configured to match the current time with the preset timeout time of the storage block of the corresponding target timeout detection task to obtain the timed storage block. A data reading module, configured to read the data item of the event stored in the timed storage block. A timeout response module, configured to perform timeout response processing on the data item of the read event according to the event processing method of the task level of the target timeout detection task.
[0005] One or more embodiments of the present specification provide a task processing device, including: a processor; and a memory configured to store computer executable instructions, wherein when the computer executable instructions are executed, the processor: obtains the current time according to the time period of the timeout detection tasks of multiple task levels. Matches the current time with the preset timeout time of the storage block of the corresponding target timeout detection task to obtain the timed storage block. Reads the data item of the event stored in the timed storage block. Performs timeout response processing on the read event data item according to the event processing method of the task level of the target timeout detection task.
[0006] One or more embodiments of the present specification provide a computer-readable storage medium for storing computer-executable instructions, which implement the following steps when executed: obtaining the current time according to the time period of timeout detection tasks at multiple task levels. Matching the current time with the preset timeout time of the storage block of the corresponding target timeout detection task to obtain a timed storage block. Reading the data item of the event stored in the timed storage block. Performing timeout response processing on the read event data item according to the event processing method of the task level of the target timeout detection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. Figure 1 A schematic diagram of an implementation environment of a task processing method provided for one or more embodiments of this specification; Figure 2 A processing flow chart of a task processing method provided for one or more embodiments of this specification; FIG3 (a) is a schematic diagram of a task hierarchy provided by one or more embodiments of this specification; FIG3( b ) is a schematic diagram of a data item storage provided by one or more embodiments of this specification; Figure 4 A processing flow chart of a task processing method applied to a conversation event scenario provided by one or more embodiments of this specification; Figure 5 A schematic diagram of an embodiment of a task processing device provided for one or more embodiments of this specification; Figure 6 A schematic diagram of the structure of a task processing device provided in one or more embodiments of this specification. DETAILED DESCRIPTION
[0008] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0009] The task processing method provided in one or more embodiments of this specification can be applied to the implementation environment of a distributed system. Figure 1 , the implementation environment at least includes: Distributed system 101, storage block 102 for timeout detection tasks at multiple task levels; The distributed system 101 may include one or more distributed nodes, and each distributed node may be one or more servers, a server cluster consisting of several servers, or a cloud server of a cloud computing platform.
[0010] The storage block 102 of the timeout detection tasks of multiple task levels may be a physical storage area or a physical storage unit.
[0011] In this implementation environment, the distributed system 101 obtains the current time according to the time period of the timeout detection tasks at multiple task levels, matches the current time with the preset timeout time of the storage block of the target timeout detection task corresponding to the current time, obtains the timed-out storage block, and performs timeout response processing on the data item of the event stored in the timed-out storage block according to the event processing method of the task level of the target timeout detection task; The storage block of the target timeout detection task is included in the storage blocks 102 of timeout detection tasks at multiple task levels.
[0012] One or more embodiments of a task processing method provided in this specification are as follows: Reference Figure 2 The task processing method provided in this embodiment specifically includes steps S202 to S208.
[0013] Step S202, obtaining the current time according to the time period of the timeout detection tasks of multiple task levels.
[0014] The timeout detection task in this embodiment refers to a task of performing timeout detection on a data item of an event stored in a storage block of the timeout detection task. The timeout detection task can be used to detect whether a data item of an event stored in a storage block of the timeout detection task has timed out. This embodiment can be applied to a distributed system, which may include one or more distributed nodes.
[0015] The multiple task levels may be any number of task levels, and the multiple task levels may include a first task level and / or a second task level. For example, the multiple task levels include task level 0, task level 1, and task level 2, task level 0 may belong to the second task level, and task level 1 and task level 2 may belong to the first task level; the time period of the timeout detection task of each task level includes the time period for the timeout detection task of each task level to perform timeout detection, and the time period of the timeout detection task of each task level may be the same or different.
[0016] Optionally, the task level of the timeout detection task is positively correlated with the time period of the timeout detection task, that is, the higher the task level of the timeout detection task, the longer the time period of the timeout detection task can be, and the lower the task level of the timeout detection task, the shorter the time period of the timeout detection task can be. For example, the level of task level 2 is higher than the level of task level 1 which is higher than the level of task level 0. The time period of the timeout detection task of task level 2 is 100, the time period of the timeout detection task of task level 1 is 10, and the time period of the timeout detection task of task level 0 is 1. For example, as shown in Figure 3 (a), the time period of the timeout detection task of task level 0 is 1, the time period of the timeout detection task of task level 1 is 10, and the time period of the timeout detection task of task level 2 is 100. It should be noted that the 10 scale can belong to task level 0 but not to task level 1, and the 100 scale can belong to task level 1 but not to task level 2.
[0017] The current time includes the time obtained in real time, that is, the real-time time. For example, the current time can be the clock time obtained in real time. As mentioned above, this embodiment can be applied to a distributed system. On this basis, the current time can include the cluster time of the distributed system, that is, the current clock time after the distributed nodes in the distributed system are synchronized.
[0018] In actual applications, the time periods of each timeout detection task in timeout detection tasks at multiple task levels may be different, resulting in that the timeout detection task for obtaining the current time may not include all timeout detection tasks. In view of this, in order to improve the flexibility of obtaining the current time, in the process of obtaining the current time according to the time periods of timeout detection tasks at multiple task levels, the target timeout detection task for time acquisition can be determined according to the time periods of each timeout detection task in timeout detection tasks at multiple task levels, and the current time can be obtained; Continuing with the above example, the time period of the timeout detection task at task level 2 is 100, the time period of the timeout detection task at task level 1 is 10, and the time period of the timeout detection task at task level 0 is 1. Then the timeout detection task at task level 2 obtains the current time every 100, the timeout detection task at task level 1 obtains the current time every 10, and the timeout detection task at task level 0 obtains the current time every 1. It can be seen that the timeout detection tasks at each task level may not obtain the current time at the same time, so the target timeout detection task for time acquisition and the current time can be determined according to the time period of the timeout detection tasks at task level 0-task level 2.
[0019] Optionally, the task quantity of timeout detection tasks at multiple task levels is calculated based on a preset duration threshold adapted by the distributed system; wherein the preset duration threshold adapted by the distributed system may include a timeout duration threshold supported by the distributed system.
[0020] It should be supplemented that the above step S202 can be replaced by obtaining the current time according to the time period of the timeout detection task, and form a new implementation method with other steps provided in this embodiment or replacement methods of other steps.
[0021] Step S204, matching the current time with the preset timeout time of the storage block of the corresponding target timeout detection task to obtain the timed-out storage block.
[0022] Based on the above, the current time is obtained according to the time period of the timeout detection task of multiple task levels. In this step, the current time is matched with the preset timeout time of the storage block of the target timeout detection task corresponding to the current time to obtain the timed-out storage block.
[0023] The corresponding target timeout detection task in this embodiment includes the target timeout detection task corresponding to the current time, for example, the current time obtained according to the time period corresponds to task level 0 or task level 1 or task level 2, that is, the current time is the current time obtained for task level 0, task level 1 or task level 2.
[0024] In this embodiment, each timeout detection task may have its own storage block. Each timeout detection task may have one or more storage blocks. The storage block may be a virtual storage unit and / or a physical storage unit. The storage block may be a slot or a slot for storage, i.e., a storage slot. The storage slot may be represented by a slot. On this basis, a target timeout detection task may have a storage block. The target timeout detection task may have one or more storage blocks. For example, as shown in FIG3 (a), 0-1, 1-2, etc. corresponding to task level 0 correspond to storage blocks of the timeout detection task of task level 0. Then, the timeout detection task of task level 0 may have 10 storage blocks. The timeout detection task of task level 1 may have 9 valid storage blocks and 1 invalid storage block. Therefore, the timeout detection task of task level 1 may have 10 storage blocks, and the timeout detection task of task level 2 may have 6 storage blocks. For example, string slotKey (slot storage area name), int slotIndex (slot index), KeepAliveStorage storage (physical storage).
[0025] The preset timeout time of the storage block of each timeout detection task includes the timeout time marked to the storage block. Optionally, the preset timeout time of the storage block of each timeout detection task is calculated based on the previous preset timeout time of the storage block, the time period of each timeout detection task, and the number of storage blocks. Specifically, it may be the sum of the previous preset timeout time and the product calculated based on the time period of the target timeout detection task and the number of storage blocks. For example, if the previous preset timeout time of the storage block of the timeout detection task of task level 0 is a1 hours, b1 minutes, and c1 seconds, then the preset timeout time of the storage block is a1 hours, b1 minutes, and c1 seconds + 1*10 = a1 hours, b1 minutes, and c1 seconds + 10 seconds.
[0026] Specifically, after each timeout detection task is generated for the first time, the preset timeout time of the storage block of each timeout detection task can be obtained by initializing the storage block according to the first generation time and time period. For example, the time period of the timeout detection task of task level 0 is 1, and the time for the first generation of the timeout detection task of task level 0 is a hour, b minute, and c second, then the preset timeout time of storage block 1 of task level 0 is a hour, b minute, and c second, the preset timeout time of storage block 2 of task level 0 is a hour, b minute, and c+1 second, and the preset timeout time of storage block 3 of task level 0 is a hour, b minute, and c+2 seconds. The preset timeout times of other storage blocks are similar and will not be repeated here.
[0027] During the specific execution process, the storage blocks of the target timeout detection task may have their own preset timeout times, and the current time may be matched with the preset timeout times of multiple storage blocks of the target timeout detection task corresponding to the current time to obtain the preset timeout time matching the current time, and the storage block corresponding to the preset timeout time may be used as a timed-out storage block; the timed-out storage block may include the storage block corresponding to the preset timeout time matching the current time.
[0028] In practical applications, after obtaining the timed-out storage block, the data items of the events stored in the timed-out storage block can be read. However, in this process, other distributed nodes in the distributed system may also store data items for the timed-out storage block, etc., causing different distributed nodes to process data items for the same storage block, resulting in data deviation. In order to ensure the uniqueness of the data items of the events stored in the storage block, in an optional implementation manner provided by this embodiment, after matching the current time with the preset timeout time of the storage block of the corresponding target timeout detection task, the following operations are also performed after obtaining the timed-out storage block for execution: Distributed locks are performed on storage blocks that have timed out.
[0029] Distributed locking is used to prevent two distributed nodes from processing the same storage block at the same time, thereby maintaining the uniqueness and validity of the data items of the storage block events.
[0030] Step S206: Read the data item of the event stored in the timed storage block.
[0031] The above-mentioned matching process is performed on the current time and the preset timeout time of the storage block of the corresponding target timeout detection task to obtain the timed-out storage block. In this step, the data item of the event can be read from the timed-out storage block.
[0032] In this embodiment, the storage block of the timeout detection task at each task level may store data items of events; the event may be a session event, such as a session suspension (hosting) event, a visitor temporary leave event, and in addition, the event may also be other types of events, such as a visitor heartbeat event, a visitor message event, an agent heartbeat event, or an agent message event; optionally, the data item is generated based on the session event of the session system, such as a visitor heartbeat event, a visitor message event, an agent heartbeat event, or an agent message event of the session system, and the session event may be generated when it is detected that the duration of no interaction in the session exceeds a preset duration, such as a visitor message event is generated when it is detected that a message sent by a visitor in the session system is not responded to or replied within a preset duration; the session system here may include a customer service system or an online customer service system.
[0033] The storage block of the timeout detection task of each task level may have a storage block identifier, and the storage block identifier of the storage block may be fixed, but the storage address of the storage block may be generated in real time, and the storage address may be a physical address; in this embodiment, the data item of the event stored in the storage block may have index data, and the index data may be composed of the task level and storage block identifier corresponding to the data item, the storage block identifier corresponding to the data item may include the identifier of the storage block storing the data item, and the task level corresponding to the data item may include the task level of the timeout detection task in which the storage block storing the data item is located; for example, the index data of the data item may be stored according to a preset data structure (indexKey, key, value), where indexKey represents the index type, key represents the data item, and value represents the task level and storage block identifier. The specific value may use 3 bytes for data storage, with the high-order 1 byte storing the task level and the low-order 2 bytes storing the storage block identifier.
[0034] The data item of the event stored in the storage block may also be composed of the data item details and the timeout period of the data item. The data item details may include the event type or the user identifier associated with the event. The event type may be a visitor message event type or a visitor heartbeat event type. In addition, it may be other event types, such as an agent message event type and an agent heartbeat event type. The timeout period of the data item includes the specific time point when the data item times out, such as a2 hours, b2 minutes, and c2 seconds, which means that the data item times out after a2 hours, b2 minutes, and c2 seconds. The timeout period of the data item may be a timeout timestamp. For example, the data structure of the data item of the event stored in the storage block is (slotKey, key, value), where slotKey is a data structure, key represents the data item, and value represents the timeout timestamp of the data item.
[0035] In a specific implementation, the data item of the stored event may be read from the storage block according to the storage address of the storage block that has timed out; the storage address here may be a physical address.
[0036] In actual applications, there may be a need to store data items in the storage block while reading data items of events stored in the storage block, which is equivalent to storing new data items of events in the storage block while reading data items of events stored in the storage block. In this case, in order to reduce the probability of misoperation, in an optional implementation provided by this embodiment, after reading data items of events stored in the storage block that has timed out, the following operations are further performed: In the case of detecting a data item of an event for which data item storage is performed for a storage block that has timed out, storing the data item of the detected event to a preset storage block of a target timeout detection task; Optionally, the data item of the event stored in the preset storage block is used for timeout response processing in the next time period of the target timeout detection task.
[0037] Among them, the task level of the target timeout detection task may include a second task level, the multiple task levels may include a first task level and / or a second task level, the first task level is higher than the second task level, the time period of the timeout detection task of the second task level may be less than the time period of the timeout detection task of the first task level, and the first task level may be one or more. The preset storage block refers to a pre-set storage block, and the preset storage block may be a temporary storage block, such as a preset storage slot.
[0038] For example, the target timeout detection task is the timeout detection task of task level 0. The timeout detection task of task level 0 is provided with a preset storage slot. After reading the data item of the event stored in the timed storage slot of the timed detection task of task level 0, if a data item of the event for which data item storage is performed in the timed storage slot is detected, the data item of the detected event is stored in the preset storage slot of task level 0, so that in the next time period of the timeout detection task of task level 0, the data item of the event stored in the preset storage slot is read for timeout response processing.
[0039] It should be noted that step S206 in this embodiment may not be executed, and after executing step S204, the following step S208 may be directly executed.
[0040] The above step S206 can be replaced by reading the data item stored in the storage block that has timed out, and forming a new implementation method with other processing steps provided in this embodiment.
[0041] Step S208: performing timeout response processing on the data item of the read event according to the event processing method of the task level of the target timeout detection task.
[0042] After the above-mentioned reading of the data items of the events stored in the storage block that has timed out, in this step, timeout response processing is performed on the data items of the read events according to the event processing method of the task level of the target timeout detection task; by providing different event processing methods to different task levels, the flexibility of event processing is improved, and timeout detection of events is realized through timeout detection of data items. Fine-grained processing is provided for timeout detection of events through different task levels, thereby improving the accuracy of timeout detection.
[0043] In specific implementation, different event processing methods can be provided for timeout detection tasks at different task levels to improve the flexibility of event processing; in the first optional implementation mode provided by this embodiment, in the process of performing timeout response processing on the data item of the read event according to the event processing method of the task level of the target timeout detection task, the following operations are performed: if the task level is the first task level, the data item is written to the timeout detection task of the next task level of the task level according to the timeout time of the data item; Optionally, a time period of the timeout detection task of the first task level is greater than a time period of the timeout detection task of the second task level.
[0044] Among them, the first task level may be higher than the second task level. For example, the task level may include task level 0, task level 1, and task level 2. The time period of the timeout detection task of task level 0 is smaller than the time period of the timeout detection task of task level 1, which is smaller than the time period of the timeout detection task of task level 2. The first task level is any task level among the remaining task levels except task level 0, that is, task level 1 or task level 2.
[0045] For example, as shown in Figure 3 (b), the first task level may include task level 1, task level 2, task level 3, and task level n, task level 2 is the next task level of task level 3, task level 1 is the next task level of task level 2, and task level 0 is the next task level of task level 1; the timeout response processing may be the writing processing of the data item to the timeout detection task of the next task level of the task level of the target timeout detection task.
[0046] By writing and processing the data item to the timeout detection task of the next task level when the task level is the first task level, the timeout detection task of the first task level can pass the data item to the timeout detection task of the next task level of the first task level according to a time period greater than the timeout detection task of the second task level, thereby improving the accuracy and flexibility of timeout detection.
[0047] On this basis, in an optional implementation manner provided by this embodiment, in the process of writing the data item to the timeout detection task of the next task level of the task level according to the timeout time of the data item, the remaining effective duration of the data item can be calculated according to the current time and the timeout time of the data item, and based on the remaining effective duration and the time period and the number of storage blocks of the timeout detection task of the next task level, the data item is written to the timeout detection task of the next task level. Specifically, the following operations can be performed: Calculate the remaining valid time of the data item based on the current time and the timeout time of the data item; Calculate the storage block identifier based on the remaining effective time, the time period of the timeout detection task of the next task level, and the number of storage blocks; The data item is stored in the storage block of the timeout detection task of the next task level according to the storage block identifier.
[0048] Among them, the current time may include the time obtained in real time, that is, the real-time time. The current time in this embodiment may include the time obtained in real time; the timeout time of the data item refers to the time when the data item times out. For example, the timeout time is a3 hours, b3 minutes, and c3 seconds, which means that the state of the data item changes to the timeout state after a3 hours, b3 minutes, and c3 seconds arrives. It can also be said that the data item times out or expires after a3 hours, b3 minutes, and c3 seconds arrives.
[0049] The remaining effective duration of the data item includes the remaining effective duration of the data item. The next task level refers to the next task level of the task level of the target timeout detection task. For example, if the task level of the target timeout detection task is task level 1, the next task level is task level 0. The number of storage blocks refers to the number of storage blocks of the timeout detection task of the next task level. For example, if the next task level is task level 0, the number of storage blocks of the timeout detection task of task level 0 is 10.
[0050] Further, in an optional implementation manner provided by this embodiment, in the process of calculating the storage block identifier based on the remaining effective duration, the time period of the timeout detection task of the next task level, and the number of storage blocks, the following operations are performed: Calculate the ratio based on the remaining effective duration and the time period of the timeout detection task of the next task level; The number of storage blocks is modulo processed according to the ratio, and the obtained remainder is used as the storage block identifier.
[0051] The ratio refers to the ratio of the remaining effective time to the time period of the timeout detection task of the next task level.
[0052] Specifically, the difference between the timeout time of the data item and the current time may be calculated as the remaining effective time of the data item.
[0053] For example, the remaining effective time of the data item calculated based on the timeout time of the data item and the current time is 500, then the ratio calculated based on the remaining effective time 500 and the time period 1 of the timeout detection task of the next task level is 500, and the number of storage blocks 10 is modulo the ratio 500 to obtain a remainder of 0, then the storage block identifier is 0.
[0054] In a second optional implementation manner provided by this embodiment, in the process of performing timeout response processing on the data item of the read event according to the event processing mode of the task level of the target timeout detection task, the following operations are performed: If the task level is the second task level, event processing is performed on the event based on the data item; Optionally, the event processing includes: allocating seat resources to users associated with the event; or closing the session associated with the event and reclaiming the seat resources of the session.
[0055] The second task level may be one, the second task level may be lower than the first task level, and the time period of the timeout detection task of the second task level may be shorter than the time period of the timeout detection task of the first task level.
[0056] Specifically, in the process of processing events based on data items, seat resources can be reallocated to users associated with session events based on user identifiers in the data items; or, sessions associated with session events can be closed based on session identifiers in the data items, and the seat resources of the sessions can be reclaimed.
[0057] For example, the second task level is task level 0, and the event is a visitor message event. The seat resources are reallocated to the user associated with the visitor message event based on the user identifier in the data item; or, the session associated with the visitor message event is closed based on the session identifier in the data item, and the seat resources of the session are recovered. In this way, when the data item is close to timeout, the data item is scheduled through a smaller time period, the data item is processed in time, and the event resources of the data item are recovered in time. For another example, as shown in Figure 3 (b), the data item of the event stored in the timed-out storage block of task level 0 can be processed in time, that is, the event processing is performed based on the data item.
[0058] In practical applications, the number of storage blocks of a timeout detection task may be limited, but as time continues to increase, there is still a need to continue timeout detection. In this case, in order to continue timeout detection of the timeout detection task, the preset timeout time of the timed storage block can be updated according to the preset timeout time of the timed storage block, the time period of the target timeout detection task, and the number of storage blocks, so that timeout detection can be successfully implemented at any time through limited storage blocks, and uninterrupted timeout detection can be achieved; in an optional implementation manner provided by this embodiment, after event processing is performed on the event based on the data item, the following operations are also performed: The update timeout time of the storage block that has timed out is calculated according to the preset timeout time of the storage block that has timed out, the time period of the target timeout detection task, and the number of storage blocks.
[0059] Specifically, the product of the time period of the target timeout detection task and the number of storage blocks can be calculated, and the sum of the product and the preset timeout time of the timed storage block can be calculated as the update timeout time of the timed storage block; the update timeout time of the timed storage block can be used to match the current time obtained in real time after the next time period of the target timeout detection task is reached, to obtain the next timed out storage block, and to perform timeout response processing on the data item of the event stored in the next timed out storage block.
[0060] It should be noted that the optional implementation method after executing event processing based on data items can also be executed on the basis of executing event processing based on data items if the task level is the second task level.
[0061] Based on the distributed locking of the timed storage block, after locking, the data item of the event stored in the timed storage block can be read. In an optional implementation provided by this embodiment, after the timeout response processing is performed on the read data item of the event, the following operation is further performed: The locked and timed storage blocks are unlocked and time synchronization is performed.
[0062] Among them, time synchronization may be clock synchronization, and the above steps S206 to S208 may be executed by any distributed node in the distributed system. In this case, time synchronization may be sending the current timestamp to the remaining distributed nodes in the distributed system for time synchronization.
[0063] For example, in TimeServiceCluster (cluster clock synchronization), long currentSec() represents the current time in the synchronized cluster.
[0064] In practical applications, there is a need to store data items in the timeout detection tasks at each task level, and there is a need to continuously store the data items of new events in the storage block of the timeout detection task, so as to realize the timeout detection of events through the timeout detection of data items, and perform corresponding processing in time after the event times out; in an optional implementation mode provided by this embodiment, the following operations are also performed: Determine a timeout detection task in each timeout detection task according to the task level and the effective duration of the data item of the event to be stored; The storage block identifier is calculated based on the determined number of storage blocks of the timeout detection task, and the data item of the event to be stored is stored in the determined storage block of the timeout detection task according to the storage block identifier.
[0065] On this basis, in an optional implementation manner provided by this embodiment, in the process of determining the timeout detection task in each timeout detection task according to the task level and the effective duration of the data item of the event to be stored, the following operations are performed: Selecting a specific timeout detection task from among the timeout detection tasks according to the task level; Calculate the ratio of the effective duration to the time period of the specific timeout detection task. If the ratio is greater than a preset value, the specific timeout detection task is taken as the determined timeout detection task. If the ratio is less than or equal to the preset value, continue to calculate the ratio of the effective duration to the time period of the next timeout detection task of the specific timeout detection task. When the calculated ratio is greater than the preset value, the next timeout detection task is taken as the determined timeout detection task. When the calculated ratio is less than or equal to the preset value, continue to transfer the calculation to the next timeout detection task in the above manner until the ratio is greater than the preset value, and the corresponding timeout detection task can be taken as the determined timeout detection task.
[0066] The preset value may be 0; the next timeout detection task may be a timeout detection task at the next task level of the task level of the specific timeout detection task, for example, if the specific timeout detection task is a timeout detection task at task level 2, the next timeout detection task may be a timeout detection task at task level 1. The effective duration of the data item may be determined based on the event type of the session event and / or the session interaction object.
[0067] Specifically, a specific timeout detection task can be selected from each timeout detection task in order from high to low task levels. When the ratio of the effective duration to the time period of the specific timeout detection task is greater than a preset value, the specific timeout detection task is determined as the timeout detection task. When the ratio is less than or equal to the preset value, the ratio of the effective duration to the time period of the next timeout detection task of the specific timeout detection task can be further calculated. If the ratio is greater than the preset value, the next timeout detection task is determined as the determined timeout detection task. The number of storage blocks of the determined timeout detection task is subjected to remainder processing according to the ratio, the obtained remainder is used as a storage block identifier, and the data items of the event to be stored are stored in the storage block of the timeout detection task according to the storage block identifier.
[0068] For example, the effective duration of the data item of the event to be stored is 54, and the task levels include task level 0, task level 1 and task level 2. The data items are stored in order of the task levels from high to low, starting from task level 2, and calculating the ratio of the effective duration 54 to the time period 100 of the timeout detection task of task level 2. The ratio is 0, which is less than the preset value. Then, calculating the ratio of the effective duration 54 to the time period 10 of the timeout detection task of task level 1, the ratio is 5, which is greater than 0. Then, it is determined that the timeout detection task of task level 1 is the timeout detection task for data item storage. The number of storage blocks of the timeout detection task of task level 1 is modulo processed according to the ratio, and the obtained remainder is used as the storage block identifier.
[0069] For another example, as shown in Figure 3 (b), the order of task levels from high to low is from task level n to task level 3... to task level 0. In the process of storing data items of the event to be stored, the ratio of the effective duration to the time period of the timeout detection task of task level n is calculated in order from high to low, starting from task level n. If the ratio is less than or equal to 0, start calculating task level 3 and calculate the ratio of the effective duration to the time period of the timeout detection task of task level 3. If the ratio is still less than or equal to 0, continue to calculate task level 2. If the ratio is greater than 0, determine that the task level for storing the data item of the event to be stored is task level 3. Within task level 3, calculate the storage block identifier based on the number of storage blocks of the timeout detection task of task level 3, and store the data item of the event to be stored in the storage block of the timeout detection task of task level 3 according to the storage block identifier.
[0070] It should be noted that, before determining the execution of the timeout detection task in each timeout detection task based on the task level and the effective duration of the data item of the event to be stored, the index data of the data item of the event to be stored can also be queried based on the data item identifier. If it does not exist, the following operation is performed based on the task level and the effective duration of the data item of the event to be stored, to determine the timeout detection task operation in each timeout detection task. If it exists, the index data of the data item and the data item stored in the storage block are deleted.
[0071] In addition, the data items of the events stored in the storage block of each timeout detection task can also be deleted; for example, Setkeys() represents all data items in the slot, void add(string key) writes a data key to the slot, void remove(string key) deletes a data item key from the slot, void remove(string[] keys) deletes multiple data item keys from the slot, and void clear() clears all data items in the slot.
[0072] It should be supplemented that, each optional implementation method and each feasible execution method in steps S202 to S208 provided in this embodiment can be executed independently as needed, or can be combined and referenced to each other. At the same time, each specific execution step in each optional implementation method or each feasible execution method can also be executed independently or combined as needed. This embodiment does not make specific limitations on this.
[0073] In summary, the one or more task processing methods provided in this embodiment first obtain the current time according to the time period of the timeout detection tasks of multiple task levels, match the current time with the preset timeout time of the storage block of the target timeout detection task corresponding to the current time, obtain the timed-out storage block, and then read the data item of the event from the timed-out storage block; Secondly, if the task level of the target timeout detection task is the first task level, the remaining effective time of the data item is calculated according to the current time and the timeout time of the data item, and the storage block identifier is calculated based on the remaining effective time, the time period of the timeout detection task of the next task level and the number of storage blocks, and the data item is stored in the storage block of the timeout detection task of the next task level according to the storage block identifier; if the task level of the target timeout detection task is the second task level, the event is processed based on the data item, and the event processing may include: allocating seat resources to users associated with the event; or closing the session associated with the event, and recycling the seat resources of the session; in this way, different timeout response strategies are provided to timeout detection tasks of different task levels to meet the diverse needs of timeout response, and the time periods of timeout detection of data items by timeout detection tasks of different task levels are different to achieve refinement of timeout detection, and different event processing is performed according to the urgency of whether the data item times out, thereby improving the accuracy of timeout detection; Finally, according to the preset timeout time of the timed storage block, the time period of the target timeout detection task and the number of storage blocks, the update timeout time of the timed storage block is calculated; so that the timeout detection of the timeout detection task can be realized uninterruptedly through a limited number of storage blocks.
[0074] The following takes the application of a task processing method provided by this embodiment in a session event scenario as an example to further illustrate the task processing method provided by this embodiment. Figure 4 ,The task processing method applied to the conversation event scenario specifically includes the following steps.
[0075] Step S402, obtaining the current time according to the time period of the timeout detection tasks of multiple task levels.
[0076] Step S404, matching the current time with the preset timeout time of the storage slot of the corresponding target timeout detection task to obtain the timed-out storage slot.
[0077] After that, the timed-out storage block may be distributedly locked, and after locking, the following steps S406 to S414 may be executed.
[0078] Step S406: Read the data item of the session event stored in the storage slot that has timed out.
[0079] Step S408: If the task level of the target timeout detection task is the first task level, the remaining effective duration of the data item is calculated according to the current time and the timeout time of the data item.
[0080] Step S410, calculating the storage slot identifier based on the remaining effective time, the time period of the timeout detection task of the next task level, and the number of storage slots.
[0081] The next task level here may be the next task level of the task level of the target timeout detection task.
[0082] Step S412: storing the data item into the storage slot of the timeout detection task at the next task level according to the storage slot identifier.
[0083] After that, the locked storage slot that has timed out can be unlocked.
[0084] It should be supplemented that the above steps S408 to S412 can be replaced by, if the task level is the second task level, performing event processing on the session event based on the data item; the event processing may include allocating seat resources to the user associated with the session event; or, closing the session associated with the session event, and reclaiming the seat resources of the session; in addition, in the process of executing steps S408 to S412, the replacement execution process here can also be executed simultaneously.
[0085] Step S414, calculating the update timeout time of the storage slot that has timed out according to the preset timeout time of the storage slot that has timed out, the time period of the target timeout detection task, and the number of storage slots.
[0086] It should be noted that any one of steps S402 to S414 or any combination of multiple steps can be replaced by the corresponding technical means provided by the above steps S202 to S208 according to the needs of implementation and deployment, and any one of steps S402 to S414 or any combination of multiple steps can be combined into a new implementation method according to the needs of implementation and deployment; and any one of steps S402 to S414 or any combination of multiple steps can also form a new implementation method with one or more steps provided by the above steps S202 to S208 according to the needs of actual deployment, or form a new implementation method with one or more optional implementation methods provided by steps S202 to S208, which will not be repeated here.
[0087] An embodiment of a task processing device provided in this specification is as follows: In the above-mentioned embodiment, a task processing method is provided, and correspondingly, a task processing device is also provided, which will be described below with reference to the accompanying drawings.
[0088] Reference Figure 5 , which shows a schematic diagram of an embodiment of a task processing device provided by this embodiment.
[0089] Since the device embodiment corresponds to the method embodiment, the description is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above. The device embodiment described below is only illustrative.
[0090] This embodiment provides a task processing device, including: A time acquisition module 502 is configured to acquire the current time according to the time period of the timeout detection task of multiple task levels; A matching processing module 504 is configured to match the current time with a preset timeout time of a storage block of a corresponding target timeout detection task to obtain a storage block that has timed out; A data reading module 506 is configured to read the data item of the event stored in the timed storage block; The timeout response module 508 is configured to perform timeout response processing on the data item of the read event according to the event processing method of the task level of the target timeout detection task.
[0091] An embodiment of a task processing device provided in this specification is as follows: Corresponding to the task processing method described above, based on the same technical concept, one or more embodiments of this specification further provide a task processing device, which is used to execute the task processing method provided above. Figure 6 A schematic diagram of the structure of a task processing device provided in one or more embodiments of this specification.
[0092] This embodiment provides a task processing device, including: like Figure 6 As shown, the task processing device may have relatively large differences due to different configurations or performances, and may include one or more processors 601 and memory 602, and the memory 602 may store one or more storage applications or data. Among them, the memory 602 may be a short-term storage or a persistent storage. The application stored in the memory 602 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the task processing device. Furthermore, the processor 601 may be configured to communicate with the memory 602 and execute a series of computer executable instructions in the memory 602 on the task processing device. The task processing device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input / output interfaces 605, one or more keyboards 606, etc.
[0093] In a specific embodiment, the task processing device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the task processing device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following: Get the current time according to the time period of the timeout detection tasks at multiple task levels; Matching the current time with a preset timeout time of a storage block of a corresponding target timeout detection task to obtain a storage block that has timed out; Reading a data item of the event stored in the timed-out storage block; According to the event processing method of the task level of the target timeout detection task, timeout response processing is performed on the data item of the read event.
[0094] An embodiment of a computer-readable storage medium provided in this specification is as follows: Corresponding to the task processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a computer-readable storage medium.
[0095] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions, and the computer-executable instructions implement the following steps when executed: Get the current time according to the time period of the timeout detection tasks at multiple task levels; Matching the current time with a preset timeout time of a storage block of a corresponding target timeout detection task to obtain a storage block that has timed out; Reading a data item of the event stored in the timed-out storage block; According to the event processing method of the task level of the target timeout detection task, timeout response processing is performed on the data item of the read event.
[0096] It should be noted that the embodiment of a computer-readable storage medium in this specification and the embodiment of a task processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0097] An embodiment of a computer program product provided in this specification is as follows: Corresponding to the task processing method described above, based on the same technical concept, one or more embodiments of this specification also provide a computer program product.
[0098] A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the following steps: Get the current time according to the time period of the timeout detection tasks at multiple task levels; Matching the current time with a preset timeout time of a storage block of a corresponding target timeout detection task to obtain a storage block that has timed out; Reading a data item of the event stored in the timed-out storage block; According to the event processing method of the task level of the target timeout detection task, timeout response processing is performed on the data item of the read event.
[0099] It should be noted that an embodiment of a computer program product in this specification and an embodiment of a task processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0100] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other. Each embodiment focuses on the differences from other embodiments. For example, the device embodiment, equipment embodiment and computer-readable storage medium embodiment are similar to the method embodiment, so the description is relatively simple. To read the relevant contents in the device embodiment, equipment embodiment and computer-readable storage medium embodiment, please refer to the partial description of the method embodiment.
[0101] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0102] In the 1930s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many of today's method flow improvements can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and produce dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0103] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0104] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0105] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0106] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0107] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable test processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable test processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0108] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable test processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0109] These computer program instructions may also be loaded onto a computer or other programmable test processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process described in the flow. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0110] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0111] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0112] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0113] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of features includes not only those features, but also other features not explicitly listed, or also includes features inherent to such process, method, commodity or device. In the absence of further restrictions, features defined by the phrase "including a ..." do not exclude the existence of other identical features in the process, method, commodity or device including the features.
[0114] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0115] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0116] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A task processing method, comprising: Get the current time according to the time period of the timeout detection tasks at multiple task levels; Matching the current time with a preset timeout time of a storage block of a corresponding target timeout detection task to obtain a storage block that has timed out; Reading a data item of the event stored in the timed-out storage block; According to the event processing method of the task level of the target timeout detection task, timeout response processing is performed on the data item of the read event.
2. The task processing method according to claim 1, wherein the timeout response processing is performed on the data item of the read event according to the event processing mode of the task level of the target timeout detection task, comprising: If the task level is the first task level, writing the data item to a timeout detection task of a next task level of the task level according to the timeout period of the data item; The time period of the timeout detection task of the first task level is greater than the time period of the timeout detection task of the second task level.
3. The task processing method according to claim 2, wherein the step of writing the data item to a timeout detection task at a next task level of the task level according to the timeout period of the data item comprises: Calculate the remaining effective time of the data item according to the current time and the timeout time of the data item; Calculate a storage block identifier based on the remaining effective duration, the time period of the timeout detection task of the next task level, and the number of storage blocks; The data item is stored in a storage block of the timeout detection task of the next task level according to the storage block identifier.
4. The task processing method according to claim 3, wherein the calculation of the storage block identifier based on the remaining effective duration, the time period of the timeout detection task of the next task level and the number of storage blocks comprises: Calculate a ratio based on the remaining effective duration and the time period of the timeout detection task of the next task level; A remainder process is performed on the number of storage blocks according to the ratio, and the obtained remainder is used as the storage block identifier.
5. The task processing method according to claim 1, wherein the method is applied to a distributed system; After the step of matching the current time with the preset timeout time of the storage block of the corresponding target timeout detection task to obtain the timed storage block is performed, the method further includes: Performing distributed locking on the timed-out storage block; After the timeout response processing operation is performed on the data item of the read event, the method further includes: The locked and timed storage blocks are unlocked and time synchronization is performed.
6. The task processing method according to claim 1, wherein the step of performing timeout response processing on the data item of the read event according to the event processing mode of the task level of the target timeout detection task comprises: If the task level is the second task level, performing event processing on the event based on the data item; The event processing includes: allocating seat resources to the user associated with the event; or closing the session associated with the event and reclaiming the seat resources of the session.
7. The task processing method according to claim 6, after performing the event processing operation on the event based on the data item, further comprising: The update timeout time of the storage block that has timed out is calculated according to the preset timeout time of the storage block that has timed out, the time period of the target timeout detection task and the number of storage blocks.
8. The task processing method according to claim 1, after the step of reading the data item of the event stored in the timed storage block is executed, further comprising: In case of detecting a data item of an event for which data item storage is performed for the storage block that has timed out, storing the data item of the detected event into a preset storage block of the target timeout detection task; The data items of the events stored in the preset storage block are subjected to timeout response processing in the next time period of the target timeout detection task.
9. The task processing method according to claim 1, further comprising: Determine a timeout detection task in each timeout detection task according to the task level and the effective duration of the data item of the event to be stored; A storage block identifier is calculated based on the determined number of storage blocks of the timeout detection task, and the data item of the event to be stored is stored in the determined storage block of the timeout detection task according to the storage block identifier.
10. The task processing method according to claim 9, wherein determining the timeout detection task in each timeout detection task according to the task level and the effective duration of the data item of the event to be stored comprises: Selecting a specific timeout detection task from among the timeout detection tasks according to the task level; The ratio of the effective duration to the time period of the specific timeout detection task is calculated, and if the ratio is greater than a preset value, the specific timeout detection task is used as the determined timeout detection task.
11. The task processing method according to claim 5, wherein the task quantity of the timeout detection tasks of the multiple task levels is calculated based on a preset duration threshold adapted by the distributed system.
12. A task processing device, comprising: A time acquisition module is configured to acquire the current time according to the time period of the timeout detection tasks of multiple task levels; A matching processing module is configured to match the current time with a preset timeout time of a storage block of a corresponding target timeout detection task to obtain a storage block that has timed out; A data reading module, configured to read the data item of the event stored in the timed storage block; The timeout response module is configured to perform timeout response processing on the data item of the read event according to the event processing method of the task level of the target timeout detection task.
13. A task processing device, comprising: processor; and a memory configured to store computer executable instructions that, when executed, cause the processor to: Get the current time according to the time period of the timeout detection tasks at multiple task levels; Matching the current time with a preset timeout time of a storage block of a corresponding target timeout detection task to obtain a storage block that has timed out; Reading a data item of the event stored in the timed-out storage block; According to the event processing method of the task level of the target timeout detection task, timeout response processing is performed on the data item of the read event.
14. A computer-readable storage medium for storing computer-executable instructions, wherein the computer-executable instructions implement the steps of the method of claim 1 when executed.