CN115167998A - Batch task execution method and device - Google Patents

Batch task execution method and device Download PDF

Info

Publication number
CN115167998A
CN115167998A CN202210761855.0A CN202210761855A CN115167998A CN 115167998 A CN115167998 A CN 115167998A CN 202210761855 A CN202210761855 A CN 202210761855A CN 115167998 A CN115167998 A CN 115167998A
Authority
CN
China
Prior art keywords
batch
processed
batch tasks
tasks
task
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
CN202210761855.0A
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 CN202210761855.0A priority Critical patent/CN115167998A/en
Publication of CN115167998A publication Critical patent/CN115167998A/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/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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Abstract

The embodiment of the invention provides a batch task execution method and a device, which can be used in the technical field of artificial intelligence, and the method comprises the following steps: if the matching of the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, generating a first new control record according to the generated target control number and the batch tasks to be processed; the first newly added control record is added to the concurrency control table, and the batch tasks to be processed are executed, so that the batch tasks can be orderly executed, manual intervention is reduced, the labor cost is saved, and the operation efficiency and the success rate are improved.

Description

Batch task execution method and device
Technical Field
The invention relates to the technical field of computers, in particular to the technical field of artificial intelligence, and particularly relates to a batch task execution method and device.
Background
The servers of a batch servlet deployment should have the property of how alive and highly available. In the related art, a cold backup mode is mostly adopted for a plurality of batch servers, namely: in many batch servers, only one batch server is in operation, and after this batch server crashes, can influence the operation of whole batch service program, leads to batch service program operation failure, needs later stage manual intervention, and the batch server that adopts the mode of script to call cold standby carries out to resume batch service program's operation, and extravagant manpower resources, the failure rate is higher, and the operating efficiency is lower.
Disclosure of Invention
The invention aims to provide a batch task execution method, which can be used for orderly executing batch tasks, reducing manual intervention, saving labor cost and improving operation efficiency and success rate. Another object of the present invention is to provide a batch task performing apparatus. It is yet another object of the present invention to provide a computer readable medium. It is a further object of this invention to provide a computer apparatus.
In order to achieve the above object, an aspect of the present invention discloses a batch task execution method, including:
if the matching of the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, generating a first new control record according to the generated target control number and the batch tasks to be processed;
and adding the first new control adding record to a concurrent control table, and executing the batch tasks to be processed.
Preferably, the concurrency control table comprises a plurality of batch tasks and a task name of each batch task;
before generating a first new control record according to the generated target control number and the batch tasks to be processed if the matching between the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, the method further comprises the following steps:
judging whether the task names of the batch tasks to be processed comprise the task names of the batch tasks to be processed or not;
if so, matching the batch tasks to be processed with the batch tasks in the concurrency control table successfully;
if not, matching of the batch tasks to be processed and the batch tasks in the concurrency control table fails.
Preferably, after the matching between the batch tasks to be processed and the batch tasks in the concurrency control table is successful, the method further includes:
judging overtime of the batch tasks to be processed;
and if the batch tasks to be processed are overtime, updating the concurrency control table according to the generated target control numbers and the batch tasks to be processed, and executing the batch tasks to be processed.
Preferably, the concurrency control table comprises a plurality of batch tasks and the execution time of each batch task;
the overtime judgment of the batch tasks to be processed comprises the following steps:
inquiring the execution time of the batch tasks corresponding to the batch tasks to be processed according to the concurrency control table;
calculating execution duration according to the execution time and the acquired current time;
if the execution duration is longer than the set overtime threshold, the batch tasks to be processed are overtime;
if the execution time length is less than or equal to the overtime threshold, the batch tasks to be processed are not overtime.
Preferably, updating the concurrency control table according to the generated target control number and the batch tasks to be processed comprises:
deleting a target control record from the concurrent control table, wherein the target control record is a control record of a batch task matched with the batch task to be processed;
and generating a second newly-added control record according to the generated target control number and the batch tasks to be processed.
Preferably, before executing the batch task to be processed, the method further comprises:
inquiring a corresponding concurrency control number from a concurrency control table according to the task name of the batch task to be processed;
and if the concurrent control number is the same as the target control number, executing the batch tasks to be processed.
The invention also discloses a batch task execution device, which comprises:
the generating unit is used for generating a first new control record according to the generated target control number and the batch tasks to be processed if the obtained batch tasks to be processed are failed to be matched with the batch tasks in the set concurrency control table;
and the adding unit is used for adding the first newly added control record to the concurrent control table and executing the batch tasks to be processed.
Preferably, the concurrency control table comprises a plurality of batch tasks and a task name of each batch task;
the device still includes:
the first judging unit is used for judging whether the task names of the batch tasks to be processed are included in the task names of the plurality of batch tasks; if so, matching the batch tasks to be processed with the batch tasks in the concurrency control table successfully; if not, matching of the batch tasks to be processed and the batch tasks in the concurrency control table fails.
Preferably, the apparatus further comprises:
the overtime judging unit is used for judging overtime of the batch tasks to be processed;
and the updating unit is used for updating the concurrency control table according to the generated target control number and the batch tasks to be processed and executing the batch tasks to be processed if the batch tasks to be processed are overtime.
Preferably, the concurrency control table comprises a plurality of batch tasks and the execution time of each batch task;
the overtime judging unit is specifically used for inquiring the execution time of the batch tasks corresponding to the batch tasks to be processed according to the concurrency control table; calculating execution duration according to the execution time and the acquired current time; if the execution duration is longer than the set overtime threshold, the batch tasks to be processed are overtime; and if the execution duration is less than or equal to the overtime threshold, the batch tasks to be processed are not overtime.
Preferably, the updating unit is specifically configured to delete a target control record from the concurrency control table, where the target control record is a control record of a batch task that matches the batch task to be processed; and generating a second newly-added control record according to the generated target control number and the batch tasks to be processed.
Preferably, the apparatus further comprises:
the query unit is used for querying a corresponding concurrency control number from the concurrency control table according to the task name of the batch task to be processed;
and the second judgment unit is used for executing the batch tasks to be processed if the concurrent control number is the same as the target control number.
The invention also discloses a computer-readable medium, on which a computer program is stored which, when executed by a processor, implements a method as described above.
The invention also discloses a computer device comprising a memory for storing information comprising program instructions and a processor for controlling the execution of the program instructions, the processor implementing the method as described above when executing the program.
The invention also discloses a computer program product comprising a computer program/instructions which, when executed by a processor, implement the method as described above
If matching between the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, generating a first newly added control record according to the generated target control number and the batch tasks to be processed; the first newly added control record is added to the concurrency control table, and the batch tasks to be processed are executed, so that the batch tasks can be executed orderly, manual intervention is reduced, the labor cost is saved, and the operation efficiency and the success rate are 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.
FIG. 1 is a flowchart of a method for executing a batch of tasks according to an embodiment of the present invention;
FIG. 2 is a flowchart of another batch task execution method according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for determining timeout of batch tasks to be processed according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a batch task execution device 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
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the batch task execution method and apparatus disclosed in the present application may be used in the technical field of artificial intelligence, and may also be used in any field other than the technical field of artificial intelligence.
The following describes an implementation process of the batch task execution method provided by the embodiment of the present invention, taking a batch task execution device as an execution subject. It can be understood that the execution subject of the batch task execution method provided by the embodiment of the invention includes, but is not limited to, a batch task execution device.
Fig. 1 is a flowchart of a batch task execution method according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
and 101, if the matching of the acquired batch tasks to be processed and the batch tasks in the set concurrency control table fails, generating a first new control record according to the generated target control number and the batch tasks to be processed.
And 102, adding the first new control record to a concurrent control table, and executing the batch tasks to be processed.
In the technical scheme provided by the embodiment of the invention, if the matching of the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, a first newly added control record is generated according to the generated target control number and the batch tasks to be processed; the first newly added control record is added to the concurrency control table, and the batch tasks to be processed are executed, so that the batch tasks can be orderly executed, manual intervention is reduced, the labor cost is saved, and the operation efficiency and the success rate are improved.
Fig. 2 is a flowchart of another batch task execution method according to an embodiment of the present invention, and as shown in fig. 2, the method includes:
step 201, judging whether the task names of the batch tasks comprise the task names of the batch tasks to be processed or not, if so, executing step 204; if not, go to step 202.
In the embodiment of the invention, each step is executed by the batch task execution device.
In the embodiment of the invention, a concurrency control table is preset, wherein the concurrency control table stores a plurality of batch tasks currently executed, the concurrency control table comprises a plurality of concurrency control records, and the concurrency control records comprise but are not limited to the task name, the concurrency control number and the execution time of each batch task. Wherein the task name is the primary key of the concurrency control table.
In the embodiment of the invention, the batch tasks to be processed can be initiated by a third party.
Specifically, if the task names of the batch tasks include the task name of the batch task to be processed, indicating that the batch task to be processed is being executed, the batch task to be processed is successfully matched with the batch task in the concurrency control table, and continuing to execute step 204; if the task names of the batch tasks do not include the task name of the batch task to be processed, it indicates that the batch task to be processed is not executed yet, and the matching between the batch task to be processed and the batch task in the concurrency control table fails, the step 202 is continuously executed.
And 202, generating a first newly added control record according to the generated target control number and the batch tasks to be processed.
In the embodiment of the invention, the target control number is randomly generated and uniquely identifies one control record. At the same time, no two batch servers generate the same control number.
Step 203, add the first new control record to the concurrency control table, and continue to execute step 206.
In the embodiment of the invention, a first new added control record is inserted into the concurrency control table to indicate that the batch tasks are executed, and the batch servers inserted with the first new added control record occupy the execution right of the batch tasks.
Step 204, judging overtime of the batch tasks to be processed, and if overtime exists, executing step 205; if not, the process ends.
In the embodiment of the present invention, the concurrency control table stores a plurality of batch tasks currently being executed, the concurrency control table includes a plurality of concurrency control records, and the concurrency control records include, but are not limited to, a task name, a concurrency control number, and an execution time of each batch task.
Fig. 3 is a flowchart of a method for determining timeout of batch tasks to be processed according to an embodiment of the present invention, and as shown in fig. 3, the method includes:
step 2041, according to the concurrency control table, querying the execution time of the batch tasks corresponding to the batch tasks to be processed.
In the embodiment of the invention, the execution time of the batch of tasks is inquired for subsequent calculation of the execution time.
Step 2042, calculating the execution duration according to the execution time and the obtained current time.
Specifically, the execution time is subtracted from the current time to obtain the execution duration of the batch tasks.
Step 2043, judging whether the execution duration is greater than a set overtime threshold, if so, executing step 2044; if not, go to step 2045.
In the embodiment of the present invention, the timeout threshold is preset according to an actual situation, and a specific value of the timeout threshold is not limited in the embodiment of the present invention.
Specifically, if the execution duration is greater than the set timeout threshold, the batch tasks to be processed are overtime, and step 2044 is continuously executed; if the execution duration is less than or equal to the timeout threshold, the batch task to be processed is not timeout, and step 2045 is continued.
And 2044, when the batch task to be processed is overtime, continuing to execute the step 205.
Specifically, if the batch task to be processed is overtime, it indicates that the batch task is invoked by another server for execution, and then the server executing the batch task is down, so that the batch task is not executed and completed all the time, and step 205 is continuously executed.
And 2045, ending the flow if the batch tasks to be processed are not overtime.
Specifically, if the batch task to be processed is not overtime, it indicates that the batch task is in execution, and the flow ends.
And step 205, updating a concurrency control table according to the generated target control number and the batch tasks to be processed.
Specifically, if the batch task to be processed is overtime, the target control record in which the batch task to be processed is located is invalid, and the target control record is deleted from the concurrency control table and is the control record in which the batch task matched with the batch task to be processed is located.
Specifically, a second newly-added control record is generated according to the generated target control number and the batch tasks to be processed. The target control number is randomly generated and uniquely identifies one control record. At the same time, no two batch servers generate the same control number.
In the embodiment of the invention, a second newly added control record is inserted into the concurrency control table to indicate that the batch tasks are executed, and the batch servers inserted with the second newly added control record occupy the execution right of the batch tasks.
And step 206, inquiring a corresponding concurrency control number from the concurrency control table according to the task name of the batch task to be processed.
In the embodiment of the invention, the task name is a main key of the concurrency control table, and the concurrency control number of the batch tasks to be processed in the concurrency control table is inquired according to the task name.
Step 207, judging whether the concurrent control number is the same as the target control number, if so, executing step 208; if not, the process is ended.
In the embodiment of the present invention, if the concurrency control number is the same as the target control number, it indicates that the concurrency control record is inserted by the current batch server, and the current batch server preempts the execution right of the batch task, and continues to execute step 208; if the concurrent control number is different from the target control number, it indicates that the concurrent control record is not inserted by the current batch server, and the current batch server has no execution right for the batch tasks, and the process is ended.
In the embodiment of the invention, the concurrent control numbers are confirmed again before the batch tasks to be processed are executed, so that the accuracy of the batch servers executing the batch tasks to be processed is ensured, and the condition that the same batch tasks to be processed run on a plurality of batch servers at the same time is avoided.
And step 208, executing the batch tasks to be processed.
In the embodiment of the invention, the batch server which preempts the execution right executes the tasks according to the actual task requirements of the batch tasks to be processed.
According to the technical scheme of the batch task execution method, if matching of the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, a first newly added control record is generated according to the generated target control number and the batch tasks to be processed; the first newly added control record is added to the concurrency control table, and the batch tasks to be processed are executed, so that the batch tasks can be executed orderly, manual intervention is reduced, the labor cost is saved, and the operation efficiency and the success rate are improved.
Fig. 4 is a schematic structural diagram of a batch task execution device according to an embodiment of the present invention, where the device is configured to execute the batch task execution method, and as shown in fig. 4, the device includes: a generation 11 and an addition unit 12.
The generating unit 11 is configured to generate a first new additional control record according to the generated target control number and the batch task to be processed if matching between the acquired batch task to be processed and the batch task in the set concurrency control table fails;
the adding unit 12 is configured to add the first new added control record to the concurrent control table, and execute the batch task to be processed.
In the embodiment of the invention, the concurrency control table comprises a plurality of batch tasks and a task name of each batch task; the device still includes: a first judgment unit 13.
The first judging unit 13 is configured to judge whether task names of batch tasks to be processed are included in task names of a plurality of batch tasks; if so, matching the batch tasks to be processed with the batch tasks in the concurrency control table successfully; if not, matching of the batch tasks to be processed and the batch tasks in the concurrency control table fails.
In the embodiment of the present invention, the apparatus further includes: a timeout determination unit 14 and an update unit 15.
The timeout judging unit 14 is used for judging timeout of the batch tasks to be processed.
The updating unit 15 is configured to update the concurrency control table according to the generated target control number and the batch task to be processed, and execute the batch task to be processed, if the batch task to be processed is overtime.
In the embodiment of the invention, the concurrency control table comprises a plurality of batch tasks and the execution time of each batch task; the timeout judging unit 14 is specifically configured to query, according to the concurrence control table, execution times of batch tasks corresponding to the batch tasks to be processed; calculating execution duration according to the execution time and the acquired current time; if the execution duration is longer than the set overtime threshold, the batch tasks to be processed are overtime; and if the execution duration is less than or equal to the overtime threshold, the batch tasks to be processed are not overtime.
In the embodiment of the present invention, the updating unit 15 is specifically configured to delete a target control record from the concurrency control table, where the target control record is a control record of a batch task that matches the batch task to be processed; and generating a second newly-added control record according to the generated target control number and the batch tasks to be processed.
In the embodiment of the present invention, the apparatus further includes: an enquiring unit 16 and a second decision unit 17.
The query unit 16 is configured to query a corresponding concurrency control number from the concurrency control table according to the task name of the batch task to be processed.
The second judging unit 17 is configured to execute the batch task to be processed if the concurrent control number is the same as the target control number.
In the scheme of the embodiment of the invention, if the matching between the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, a first newly added control record is generated according to the generated target control number and the batch tasks to be processed; the first newly added control record is added to the concurrency control table, and the batch tasks to be processed are executed, so that the batch tasks can be executed orderly, manual intervention is reduced, the labor cost is saved, and the operation efficiency and the success rate are improved.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer device, which may be, for example, a personal computer, a laptop computer, a cellular telephone, 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.
An embodiment of the present invention provides a computer device, including a memory and a processor, where the memory is used to store information including program instructions, and the processor is used to control execution of the program instructions, and the program instructions are loaded and executed by the processor to implement the steps of the above-mentioned embodiment of the batch task execution method.
Referring now to FIG. 5, shown is a schematic diagram of a computer device 600 suitable for use in implementing embodiments of the present application.
As shown in fig. 5, the computer apparatus 600 includes a Central Processing Unit (CPU) 601 which can execute various appropriate jobs and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the computer apparatus 600 are also stored. The CPU601, ROM602, and RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output section 607 including a Cathode Ray Tube (CRT), a liquid crystal feedback (LCD), and the like, and a speaker and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that the computer program read out therefrom is mounted as necessary in the storage section 608.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
For convenience of description, the above devices are described as being divided into various units by function, respectively. Of course, the functionality of the various elements may be implemented in the same one or more pieces of software and/or hardware in the practice of the present application.
The present invention has been 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises that element.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (15)

