CN114721801A - Dynamic scheduling method and device for batch task execution time - Google Patents

Dynamic scheduling method and device for batch task execution time Download PDF

Info

Publication number
CN114721801A
CN114721801A CN202210366917.8A CN202210366917A CN114721801A CN 114721801 A CN114721801 A CN 114721801A CN 202210366917 A CN202210366917 A CN 202210366917A CN 114721801 A CN114721801 A CN 114721801A
Authority
CN
China
Prior art keywords
task
batch
online transaction
time
value pair
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210366917.8A
Other languages
Chinese (zh)
Inventor
杜敏琪
穆孙婷
范曾鹏
冯晨昊
张嘉清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210366917.8A priority Critical patent/CN114721801A/en
Publication of CN114721801A publication Critical patent/CN114721801A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4825Interrupt from clock, e.g. time of day
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for dynamically scheduling execution time of batch tasks, which relate to the technical field of distribution and comprise the following steps: performing initialization configuration according to configuration information, wherein the configuration information comprises the number of batch tasks, a first key value pair, a second key value pair and the starting time of the batch tasks; configuring a task list containing a plurality of batch task information and timing task information in a database, wherein the timing task is used for setting an online transaction opening identifier to be closed; when the starting time is reached, executing the timing task and the batch tasks according to the task list, adding one to the value of the first key value pair after the execution of each batch task is finished, judging whether the value of the current first key value pair is equal to the number of the batch tasks, and if so, ending the timing task; and when the online transaction opening mark is detected to be opened, receiving and executing the online transaction. The invention can dynamically determine the ending time of the batch tasks and fully utilize system resources.

Description

