A Timing Task Execution Method and Device for Multiple Systems

The method simplifies scheduled task management in business systems by configuring and scanning task strategies across multiple systems, reducing manual code changes and enhancing task execution reliability with compensation mechanisms.

CN113961322BActive Publication Date: 2025-07-15GUANGZHOU NEW SILK ROAD IT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111212045.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-18
Publication Date
2025-07-15
Estimated Expiration
2041-10-18

AI Technical Summary

Technical Problem

When the execution strategy of timing tasks changes in business systems, technicians are required to continuously modify the code and release new versions, resulting in large workloads and complex configuration processes.

Method used

By configuring timing task policies, including business systems, timing tasks, trigger conditions and execution cycles, and scanning the timing task policy library at preset time intervals in the timing system, sending timing task execution instructions to the business system after the trigger conditions are met, using asynchronous message server and message queue to ensure the smooth issuance of instructions, and processing failed instructions through cache and compensation mechanisms.

Benefits of technology

When the timing task strategy changes, the timing task strategy can be modified in the business system by simply modifying the timing task strategy, which reduces the workload and configuration complexity of technicians, and improves the flexibility and maintainability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961322B_ABST
    Figure CN113961322B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for executing timed tasks for multiple systems. By configuring timed task policies in a separate timed system and determining the scanning period of each timed task policy, a timed task execution instruction is sent to the business system after the timed task trigger condition is met, enabling the business system to execute the timed task. Only by modifying the timed task policy can the modification of the timed task in the business system be completed, solving the technical problem that if the execution policy of the timed task in the business system changes, technicians need to continuously modify the code and release new versions to complete the modification, which is laborious and has a complex configuration process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a method and device for executing timed tasks for multiple systems. Background Art

[0002] With the increase in the types of enterprise services, the number of service systems supporting various services is also increasing. Almost every service system involves the implementation of timed tasks, and it is necessary to introduce packages related to timers for implementation. Moreover, if the execution strategy of the timed tasks in the service system changes, technicians need to continuously modify the code and release new versions to complete the modification, which has the technical problems of excessive workload and complex configuration process. Summary of the Invention

[0003] This application provides a method and device for executing timed tasks for multiple systems, which solves the technical problems that if the execution strategy of the timed tasks in the service system changes, technicians need to continuously modify the code and release new versions to complete the modification, resulting in excessive workload and complex configuration process.

[0004] In view of this, in the first aspect of this application, a method for executing timed tasks for multiple systems is provided. The method includes:

[0005] Configuring a timed task strategy, where the timed task strategy includes the service systems of the applications, timed tasks, timed task trigger conditions, and execution cycles;

[0006] Scanning all the timed task strategies in the timed task strategy library at a first preset time interval;

[0007] After the timed task trigger condition is met, sending a timed task execution instruction to the service system, where the timed task execution instruction carries the timed task and the execution cycle.

[0008] Optionally, the timed task strategy further includes an asynchronous message server and a message queue.

[0009] Optionally, the step of sending a timed task execution instruction to the service system after the timed task trigger condition is met specifically includes:

[0010] After the timed task trigger condition is met, sending a timed task execution instruction to the asynchronous message server and the message queue associated with the service system.

[0011] Optionally, it further includes:

[0012] Receiving a timed task strategy modification instruction;

[0013] Add the updated timing task policy to the timing task policy library.

[0014] Optionally, it further includes:

[0015] Store the timing task execution instruction in the redis cache;

[0016] Scan all the above-mentioned timing task execution instructions in the redis cache at a second preset time interval;

[0017] If there is a timing task execution instruction in all the timing task execution instructions in the redis cache whose first generation time is greater than the preset time, trigger the instruction resending compensation mechanism and update the first generation time.

[0018] Optionally, it further includes:

[0019] Monitor the consumption status of the timing task execution instruction in the message queue, where the consumption status includes successful consumption and failed consumption;

[0020] If the consumption status of the timing task execution instruction is updated to failed consumption, delete the timing task execution instruction in the message queue and the redis cache, and store the timing task execution instruction in the database, so that the database triggers the consumption failure compensation mechanism with a third preset time interval as the timing task;

[0021] If the consumption status of the timing task execution instruction is updated to successful consumption, delete the timing task execution instruction in the message queue and the redis cache.

[0022] Optionally, the instruction resending compensation mechanism specifically includes:

[0023] Resend the timing task execution instruction in the redis cache to the message queue.