1. A method for batch task execution, the method comprising:
if the matching of the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, generating a first new control record according to the generated target control number and the batch tasks to be processed;
and adding the first new control record to the concurrent control table, and executing the batch tasks to be processed.
2. The batch task execution method of claim 1, wherein the concurrency control table includes a plurality of batch tasks and a task name of each of the batch tasks;
before generating a first new control record according to the generated target control number and the batch tasks to be processed if the matching between the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails, the method further comprises the following steps:
judging whether the task names of the batch tasks to be processed comprise the task names of the batch tasks to be processed or not;
if so, successfully matching the batch tasks to be processed with the batch tasks in the concurrent control table;
if not, matching the batch tasks to be processed with the batch tasks in the concurrency control table fails.
3. The batch task execution method according to claim 2, further comprising, after the batch task to be processed is successfully matched with the batch task in the concurrency control table:
judging overtime of the batch tasks to be processed;
and if the batch tasks to be processed are overtime, updating the concurrency control table according to the generated target control numbers and the batch tasks to be processed, and executing the batch tasks to be processed.
4. The batch task execution method of claim 3, wherein the concurrency control table includes a plurality of batch tasks and an execution time of each of the batch tasks;
the overtime judgment of the batch tasks to be processed comprises the following steps:
inquiring the execution time of the batch tasks corresponding to the batch tasks to be processed according to the concurrency control table;
calculating execution duration according to the execution time and the acquired current time;
if the execution duration is greater than a set overtime threshold, the batch tasks to be processed are overtime;
and if the execution time length is less than or equal to the overtime threshold, the batch tasks to be processed are not overtime.
5. The batch task execution method of claim 3, wherein the updating the concurrency control table according to the generated target control number and the batch tasks to be processed comprises:
deleting a target control record from the concurrency control table, wherein the target control record is a control record of the batch tasks matched with the batch tasks to be processed;
and generating a second newly-added control record according to the generated target control number and the batch tasks to be processed.
6. The batch task execution method according to claim 1 or 3, further comprising, before the executing the batch task to be processed:
inquiring a corresponding concurrency control number from the concurrency control table according to the task name of the batch task to be processed;
and if the concurrent control number is the same as the target control number, executing the batch tasks to be processed.
7. A batch task execution apparatus, characterized in that the apparatus comprises:
the generating unit is used for generating a first new control record according to the generated target control number and the batch tasks to be processed if the matching of the obtained batch tasks to be processed and the batch tasks in the set concurrency control table fails;
and the adding unit is used for adding the first new adding control record to the concurrent control table and executing the batch tasks to be processed.
8. The batch task execution device of claim 7, wherein the concurrency control table includes a plurality of batch tasks and a task name for each of the batch tasks;
the device further comprises:
the first judging unit is used for judging whether the task names of the batch tasks to be processed comprise the task names of the batch tasks to be processed or not; if yes, matching the batch tasks to be processed with the batch tasks in the concurrence control table successfully; if not, the matching of the batch tasks to be processed and the batch tasks in the concurrent control table fails.
9. The batch task execution device of claim 8, further comprising:
the overtime judging unit is used for judging overtime of the batch tasks to be processed;
and the updating unit is used for updating the concurrency control table according to the generated target control number and the batch tasks to be processed and executing the batch tasks to be processed if the batch tasks to be processed are overtime.
10. The batch task execution device of claim 9, wherein the concurrency control table includes a plurality of batch tasks and an execution time of each of the batch tasks;
the overtime judging unit is specifically used for inquiring the execution time of the batch tasks corresponding to the batch tasks to be processed according to the concurrency control table; calculating execution duration according to the execution time and the acquired current time; if the execution duration is greater than a set overtime threshold, the batch tasks to be processed are overtime; and if the execution duration is less than or equal to the overtime threshold, the batch tasks to be processed are not overtime.
11. The batch task execution device of claim 9,
the updating unit is specifically configured to delete a target control record from the concurrence control table, where the target control record is a control record in which a batch task matched with the batch task to be processed is located; and generating a second newly-added control record according to the generated target control number and the batch tasks to be processed.
12. The batch task execution device of claim 7 or 9, further comprising:
the query unit is used for querying a corresponding concurrency control number from the concurrency control table according to the task name of the batch task to be processed;
and the second judgment unit is used for executing the batch tasks to be processed if the concurrent control number is the same as the target control number.
13. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, carries out the batch task execution method according to any one of claims 1 to 6.
14. A computer device comprising a memory for storing information including program instructions and a processor for controlling the execution of the program instructions, wherein the program instructions are loaded and executed by the processor to implement the batch task execution method of any one of claims 1 to 6.
15. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the batch task execution method of any of claims 1 to 6.
CN202210761855.0A 2022-06-30 2022-06-30 Batch task execution method and device Pending CN115167998A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210761855.0A CN115167998A (en) 2022-06-30 2022-06-30 Batch task execution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210761855.0A CN115167998A (en) 2022-06-30 2022-06-30 Batch task execution method and device