Dynamic scheduling method and device for batch task execution time
Technical Field
The invention relates to the field of distributed technologies, in particular to a method and a device for dynamically scheduling batch task execution time.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
In order to make reasonable and efficient use of computer resources, the time at which an application performs a batch task is typically allocated at night. When the batch task involves a large amount of database adding, deleting, modifying and checking operations and the data volume is large, in order to avoid the mutual influence between the batch task and the online transaction, the application program rejects the non-query online transaction (the online transaction with the database adding, deleting, modifying and checking operations, hereinafter referred to as online transaction). Because the start time and the end time of the batch tasks are often set according to past experience and are fixed values, the start time and the end time cannot be modified, when the end time of the actual batch tasks is earlier than the configuration time, the online transaction still needs to be executed openly until the configured end time, system resource waste is caused, and user experience brought to users who need to perform online transaction urgently is poor.
Disclosure of Invention
The embodiment of the invention provides a dynamic scheduling method of batch task execution time, which is used for dynamically determining the ending time of batch tasks, immediately opening online transaction when the ending time of the batch tasks is reached, and fully utilizing system resources, and comprises the following steps:
performing initialization configuration according to configuration information, wherein the configuration information comprises the number of batch tasks, a first key value pair, a second key value pair and the starting time of the batch tasks; the second key value pair is used for storing an online transaction opening identifier, and the initial value of the online transaction opening identifier is started;
configuring a task list containing a plurality of batch task information and timing task information in a database, wherein the timing task is used for setting an online transaction opening identifier to be closed, and the starting time of the timing task is earlier than that of the batch task;
when the starting time is reached, executing the timing task and the batch tasks according to the task list, adding one to the value of the first key value pair after the execution of each batch task is finished, judging whether the value of the current first key value pair is equal to the number of the batch tasks, and if so, ending the timing task; when the timing task is finished, the online transaction opening identification is restored to be opened;
and when the online transaction opening identifier is detected to be opened, receiving and executing the online transaction.
The embodiment of the invention also provides a dynamic scheduling device for the execution time of the batch tasks, which is used for dynamically determining the ending time of the batch tasks, immediately opening online transaction when the ending time of the batch tasks is reached, and fully utilizing system resources, and comprises:
the initialization module is used for carrying out initialization configuration according to configuration information, wherein the configuration information comprises the number of the batch tasks, the first key value pair, the second key value pair and the start time of the batch tasks; the second key value pair is used for storing an online transaction opening identifier, and the initial value of the online transaction opening identifier is opened;
the system comprises a task configuration module, a data base and a transaction processing module, wherein the task configuration module is used for configuring a task list containing a plurality of batch task information and a timing task information in the data base, the timing task is used for setting an online transaction opening identifier to be closed, and the starting time of the timing task is earlier than that of the batch task;
the batch module is used for executing the timing tasks and the batch tasks according to the task list when the starting time is reached, adding one to the value of the first key value pair after the execution of each batch task is finished, judging whether the value of the current first key value pair is equal to the number of the batch tasks or not, and ending the timing task if the value of the current first key value pair is equal to the number of the batch tasks; when the timing task is finished, the online transaction opening identification is restored to be opened;
and the online module is used for receiving and executing the online transaction when detecting that the online transaction opening mark is opened.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the dynamic scheduling method of the batch task execution time when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the method for dynamically scheduling the batch task execution time is realized.
The embodiment of the invention also provides a computer program product, which comprises a computer program, and when the computer program is executed by a processor, the method for dynamically scheduling the batch task execution time is realized.
In the embodiment of the invention, firstly, the number of batch tasks, a first key value pair, a second key value pair and the start time of the batch tasks are initialized and configured, wherein the first key value pair is used for storing the completion number of the batch tasks, the second key value pair is used for storing an online transaction open identifier, and the initial value of the online transaction open identifier is opened; a task list containing a plurality of batch task information and timing task information is configured in the database; when the starting time of the initialization configuration is reached, the timing task and the batch task are executed according to the task list, and the starting time of the timing task is earlier than that of the batch task, so that the on-line transaction open mark is set to be closed by the timing task when the batch task is executed, the system cannot receive on-line transaction in the batch task execution process, and the batch task is ensured not to be interfered by the on-line transaction. After each batch task is executed, adding one to the value of the first key value pair, judging whether the value of the current first key value pair is equal to the number of the batch tasks, if so, ending the timing task, and when the timing task is ended, restoring the online transaction opening identifier to be opened; and when the online transaction opening mark is detected to be opened, receiving and executing the online transaction. Compared with the technical scheme that the online transaction can be opened and executed only after the configured ending time in the prior art, the online transaction can be opened after the batch tasks are completed through the timing task control, and the time for ending the execution of the distributed batch tasks can be determined in real time, so that the system resources can be fully utilized, the efficiency is high, the influence of the batch tasks at night on the online transaction is reduced, and the customer experience is also improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a flowchart illustrating a method for dynamically scheduling execution times of batch tasks according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for dynamically scheduling execution times of batch tasks according to an embodiment of the present invention;
FIG. 3 is an interaction diagram of a method for dynamically scheduling execution times of batch tasks according to an embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for dynamically scheduling execution times of tasks in batches according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
An embodiment of the present invention provides a method for dynamically scheduling execution times of batch tasks, as shown in fig. 1, the method includes:
step 101, performing initialization configuration according to configuration information, wherein the configuration information comprises the number of batch tasks, a first key value pair, a second key value pair and start time of the batch tasks.
In the embodiment of the present invention, the number of batch tasks is configured on each application node of a batch module (a module for processing batch tasks), and if N represents the number of batch tasks, the number of batch tasks is configured on each application node of the batch tasks.
Two key-value pairs (key-values) are initialized in redis, a first key-value pair K1-V1 and a second key-value pair K2-V2. The system comprises a K1-V1, a K2-V2 and an online transaction opening identifier, wherein the K1-V1 is used for storing the number of completed batch tasks, the initial value is 0, the K2-V2 is used for storing the online transaction opening identifier, and the initial value of the online transaction opening identifier is ON (ON). The online transaction open identification is stored in the redis, and the reading performance is higher than that of a database, so that the system performance is better.
Step 102, configuring a task list containing a plurality of batch task information and a timing task information in a database, wherein the timing task is used for setting the online transaction opening identifier to be closed, and the starting time of the timing task is earlier than that of the batch task.
That is, the information of N tasks including 1 timed task and N-1 batch tasks is configured in the database. When the timed task is started, the online transaction open flag is set to OFF (OFF).
When the ON-line transaction open flag is ON, the system is in a state of receiving the ON-line transaction, and the batch task is not executed in this state. Therefore, the timing task is started earlier than the batch task, and the online open flag is set to be OFF after the timing task is started, so that online transactions are not received any more, and the batch task can be processed.
103, when the starting time is reached, executing the timing task and the batch tasks according to the task list, adding one to the value of the first key value pair after the execution of each batch task is finished, judging whether the value of the current first key value pair is equal to the number of the batch tasks, and if so, ending the timing task; when the timed task is finished, the online transaction open identification is restored to be open.
When the starting time is reached, the timing tasks are started preferentially, and after the timing tasks are started, each application node of the batch module randomly claims to execute each batch task one by one according to the batch tasks configured in the task list. After each application node finishes the corresponding batch task, adding 1 to V1 in redis, then judging whether the value of V1 is equal to the number N of the batch tasks, if V1 is equal to N, ending the timing task, and setting V2 to be ON.
If the decision V1 ≠ N, then the batch task continues to be executed.
And step 104, receiving and executing the online transaction when the online transaction opening mark is detected to be opened.
In the embodiment of the invention, the situation that the condition of finishing the timing task can not be achieved all the time due to execution failure caused by abnormality in the execution process of some batch tasks is considered, so that the batch tasks can occupy system resources all the time to cause that online transaction can not be executed. In order to avoid the above situation, in the embodiment of the present invention, the end time of the batch task is also configured in the configuration information, and when the end time is reached, whether the timed task has ended is detected; and if the timing task is not finished, finishing the timing task. The end time and the end of the timing task are used as double insurance for ending the batch tasks, so that the situation that the batch tasks always occupy system resources can be effectively avoided.
Considering that the time when the system receives the online transaction is not fixed, in the embodiment of the invention, the start time and the end time of the batch task are configured in the online module (the module for processing the online transaction task). When the online transaction task is received, as shown in fig. 2, it is determined whether to execute the online transaction according to the following steps 201 to 204.
It should be noted that step 202 and step 203 are not performed simultaneously.
Step 201, when an online transaction task is received, judging whether the current time is between the starting time and the ending time of a batch task;
step 202, if the current time is not between the starting time and the ending time, executing an online transaction task;
step 203, if the current time is between the start time and the end time, reading the value of the second key-value pair from the redis;
and step 204, if the value of the second key value pair is opened, executing the online transaction task.
It should be noted that the configured ending time of the batch task is a time value estimated according to historical experience, and the time value is later than the ending time of the normal processing of the batch task.
When the online module receives the online transaction task, whether the online transaction task is between the start time and the end time is judged preferentially according to the start time and the end time of the batch tasks configured on the application node of the online module, if the online transaction task is between the start time and the end time, the value of V2 is inquired in redis, and whether the online transaction task can be executed is determined according to the value of V2, so that the reading times of redis can be reduced, and system resources are saved.
In another implementation, if the online module queries that the value of the second key-value pair is OFF, the online transaction task is not executed for the moment.
For convenience of more clearly explaining the execution process of the embodiment of the present invention, fig. 3 shows an interaction schematic diagram of another dynamic scheduling method for batch task execution time in a modular form, and since the interaction process of the interaction schematic diagram is substantially the same as the flows in the above step 101 to step 104 and their various implementation manners, details are not repeated for fig. 3.
In the embodiment of the invention, firstly, the number of batch tasks, a first key value pair, a second key value pair and the start time of the batch tasks are initialized and configured, wherein the first key value pair is used for storing the completion number of the batch tasks, the second key value pair is used for storing an online transaction open identifier, and the initial value of the online transaction open identifier is opened; a task list containing a plurality of batch task information and timing task information is configured in the database; when the starting time of the initialization configuration is reached, the timing task and the batch task are executed according to the task list, and the starting time of the timing task is earlier than that of the batch task, so that the on-line transaction open mark is set to be closed by the timing task when the batch task is executed, the system cannot receive on-line transaction in the batch task execution process, and the batch task is ensured not to be interfered by the on-line transaction. After each batch task is executed, adding one to the value of the first key value pair, judging whether the value of the current first key value pair is equal to the number of the batch tasks, if so, ending the timing task, and when the timing task is ended, restoring the online transaction opening identifier to be opened; and when the online transaction opening identifier is detected to be opened, receiving and executing the online transaction. Compared with the technical scheme that the online transaction can be opened and executed only after the configured ending time in the prior art, the online transaction can be opened after the batch tasks are completed through the timing task control, and the time for ending the execution of the distributed batch tasks can be determined in real time, so that the system resources can be fully utilized, the efficiency is high, the influence of the batch tasks at night on the online transaction is reduced, and the customer experience is also improved.
The embodiment of the invention also provides a device for dynamically scheduling the execution time of the batch tasks, which is described in the following embodiment. Because the principle of the device for solving the problems is similar to the method for dynamically scheduling the execution time of the batch tasks, the implementation of the device can refer to the implementation of the method for dynamically scheduling the execution time of the batch tasks, and repeated parts are not described again.
As shown in FIG. 4, the apparatus 400 includes an initialization module 401, a task configuration module 402, a batch module 403, and an online module 404.
The initialization module 401 is configured to perform initialization configuration according to configuration information, where the configuration information includes the number of batch tasks, a first key value pair, a second key value pair, and start time of the batch tasks; the second key value pair is used for storing an online transaction opening identifier, and the initial value of the online transaction opening identifier is opened;
a task configuration module 402, configured to configure a task list including a plurality of pieces of batch task information and a piece of timing task information in a database, where the timing task is configured to set the online transaction open identifier to be closed, and the start time of the timing task is earlier than that of the batch task;
a batch module 403, configured to execute the timing task and the batch tasks according to the task list when the start time is reached, add one to the value of the first key-value pair after each batch task is executed, and determine whether the current value of the first key-value pair is equal to the number of the batch tasks, and if so, end the timing task; when the timed task is finished, the online transaction opening mark is restored to be opened;
and the online module 404 is configured to receive and execute the online transaction when detecting that the online transaction open flag is open.
In an implementation manner of the embodiment of the present invention, the configuration information further includes an end time of the batch task, and the batch module is further configured to:
when the ending time is reached, detecting whether the timing task is ended;
and if the timing task is not finished, finishing the timing task.
In one implementation of the embodiments of the present invention, a first key-value pair and a second key-value pair are configured in a redis.
In an implementation manner of the embodiment of the present invention, the configuration information further includes an end time of the batch task, and the online module is further configured to:
when an online transaction task is received, judging whether the current time is between the starting time and the ending time of the batch task;
if the current time is not between the start time and the end time, executing the online transaction task;
reading the value of the second key-value pair from the redis if the current time is between the start time and the end time;
if the value of the second key-value pair is open, the online transaction task is executed.
In the embodiment of the invention, firstly, the number of batch tasks, a first key value pair, a second key value pair and the start time of the batch tasks are initialized and configured, wherein the first key value pair is used for storing the completion number of the batch tasks, the second key value pair is used for storing an online transaction open identifier, and the initial value of the online transaction open identifier is opened; a task list containing a plurality of batch task information and timing task information is configured in the database; when the starting time of the initialization configuration is reached, the timing task and the batch task are executed according to the task list, and the starting time of the timing task is earlier than that of the batch task, so that the on-line transaction open mark is set to be closed by the timing task when the batch task is executed, the system cannot receive on-line transaction in the batch task execution process, and the batch task is ensured not to be interfered by the on-line transaction. After each batch task is executed, adding one to the value of the first key value pair, judging whether the value of the current first key value pair is equal to the number of the batch tasks, if so, ending the timing task, and when the timing task is ended, restoring the online transaction opening identifier to be opened; and when the online transaction opening mark is detected to be opened, receiving and executing the online transaction. Compared with the technical scheme that the online transaction can be opened and executed only after the configured ending time in the prior art, the online transaction can be opened after the batch tasks are completed through the timing task control, and the time for ending the execution of the distributed batch tasks can be determined in real time, so that the system resources can be fully utilized, the efficiency is high, the influence of the batch tasks at night on the online transaction is reduced, and the customer experience is also improved.
An embodiment of the present invention further provides a computer device, and fig. 5 is a schematic diagram of a computer device in an embodiment of the present invention, where the computer device is capable of implementing all steps in the method for dynamically scheduling batch task execution times in the foregoing embodiment, and the computer device specifically includes the following contents:
a processor (processor)501, a memory (memory)502, a communication Interface (Communications Interface)503, and a communication bus 504;
the processor 501, the memory 502 and the communication interface 503 complete mutual communication through the communication bus 504; the communication interface 503 is used for implementing information transmission between related devices;
the processor 501 is configured to call the computer program in the memory 502, and when the processor executes the computer program, the processor implements the method for dynamically scheduling the batch task execution time in the above embodiments.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the method for dynamically scheduling the batch task execution time is realized.
The embodiment of the invention also provides a computer program product, which comprises a computer program, and when the computer program is executed by a processor, the method for dynamically scheduling the batch task execution time is realized.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (11)