[0024] Optionally, if the consumption status of the timing task execution instruction is updated to failed consumption, delete the timing task execution instruction in the message queue and the redis cache, and store the timing task execution instruction in the database, so that the database triggers the consumption failure compensation mechanism with a third preset time interval as the timing task specifically includes:

[0025] If the consumption status of the timing task execution instruction is updated to failed consumption, determine whether the timing task execution instruction contains a preset mark;

[0026] If the timing task execution instruction does not contain the preset flag, delete the timing task execution instruction in the message queue and the redis cache, store the timing task execution instruction in the database, add the preset flag to the timing task execution instruction in the database, and record the retry count of the service message as 0;

[0027] If the timing task execution instruction contains the preset flag, use the third preset time interval as the timing task, send the timing task execution instruction in the database to the message queue, and increment the retry count of the timing task execution instruction by one.

[0028] Optionally, the step of sending the timing task execution instruction in the database to the message queue and incrementing the retry count of the timing task execution instruction by one when the timing task execution instruction contains the preset flag specifically includes:

[0029] If the timing task execution instruction contains the preset flag and the retry count of the timing task execution instruction reaches the preset threshold, trigger the email warning mechanism;

[0030] If the timing task execution instruction contains the preset flag but the retry count of the timing task execution instruction does not reach the preset threshold, send the timing task execution instruction in the database to the message queue and increment the retry count of the timing task execution instruction by one.

[0031] The second aspect of the present application provides a timing task execution device for multiple systems, and the device includes:

[0032] A configuration unit, configured to configure a timing task policy, where the timing task policy includes the business system of the application, the timing task, the timing task trigger condition, and the execution period;

[0033] A scanning unit, configured to scan all the timing task policies in the timing task policy library at a first preset time interval;

[0034] A sending unit, configured to send a timing task execution instruction to the business system after the timing task trigger condition is met, where the timing task execution instruction carries the timing task and the execution period.

[0035] From the above technical solutions, it can be seen that the embodiments of the present application have the following advantages:

[0036] In this application, a method for executing timed tasks for multiple systems is provided. By configuring timed task policies in a separate timed system and determining the scan period of each timed task policy, a timed task execution instruction is sent to the business system after the timed task trigger condition is met, enabling the business system to execute the timed task. Only by modifying the timed task policy can the modification of the timed task in the business system be completed, solving the technical problem that if the execution policy of the timed task in the business system changes, technicians need to continuously modify the code and release new versions to complete the modification, which is extremely laborious and the configuration process is complex. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flowchart of a method for executing timed tasks for multiple systems in an embodiment of this application;

[0038] Figure 2 It is a schematic structural diagram of a device for executing timed tasks for multiple systems in an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0039] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0040] This application designs a method and device for executing timed tasks for multiple systems, solving the technical problem that if the execution policy of the timed task in the business system changes, technicians need to continuously modify the code and release new versions to complete the modification, which is extremely laborious and the configuration process is complex.

[0041] For ease of understanding, please refer to Figure 1 , Figure 1 It is a flowchart of a method for executing timed tasks for multiple systems in an embodiment of this application. As Figure 1 shown, specifically:

[0042] 101. Configure timed task policies, where the timed task policies include the business systems to which the applications belong, timed tasks, timed task trigger conditions, and execution periods;

[0043] It should be noted that in the timing system, it is first necessary to configure the timing task policy, which includes the business system of the application, the timing task, the timing task trigger condition, and the execution cycle. Among them, the timing task is the task content that needs to be executed by the business system of the application, the timing task trigger condition is a time point or other trigger conditions, and the execution cycle is the cycle in which the timing task is executed in the business system of the application.

[0044] 102. Scan all the timing task policies in the timing task policy library at a first preset time interval as the cycle;

[0045] It should be noted that at the first preset time interval, for example, every hour, scan all the timing task policies in the timing task policy library to determine whether the timing task policy is triggered.

[0046] 103. After meeting the timing task trigger condition, send a timing task execution instruction to the business system. The timing task execution instruction carries the timing task and the execution cycle.

[0047] It should be noted that among the scanned timing task policies, for the timing task policies that meet the timing task trigger condition, a timing task execution instruction can be immediately sent to the business system applied in the timing task policy, so that the business system executes the timing task according to the execution cycle.

[0048] Furthermore, the timing task policy also includes an asynchronous message server and a message queue.

[0049] It should be noted that in order to ensure the smooth issuance of the timing task instruction after the timing task policy is triggered, an asynchronous message server and a message queue can also be configured in the timing task policy.

[0050] Furthermore, sending a timing task execution instruction to the business system after meeting the timing task trigger condition specifically includes:

[0051] After meeting the timing task trigger condition, send a timing task execution instruction to the asynchronous message server and the message queue associated with the business system.

[0052] Furthermore, it also includes:

[0053] Receive a timing task policy modification instruction;

[0054] Add the updated timing task policy to the timing task policy library.

[0055] It should be noted that the timing task policy can be completed by executing the timing task policy modification instruction, and the updated timing task policy is added to the timing task policy library for regular scanning.

[0056] Furthermore, it also includes:

[0057] Store the timing task execution instruction into the redis cache;

[0058] Scan all the upper timing task execution instructions in the redis cache at the second preset time interval;

[0059] If there is a timing task execution instruction in all the timing task execution instructions in the redis cache whose first generation time is greater than the preset time, trigger the instruction resending compensation mechanism and update the first generation time.

[0060] It should be noted that the timing task execution instruction is pre-backed up to the redis cache to prevent the loss of the timing task execution instruction sent to the message queue. Compared with directly backing up the service message to the database, the read and write efficiency of the redis cache is higher, which can reduce the waiting time of the database transaction and thus improve the overall performance of the application system.

[0061] It can be understood that by configuring a timing task to scan all the timing task execution instructions in the redis cache at a preset time interval, such as every minute or every half minute, the redis cache will cache the timing task execution instructions that have been sent to the message queue but not consumed. By scanning the timing task execution instructions, the first generation time of the timing task execution instruction can be obtained, and the first generation time is the time when the timing task execution instruction is backed up to the redis cache.

[0062] When there is a timing task execution instruction in the redis cache whose first generation time is greater than the preset time, it means that the timing task execution instruction has not been consumed for a long time, and it can be considered that the message sending fails. Then trigger the message resending compensation mechanism to send compensation for the timing task execution instruction, so as to ensure the successful sending of the timing task execution instruction. At the same time, update the first generation time of the timing task execution instruction in the redis cache to avoid repeated scanning and compensation.

[0063] Furthermore, it also includes:

[0064] Monitor the consumption status of the timing task execution instruction in the message queue, and the consumption status includes consumption success and consumption failure;

[0065] If the consumption status of the timing task execution instruction is updated to consumption failure, delete the timing task execution instruction in the message queue and the redis cache, and store the timing task execution instruction into the database, so that the database triggers the consumption failure compensation mechanism for the timing task at the third preset time interval;

[0066] If the consumption status of the timed task execution instruction is updated to successful consumption, then delete the timed task execution instruction in the message queue and the Redis cache.

[0067] It should be noted that after successfully sending the timed task execution instruction to the message queue, it is also necessary to continuously monitor the consumption status of the timed task execution instruction in the message queue. The consumption status is divided into two states: successful consumption and failed consumption.

[0068] When it is monitored that the consumption status of the timed task execution instruction in the message queue is updated to failed consumption, it is necessary to immediately delete the timed task execution instruction in the message queue and the Redis cache. Deleting the timed task execution instruction in the message queue is to prevent problems such as message queue congestion caused by repeated consumption or continuous consumption. Deleting the timed task execution instruction in the Redis cache is to prevent the instruction resending compensation mechanism from being triggered and backing up the timed task execution instruction to the database again, and triggering the consumption failure compensation mechanism for the timed task at a preset time interval.

[0069] If the consumption is successful, then immediately delete the timed task execution instruction in the message queue and the Redis cache as well.

[0070] Furthermore, the instruction resending compensation mechanism specifically includes:

[0071] Resend the timed task execution instruction in the Redis cache to the message queue.

[0072] It should be noted that since the probability of the timed task execution instruction sending failure is very low, the Redis cache can be used for automatic instruction resending compensation, which also ensures the processing efficiency of business messages.

[0073] Furthermore, if the consumption status of the timed task execution instruction is updated to failed consumption, then delete the timed task execution instruction in the message queue and the Redis cache, and store the timed task execution instruction in the database, so that the database triggers the consumption failure compensation mechanism for the timed task at a third preset time interval. The specific steps include:

[0074] If the consumption status of the timed task execution instruction is updated to failed consumption, then determine whether the timed task execution instruction contains a preset flag;

[0075] If the timed task execution instruction does not contain a preset flag, then delete the timed task execution instruction in the message queue and the Redis cache, store the timed task execution instruction in the database, add a preset flag to the timed task execution instruction in the database, and record the retry count of the business message as 0;

[0076] If the timing task execution instruction contains a preset flag, then, taking the third preset time interval as the timing task, send the timing task execution instruction in the database to the message queue, and increment the retry count of the timing task execution instruction by one.

[0077] It should be noted that the consumption failure of the timing task execution instruction is a common scenario and may require manual intervention for processing. Therefore, the timing task execution instruction is simultaneously backed up to the database to facilitate subsequent operations such as querying, updating, and retrying by the operation and maintenance personnel. When consumption fails, it is necessary to determine whether the timing task execution instruction contains a preset flag. The presence of the preset flag indicates that this timing task execution instruction is not the first consumption failure.

[0078] If the timing task execution instruction does not contain a preset flag, it means that this timing task execution instruction is the first to be consumed and failed. While deleting the timing task execution instruction in the message queue and the redis cache, a preset flag needs to be assigned to the timing task execution instruction newly added to the database, and at the same time, the retry count of this timing task execution instruction is recorded as 0.

[0079] If the timing task execution instruction contains a preset flag, it means that this timing task execution instruction is not the first to be consumed and failed. Then, taking the preset time interval as the timing task, send the timing task execution instruction that is only saved in the database to the message queue, and increment the retry count of this timing task execution instruction by one.

[0080] Further, if the timing task execution instruction contains a preset flag, then sending the timing task execution instruction in the database to the message queue and incrementing the retry count of the timing task execution instruction by one specifically includes:

[0081] If the timing task execution instruction contains a preset flag and the retry count of the timing task execution instruction reaches the preset threshold, then trigger the email warning mechanism;

[0082] If the timing task execution instruction contains a preset flag, but the retry count of the timing task execution instruction does not reach the preset threshold, then send the timing task execution instruction in the database to the message queue, and increment the retry count of the timing task execution instruction by one.

[0083] It should be noted that when the number of times the timing task execution instruction is consumed and failed reaches the preset threshold, it means that the consumption failure compensation mechanism automatically carried out by the system has no effect. It is necessary to trigger the email warning mechanism to prompt the operation and maintenance personnel of the abnormality of this business message, so as to ensure that this timing task execution instruction can finally be processed successfully, ensure data consistency, and avoid omission.

[0084] Please refer to Figure 2 , Figure 2The following is a schematic structural diagram of a timing task execution device for multiple systems in an embodiment of the present application, as Figure 2 shown, specifically as follows:

[0085] A configuration unit 201, configured to configure a timing task policy, where the timing task policy includes the business systems of applications, timing tasks, timing task trigger conditions, and execution cycles;

[0086] A scanning unit 202, configured to scan all the timing task policies in the timing task policy library at a first preset time interval;

[0087] A sending unit 203, configured to send a timing task execution instruction to the business system after the timing task trigger condition is met, where the timing task execution instruction carries the timing task and the execution cycle.

[0088] In an embodiment of the present application, a timing task execution method and device for multiple systems are provided. By configuring a timing task policy in a separate timing system and determining the scanning period of each timing task policy, a timing task execution instruction is sent to the business system after the timing task trigger condition is met, so that the business system executes the timing task. Only by modifying the timing task policy can the modification of the timing task of the business system be completed, solving the technical problem that if the execution policy of the timing task in the business system changes, technicians need to continuously modify the code and release new versions to complete the modification, which has a large workload and a complex configuration process.

[0089] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be repeated here.

[0090] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0091] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects and indicates that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item) of the following" or its similar expressions refer to any combination of these items, including any combination of single items (items) or plural items (items). For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0092] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.

[0093] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0094] In addition, the functional units in each embodiment of this application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0095] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (English full name: Read-Only Memory, English abbreviation: ROM), random access memories (English full name: Random Access Memory, English abbreviation: RAM), magnetic disks, or optical discs.

[0096] As described above, the above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of various embodiments of this application.

Claims

1. A method for executing timed tasks for multiple systems, characterized in that, Including: Configuring a timing task policy, which includes the business system of the application, timing tasks, timing task trigger conditions, and execution cycles; Scanning all the timing task policies in the timing task policy library at a first preset time interval; After meeting the timing task trigger condition, sending a timing task execution instruction to the business system, where the timing task execution instruction carries the timing task and the execution cycle; It also includes: Listening to the consumption status of the timing task execution instruction in the message queue, where the consumption status includes successful consumption and failed consumption; If the consumption status of the timing task execution instruction is updated to failed consumption, delete the timing task execution instruction in the message queue and the redis cache, and store the timing task execution instruction in the database, so that the database triggers a consumption failure compensation mechanism with a third preset time interval as the timing task; If the consumption status of the timing task execution instruction is updated to successful consumption, delete the timing task execution instruction in the message queue and the redis cache; The specific content of "if the consumption status of the timing task execution instruction is updated to failed consumption, delete the timing task execution instruction in the message queue and the redis cache, and store the timing task execution instruction in the database, so that the database triggers a consumption failure compensation mechanism with a third preset time interval as the timing task" includes: If the consumption status of the timing task execution instruction is updated to failed consumption, determine whether the timing task execution instruction contains a preset mark; If the timing task execution instruction does not contain the preset mark, delete the timing task execution instruction in the message queue and the redis cache, store the timing task execution instruction in the database, add the preset mark to the timing task execution instruction in the database, and record the retry count of the business message as 0; If the timing task execution instruction contains the preset mark, take the third preset time interval as the timing task, send the timing task execution instruction in the database to the message queue, and increment the retry count of the timing task execution instruction by one.

2. The method for executing timed tasks for multiple systems according to claim 1, wherein The timing task policy also includes an asynchronous message server and a message queue.

3. The method for executing timed tasks for multiple systems according to claim 2, wherein The specific content of "after meeting the timing task trigger condition, sending a timing task execution instruction to the business system" includes: After meeting the timing task trigger condition, send a timing task execution instruction to the asynchronous message server and the message queue associated with the business system.

4. The method for executing timed tasks for multiple systems according to claim 1, characterized in that It also includes: Receiving a timing task policy modification instruction; Adding the updated timing task policy to the timing task policy library.

5. The method for executing timed tasks for multiple systems according to claim 3, wherein, It also includes: Storing the timing task execution instruction in the redis cache; Scanning all the timing task execution instructions in the redis cache at a second preset time interval; If there is a timing task execution instruction in all the timing task execution instructions in the redis cache whose first generation time is greater than the preset time, trigger an instruction retransmission compensation mechanism and update the first generation time.

6. The method for executing timed tasks for multiple systems according to claim 5, wherein The instruction retransmission compensation mechanism specifically includes: Resending the timing task execution instruction in the redis cache to the message queue.

7. The method for executing timed tasks for multiple systems according to claim 1, wherein If the timing task execution instruction contains the preset flag, sending the timing task execution instruction in the database to the message queue and incrementing the retry count of the timing task execution instruction specifically includes: If the timing task execution instruction contains the preset flag and the retry count of the timing task execution instruction reaches the preset threshold, triggering the email warning mechanism; If the timing task execution instruction contains the preset flag but the retry count of the timing task execution instruction does not reach the preset threshold, sending the timing task execution instruction in the database to the message queue and incrementing the retry count of the timing task execution instruction by one.

8. A timing task execution device for multiple systems, characterized in that, It includes: A configuration unit for configuring the timing task policy, where the timing task policy includes the business system of the application, the timing task, the timing task trigger condition, and the execution period; A scanning unit for scanning all the timing task policies in the timing task policy library at a first preset time interval; A sending unit for sending a timing task execution instruction to the business system after the timing task trigger condition is met, where the timing task execution instruction carries the timing task and the execution period; It also includes: Monitoring the consumption status of the timing task execution instruction in the message queue, where the consumption status includes successful consumption and failed consumption; If the consumption status of the timing task execution instruction is updated to failed consumption, deleting the timing task execution instruction in the message queue and the redis cache, and storing the timing task execution instruction in the database, so that the database triggers the consumption failure compensation mechanism with the third preset time interval as the timing task; If the consumption status of the timing task execution instruction is updated to successful consumption, deleting the timing task execution instruction in the message queue and the redis cache; If the consumption status of the timing task execution instruction is updated to failed consumption, deleting the timing task execution instruction in the message queue and the redis cache, and storing the timing task execution instruction in the database, so that the database triggers the consumption failure compensation mechanism with the third preset time interval as the timing task specifically includes: If the consumption status of the timing task execution instruction is updated to failed consumption, determining whether the timing task execution instruction contains the preset flag; If the timing task execution instruction does not contain the preset flag, deleting the timing task execution instruction in the message queue and the redis cache, storing the timing task execution instruction in the database, adding the preset flag to the timing task execution instruction in the database, and recording the retry count of the business message as 0; If the timing task execution instruction contains the preset flag, taking the third preset time interval as the timing task, sending the timing task execution instruction in the database to the message queue, and incrementing the retry count of the timing task execution instruction by one.

Citation Information

Patent Citations

  • Distributed data service processing method, system and device and storage medium

    CN110633320A

  • Message processing method and device, electronic equipment and medium

    CN111381987A

  • Timing task management method and device and storage medium

    CN112799796A