Publications (1)

Publication Number Publication Date
CN115167998A true CN115167998A (en) 2022-10-11

Family

ID=83488864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210761855.0A Pending CN115167998A (en) 2022-06-30 2022-06-30 Batch task execution method and device

Country Status (1)

Country Link
CN (1) CN115167998A (en)

Similar Documents

Publication Publication Date Title
CN110287170B (en) Database upgrading method, state data calling method, device and storage medium
CN111240892A (en) Data backup method and device
CN115421764A (en) Method, device, equipment and storage medium for identifying module to be upgraded
CN116954685B (en) Gray scale rolling upgrading method, system, equipment and medium for low-code application system
CN110764930B (en) Request or response processing method and device based on message mode
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
CN111159298A (en) Service request processing method and device, electronic equipment and storage medium
CN115167998A (en) Batch task execution method and device
CN111245940A (en) Method and device for processing mobile communication signal data in communication module of Internet of things
CN115858978A (en) Page loading method and device based on updated resources
CN114691781A (en) Data synchronization method, system, device, equipment and medium
CN113342270A (en) Volume unloading method and device and electronic equipment
CN108763498B (en) User identity identification method and device, electronic equipment and readable storage medium
CN108874625B (en) Information processing method and device, electronic equipment and storage medium
CN113342395A (en) Dependency package management method and device
CN114900531B (en) Data synchronization method, device and system
CN110262756B (en) Method and device for caching data
CN115114244A (en) Method and device for processing uniqueness of service data
CN114650287A (en) Breakpoint continuous making method, device and system of data file
CN115061716A (en) Automatic program script submitting method and device
CN115496612A (en) Asset synchronization method, system and device
CN115665179A (en) Activity query method and device based on distributed cache
CN117950762A (en) Service processing method, device, electronic equipment and storage medium
CN116595110A (en) Data storage method and device, electronic equipment and storage medium
CN112487001A (en) Method and device for processing request

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