1. A method for dynamically scheduling execution time of a batch of tasks, the method comprising:
carrying out initialization configuration according to configuration information, wherein the configuration information comprises the number of batch tasks, a first key value pair, a second key value pair and the start time of the batch tasks; the second key value pair is used for storing an online transaction opening identifier, and the initial value of the online transaction opening identifier is started;
configuring a task list containing a plurality of batch task information and timing task information in a database, wherein the timing task is used for setting an online transaction opening identifier to be closed, and the starting time of the timing task is earlier than that of the batch task;
when the starting time is reached, executing the timing task and the batch tasks according to the task list, after each batch task is executed, adding one to the value of the first key value pair, judging whether the value of the current first key value pair is equal to the number of the batch tasks or not, and if so, ending the timing task; when the timing task is finished, the online transaction opening identification is restored to be opened;
and when the online transaction opening identifier is detected to be opened, receiving and executing the online transaction.
2. The method of claim 1, wherein the configuration information further includes an end time of the batch task, and the method further comprises:
when the ending time is reached, detecting whether the timing task is ended;
and if the timing task is not finished, finishing the timing task.
3. The method of claim 1, wherein the first key-value pair and the second key-value pair are configured in redis.
4. The method of claim 3, wherein the configuration information further includes an end time of the batch task, and the method further comprises:
when an online transaction task is received, judging whether the current time is between the starting time and the ending time of the batch task;
if the current time is not between the start time and the end time, executing an online transaction task;
reading the value of the second key-value pair from redis if the current time is between the start time and the end time;
and if the value of the second key-value pair is open, executing the online transaction task.
5. An apparatus for dynamically scheduling execution times of a plurality of tasks, the apparatus comprising:
the initialization module is used for carrying out initialization configuration according to configuration information, wherein the configuration information comprises the number of the batch tasks, the first key value pair, the second key value pair and the start time of the batch tasks; the second key value pair is used for storing an online transaction opening identifier, and the initial value of the online transaction opening identifier is started;
the system comprises a task configuration module, a data base and a transaction processing module, wherein the task configuration module is used for configuring a task list containing a plurality of batch task information and a timing task information in the data base, the timing task is used for setting an online transaction opening identifier to be closed, and the starting time of the timing task is earlier than that of the batch task;
the batch module is used for executing the timing tasks and the batch tasks according to the task list when the starting time is reached, adding one to the value of the first key value pair after the execution of each batch task is finished, judging whether the value of the current first key value pair is equal to the number of the batch tasks or not, and ending the timing tasks if the value of the current first key value pair is equal to the number of the batch tasks; when the timing task is finished, the online transaction opening identification is restored to be opened;
and the online module is used for receiving and executing the online transaction when detecting that the online transaction opening mark is opened.
6. The apparatus of claim 5, wherein the configuration information further includes an end time of a batch task, and wherein the batch module is further configured to:
when the ending time is reached, detecting whether the timing task is ended or not;
and if the timing task is not finished, finishing the timing task.
7. The apparatus of claim 5, wherein the first key-value pair and the second key-value pair are configured in redis.
8. The apparatus of claim 7, wherein the configuration information further includes an end time of the batch task, and wherein the online module is further configured to:
when an online transaction task is received, judging whether the current time is between the starting time and the ending time of the batch task;
if the current time is not between the start time and the end time, executing an online transaction task;
reading the value of the second key-value pair from redis if the current time is between the start time and the end time;
and if the value of the second key-value pair is open, executing the online transaction task.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 4.
11. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1 to 4.
CN202210366917.8A 2022-04-08 2022-04-08 Dynamic scheduling method and device for batch task execution time Pending CN114721801A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210366917.8A CN114721801A (en) 2022-04-08 2022-04-08 Dynamic scheduling method and device for batch task execution time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210366917.8A CN114721801A (en) 2022-04-08 2022-04-08 Dynamic scheduling method and device for batch task execution time

Publications (1)

Publication Number Publication Date
CN114721801A true CN114721801A (en) 2022-07-08

Family

ID=82242457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210366917.8A Pending CN114721801A (en) 2022-04-08 2022-04-08 Dynamic scheduling method and device for batch task execution time

Country Status (1)

Country Link
CN (1) CN114721801A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115967641A (en) * 2023-03-16 2023-04-14 浙江正泰仪器仪表有限责任公司 Method and device for batch equipment parameter operation, computer equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115967641A (en) * 2023-03-16 2023-04-14 浙江正泰仪器仪表有限责任公司 Method and device for batch equipment parameter operation, computer equipment and medium
CN115967641B (en) * 2023-03-16 2023-05-30 浙江正泰仪器仪表有限责任公司 Method, device, computer equipment and medium for operating batch equipment parameters

Similar Documents

Publication Publication Date Title
CN108280150B (en) Distributed asynchronous service distribution method and system
CN110955523B (en) Service processing method and device
CN110225078B (en) Application service updating method, system and terminal equipment
CN110162344B (en) Isolation current limiting method and device, computer equipment and readable storage medium
CN110599341A (en) Transaction calling method and system
CN113067866B (en) Batch file transmission method and device between heterogeneous systems
CN104899093A (en) Data processing method, data processing device and data processing system
CN114721801A (en) Dynamic scheduling method and device for batch task execution time
CN113285843B (en) Container network configuration method and device, computer readable medium and electronic equipment
CN112153126A (en) Deployment and node management method and system for K8S cluster
CN111258985A (en) Data cluster migration method and device
CN110347492A (en) Distributed task dispatching method and apparatus based on time parameter method
CN110347735A (en) The data forwarding of configurationization mends processing method, device and readable storage medium storing program for executing extremely
CN110381150B (en) Data processing method and device on block chain, electronic equipment and storage medium
CN110991983A (en) Task processing method, device, medium and equipment
CN107958414B (en) Method and system for eliminating long transactions of CICS (common integrated circuit chip) system
CN112130962B (en) Continuous delivery platform and method for deploying application system by using same
CN115220887A (en) Processing method of scheduling information, task processing system, processor and electronic equipment
CN113656374A (en) Method and device for processing service message with attachment
CN110825528B (en) Resource management method, device and equipment
CN114896637A (en) Data processing method and device, electronic equipment and storage medium
CN110737533A (en) task scheduling method and device, electronic equipment and storage medium
CN111324368A (en) Data sharing method and server
CN109558238A (en) Task executing method and device
CN112766768B (en) Contract flow management method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination