CN114637587A - Task batch processing method and device under cluster architecture deployment - Google Patents

Task batch processing method and device under cluster architecture deployment Download PDF

Info

Publication number
CN114637587A
CN114637587A CN202210277661.3A CN202210277661A CN114637587A CN 114637587 A CN114637587 A CN 114637587A CN 202210277661 A CN202210277661 A CN 202210277661A CN 114637587 A CN114637587 A CN 114637587A
Authority
CN
China
Prior art keywords
task
batch
record
control table
starting instruction
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
CN202210277661.3A
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 CN202210277661.3A priority Critical patent/CN114637587A/en
Publication of CN114637587A publication Critical patent/CN114637587A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2033Failover techniques switching over of hardware resources
    • 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

Abstract

The embodiment of the application provides a method and a device for batch processing of tasks under deployment of a cluster architecture, which relate to the field of distribution and comprise the following steps: after a batch task starting instruction is received, judging whether a task record corresponding to the batch task starting instruction exists in an anti-replay control table or not, wherein the task record comprises task execution time information and task execution server information; if not, generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information, adding the task record into the anti-duplication control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is duplicated; the method and the system can effectively support a plurality of servers to execute batch tasks simultaneously, and ensure high availability of the system.

Description

Task batch processing method and device under cluster architecture deployment
Technical Field
The application relates to the field of distribution, in particular to a task batch processing method and device under cluster architecture deployment.
Background
In order to ensure high availability of batch services, the existing production generally uses a dual-server hot-standby HA deployment architecture mode, that is, multiple services all deploy batch applications, but only one of the services is started, if a fault occurs, other servers are automatically invoked to continue to execute batch tasks, the mode needs to consider what scenes to invoke other servers, and if the scenes are not considered completely, the batch program is easily not executed or the batch program is repeatedly invoked to cause production problems.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a task batch processing method and device under the deployment of a cluster architecture, which can effectively support a plurality of servers to execute batch tasks simultaneously, and ensure the high availability of a system.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides a method for batch processing of tasks under deployment of a cluster architecture, including:
after a batch task starting instruction is received, judging whether a task record corresponding to the batch task starting instruction exists in an anti-replay control table or not, wherein the task record comprises task execution time information and task execution server information;
if not, generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information, adding the task record into the anti-duplication control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is duplicated.
Further, after judging whether the task record corresponding to the batch task starting instruction exists in the anti-replay control table, the method includes:
if the task record corresponding to the batch task starting instruction exists in the judging anti-replay control table, judging whether the task record is overtime according to task execution time information in the task record;
if the execution is overtime, deleting the task record from the anti-replay control table, generating a new task record according to the current time information and the current server information, adding the new task record into the anti-replay control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is repeated.
Further, after the executing the corresponding task according to the batch task starting instruction, the method includes:
and after the task is executed, deleting the corresponding task record from the anti-replay control table and updating the anti-replay control table.
Further, after the generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information is added to the anti-replay control table, before the executing the corresponding task according to the batch task starting instruction, the method includes:
judging whether the newly added task record exists in the anti-duplication control table;
if not, judging that the tasks are repeated, and not responding to the batch task starting instruction.
Further, the task record is composed of a task starting execution time, a task execution server IP address and a random factor.
In a second aspect, the present application provides a device for batch processing of tasks under deployment of a cluster architecture, including:
the device comprises a task record judging module, a task re-preventing judging module and a task re-preventing module, wherein the task record judging module is used for judging whether a task record corresponding to a batch task starting instruction exists in a re-preventing control table after the batch task starting instruction is received, and the task record comprises task execution time information and task execution server information;
and the batch execution module is used for generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information and adding the task record into the anti-replay control table if the task record corresponding to the batch task starting instruction does not exist in the anti-replay control table, and executing the corresponding task according to the batch task starting instruction, otherwise, judging that the task is repeated.
Further, the re-judgment prevention module includes:
the overtime judging unit is used for judging whether the task record is overtime according to the task execution time information in the task record if judging that the task record corresponding to the batch task starting instruction exists in the anti-replay control table;
and the overtime execution unit is used for deleting the task record from the anti-replay control table if the execution is overtime, generating a new task record according to the current time information and the current server information, adding the new task record into the anti-replay control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is repeated.
Further, the batch execution module includes:
and the control table updating unit is used for deleting the corresponding task record from the anti-replay control table and updating the anti-replay control table after the task is executed.
Further, the batch execution module includes:
a newly added record checking unit for judging whether the newly added task record exists in the anti-duplication control table;
and the newly-added recorded processing unit is used for judging that the tasks are repeated if the batch task starting instruction does not exist, and does not respond to the batch task starting instruction any more.
Further, still include:
and the task record establishing unit is used for forming a task record according to the task starting execution time, the IP address of the task execution server and the random factor.
In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the task batch processing method deployed in the cluster architecture when executing the program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for batch processing of tasks in a cluster architecture deployment.
In a fifth aspect, the present application provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method for batch processing of tasks in a cluster architecture deployment.
According to the technical scheme, the method and the device for task batch processing under the deployment of the cluster architecture are characterized in that the anti-replay control table is arranged, when the batch tasks are executed, whether the task records of the current tasks exist in the anti-replay control table is judged, if the task records exist, the task records are not executed, and if the task records do not exist, the new task records are generated and inserted into the anti-replay control table, so that the batch tasks can be started by a plurality of servers at the same time and cannot be executed repeatedly, the batch tasks can be effectively executed by the plurality of servers at the same time, and the high availability of the system is guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is one of flow diagrams illustrating a task batch processing method under deployment of a cluster architecture in an embodiment of the present application;
FIG. 2 is a second flowchart illustrating a task batch processing method under the deployment of the cluster architecture in the embodiment of the present application;
FIG. 3 is a third flowchart illustrating a task batch processing method under the deployment of a cluster architecture in an embodiment of the present application;
FIG. 4 is a block diagram of a task batch processing device deployed in a cluster architecture according to an embodiment of the present application;
FIG. 5 is a second block diagram of a task batch processing device deployed in a cluster architecture according to an embodiment of the present application;
FIG. 6 is a third block diagram of a task batch processing apparatus deployed in a cluster architecture according to an embodiment of the present application;
FIG. 7 is a fourth block diagram of a task batch processing apparatus deployed in a cluster architecture according to an embodiment of the present application;
fig. 8 is a flowchart illustrating a task batch processing method under the deployment of a cluster architecture according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
In view of the problem that the existing dual-server hot-standby HA is easy to repeatedly execute when deploying and processing batch tasks, the application provides a task batch processing method and device under cluster architecture deployment, by setting a anti-replay control table, when the batch tasks are executed, whether a task record of a current task exists in the anti-replay control table is judged firstly, if the task record exists, the task record is not executed, and if the task record does not exist, a new task record is generated and inserted into the anti-replay control table, so that a plurality of servers can be ensured to simultaneously start the batch tasks and not repeatedly execute, and thus the batch tasks can be effectively executed by the plurality of servers, and the high availability of the system is ensured.
In order to effectively support multiple servers to execute batch tasks simultaneously and ensure high availability of a system, the present application provides an embodiment of a task batch processing method deployed in a cluster architecture, and referring to fig. 1, the task batch processing method deployed in the cluster architecture specifically includes the following contents:
step S101: after receiving a batch task starting instruction, judging whether a task record corresponding to the batch task starting instruction exists in a anti-replay control table, wherein the task record comprises task execution time information and task execution server information.
Optionally, in the deployment of the cluster architecture, after a server receives a batch task invoking instruction, it may be determined whether a task record corresponding to the batch task invoking instruction exists in the anti-replay control table.
Optionally, the anti-replay control table includes task records, where the task records correspond to the batch task starting instructions, that is, the task records correspond to each task.
Optionally, the task record includes task execution time information and task execution server information, where the task execution time information may be system time when a task starts to be processed, and the task execution server information may be physical information of a server that executes the task, such as an IP address, a network field, and the like.
Step S102: if not, generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information, adding the task record into the anti-duplication control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is duplicated.
Optionally, if the task record corresponding to the batch task starting instruction does not exist in the anti-replay control table, it indicates that the current task to be processed is not executed by other servers, and the current server may execute the task without causing repeated execution of the task.
Optionally, before actually executing the task, the current server may generate a task record corresponding to the batch task starting instruction according to the current time information and the current server information, and add the task record to the anti-replay control table.
Similarly, if the task record corresponding to the batch task starting instruction already exists in the anti-replay control table, it is indicated that the current task to be processed is executed by other servers, and the current server does not execute the task any more, so that the task is prevented from being executed repeatedly.
As can be seen from the above description, the task batch processing method deployed in the cluster architecture provided in the embodiment of the present application can determine whether a task record of a current task exists in the anti-replay control table by setting the anti-replay control table, if so, the anti-replay control table is not executed, and if not, a new task record is generated and inserted into the anti-replay control table, so that multiple servers can start batch tasks at the same time and the batch tasks are not repeatedly executed, thereby effectively supporting multiple servers to execute batch tasks at the same time, and ensuring high availability of the system.
In order to timely process the overtime task, in an embodiment of the task batch processing method deployed in the cluster architecture of the present application, referring to fig. 2, after the step S101, the following may be further included:
step S201: and if the task record corresponding to the batch task starting instruction exists in the judging anti-replay control table, judging whether the task record is overtime according to the task execution time information in the task record.
Step S202: if the execution is overtime, deleting the task record from the anti-replay control table, generating a new task record according to the current time information and the current server information, adding the new task record into the anti-replay control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is repeated.
Optionally, after the current server determines that the task record corresponding to the batch task starting instruction exists in the duplication prevention control table, the task does not mean that the task is executed by other servers, and a situation that other servers cannot actually process the task due to delay of some reasons after the task record is newly added may exist, and at this time, according to the task execution time information in the task record, the application may determine whether the task record is executed overtime.
Optionally, after the execution time is determined to be overtime, the application may delete the task record from the anti-replay control table, and generate a new task record according to the current time information and the current server information, and add the new task record to the anti-replay control table, which indicates that the task is executed by the current server instead, so as to execute the corresponding task according to the batch task invoking instruction.
Similarly, if the execution is not overtime, the task is determined to be repeated, and the current server does not process the task any more.
In order to avoid repeated execution of tasks, in an embodiment of the task batch processing method deployed in the cluster architecture of the present application, after the step S102, the following may be further included:
and after the task is executed, deleting the corresponding task record from the anti-replay control table and updating the anti-replay control table.
In order to accurately ensure that the tasks are not repeatedly executed, in an embodiment of the task batch processing method deployed in the cluster architecture of the present application, referring to fig. 3, in step S102, the following may be specifically included:
step S301: and judging whether the newly added task record exists in the anti-duplication control table.
Step S302: if not, judging that the tasks are repeated, and not responding to the batch task starting instruction.
Optionally, after a new task record is added to the anti-replay control table by the current server, before the current server actually executes the task, the current server may further go to the anti-replay control table to query the new task record once, at this time, there may be a case that the current server fails to actually process the task due to delay for some reasons, which may cause task execution timeout.
In order to avoid repeated execution of tasks, in an embodiment of the task batch processing method deployed in the cluster architecture of the present application, the following may be further specifically included:
the task record is composed of task starting execution time, a task execution server IP address and a random factor.
Optionally, the task record is, for example, an anti-recoding 20210616134611201444749107, where 20210616134611201 is when the task starts executing, 444749 is a 6-bit random factor, and 107 is the last segment of the current server IP address 22.11.148.107.
In order to effectively support multiple servers to execute batch tasks simultaneously and ensure high availability of the system, the present application provides an embodiment of a task batch processing apparatus deployed under a cluster architecture, for implementing all or part of contents of a task batch processing method deployed under the cluster architecture, and with reference to fig. 4, the task batch processing apparatus deployed under the cluster architecture specifically includes the following contents:
the anti-duplication judgment module 10 is configured to judge whether a task record corresponding to a batch task starting instruction exists in an anti-duplication control table after the batch task starting instruction is received, where the task record includes task execution time information and task execution server information.
And the batch execution module 20 is configured to generate a task record corresponding to the batch task starting instruction according to the current time information and the current server information and add the task record to the anti-replay control table if the task record corresponding to the batch task starting instruction does not exist in the anti-replay control table, and execute the corresponding task according to the batch task starting instruction, otherwise, determine that the task is repeated.
As can be seen from the above description, the task batch processing apparatus deployed in a cluster architecture according to the embodiment of the present application can determine, by setting the anti-replay control table, whether a task record of a current task exists in the anti-replay control table when a batch task is executed, if the task record exists, the task is not executed, and if the task record does not exist, a new task record is generated and inserted into the anti-replay control table, so that a plurality of servers can start the batch task at the same time and cannot execute repeatedly, thereby effectively supporting the plurality of servers to execute the batch task at the same time, and ensuring high availability of the system.
In order to process the overtime task in time, in an embodiment of the task batch processing apparatus deployed in the cluster architecture of the present application, referring to fig. 5, the duplication prevention determining module 10 includes:
and the overtime judging unit 11 is configured to judge whether the task record is overtime according to the task execution time information in the task record if it is judged that the task record corresponding to the batch task starting instruction exists in the anti-replay control table.
And the overtime execution unit 12 is configured to delete the task record from the anti-replay control table if the execution is overtime, generate a new task record according to the current time information and the current server information, add the new task record to the anti-replay control table, execute the corresponding task according to the batch task starting instruction, and otherwise, determine that the task is repeated.
In order to avoid repeated task execution, in an embodiment of the task batch processing apparatus deployed in the cluster architecture of the present application, referring to fig. 6, the batch execution module 20 includes:
a control table updating unit 21, configured to delete the corresponding task record from the anti-replay control table and update the anti-replay control table after the task is executed.
In order to accurately ensure that the tasks are not repeatedly executed, in an embodiment of the task batch processing apparatus deployed in the cluster architecture of the present application, referring to fig. 7, the batch execution module 20 includes:
and a newly added record checking unit 22 for judging whether the newly added task record exists in the anti-duplication control table.
And a newly-added record processed unit 23, configured to determine that the task is repeated if the batch task does not exist, and not respond to the batch task starting instruction.
In order to avoid repeated execution of tasks, an embodiment of the task batch processing device deployed in the cluster architecture of the present application further includes the following contents:
and the task record establishing unit is used for forming a task record according to the task starting execution time, the IP address of the task execution server and the random factor.
To further illustrate the present solution, the present application further provides a specific application example of implementing a task batch processing method under cluster architecture deployment by applying the task batch processing apparatus under cluster architecture deployment, which is shown in fig. 8 and specifically includes the following contents:
1. when the batch tasks are called up and executed, a control table is inquired, and whether the current tasks have the existing anti-replay records or not is checked.
2. If the anti-replay record of the current task exists, judging whether the record is overtime or not, if the record is overtime, deleting the anti-replay record, and inserting the anti-replay record generated by the current server; if not, the current server does not take the execution right of the current task, records the log and ends the task. And if the anti-replay record of the current task does not exist, inserting the anti-replay record generated by the current server.
3. And querying the control table again, and judging the anti-renumbering of the anti-renumbering record in the control table to be consistent with the anti-renumbering generated by the server.
4. And if the anti-renumbering is consistent, the current server takes the execution right of the current task and executes the task. If the current task is inconsistent with the current task, the current server does not take the execution right of the current task, logs are recorded, and the task is ended.
5. And (4) completing the task execution and deleting the anti-rerecording in the control table.
According to the method and the system, the anti-replay control table is arranged, so that a plurality of servers can execute batch tasks at the same time, the problem of HA switching is solved, and the high availability of the services is ensured.
In order to effectively support multiple servers to execute batch tasks simultaneously and ensure high availability of the system, the present application provides an embodiment of an electronic device for implementing all or part of the contents in the task batch processing method deployed in the cluster architecture, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the task batch processing device under the deployment of the cluster architecture and relevant equipment such as a core service system, a user terminal, a relevant database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the logic controller may refer to an embodiment of a task batch processing method deployed under a cluster architecture and an embodiment of a task batch processing apparatus deployed under a cluster architecture in the embodiment for implementation, and the contents of the embodiments are incorporated herein, and repeated details are not repeated here.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the task batch processing method deployed in the cluster architecture may be executed on the electronic device side as described in the above, or all operations may be completed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 9 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 9, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 9 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In an embodiment, the function of the task batch processing method deployed in the cluster architecture may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
step S101: after receiving a batch task starting instruction, judging whether a task record corresponding to the batch task starting instruction exists in a anti-replay control table, wherein the task record comprises task execution time information and task execution server information.
Step S102: if not, generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information, adding the task record into the anti-duplication control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is duplicated.
As can be seen from the above description, in the electronic device provided in the embodiment of the present application, by setting the anti-replay control table, when a batch task is executed, it is first determined whether a task record of a current task exists in the anti-replay control table, if the task record exists, the task record is not executed, and if the task record does not exist, a new task record is generated and inserted into the anti-replay control table, so that a plurality of servers can start the batch task at the same time and the batch task is not repeatedly executed, thereby effectively supporting the plurality of servers to execute the batch task at the same time, and ensuring high availability of the system.
In another embodiment, the task batch processing apparatus deployed under the cluster architecture may be configured separately from the central processor 9100, for example, the task batch processing apparatus deployed under the cluster architecture may be configured as a chip connected to the central processor 9100, and the function of the task batch processing method deployed under the cluster architecture is realized through the control of the central processor.
As shown in fig. 9, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 9; in addition, the electronic device 9600 may further include components not shown in fig. 9, which may be referred to in the prior art.
As shown in fig. 9, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all steps in the task batch processing method deployed by the cluster architecture in which the execution subject is the server or the client in the foregoing embodiment, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all steps of the task batch processing method deployed by the cluster architecture in which the execution subject is the server or the client, for example, when the processor executes the computer program, the processor implements the following steps:
step S101: after receiving a batch task starting instruction, judging whether a task record corresponding to the batch task starting instruction exists in a anti-replay control table, wherein the task record comprises task execution time information and task execution server information.
Step S102: if not, generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information, adding the task record into the anti-duplication control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is duplicated.
As can be seen from the above description, the computer-readable storage medium provided in this embodiment of the present application, through setting the anti-replay control table, when a batch task is executed, first determines whether a task record of a current task exists in the anti-replay control table, if so, does not execute the task record, and if not, generates a new task record and inserts the new task record into the anti-replay control table, thereby ensuring that multiple servers can start the batch task at the same time and do not execute the batch task repeatedly, thereby effectively supporting multiple servers to execute the batch task at the same time, and ensuring high availability of the system.
An embodiment of the present application further provides a computer program product capable of implementing all steps in the task batch processing method deployed under the cluster architecture in which an execution subject in the foregoing embodiment is a server or a client, where the computer program/instruction is executed by a processor to implement the steps of the task batch processing method deployed under the cluster architecture, for example, the computer program/instruction implements the following steps:
step S101: after receiving a batch task starting instruction, judging whether a task record corresponding to the batch task starting instruction exists in a anti-replay control table, wherein the task record comprises task execution time information and task execution server information.
Step S102: if not, generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information, adding the task record into the anti-duplication control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is duplicated.
As can be seen from the above description, in the computer program product provided in the embodiment of the present application, by setting the anti-replay control table, when a batch task is executed, it is first determined whether a task record of a current task exists in the anti-replay control table, if the task record exists, the task record is not executed, and if the task record does not exist, a new task record is generated and inserted into the anti-replay control table, so that a plurality of servers can start the batch task at the same time and the batch task is not executed repeatedly, thereby effectively supporting the plurality of servers to execute the batch task at the same time, and ensuring high availability of the system.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, 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 (devices), 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 principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (13)

1. A task batch processing method under deployment of a cluster architecture is characterized by comprising the following steps:
after a batch task starting instruction is received, judging whether a task record corresponding to the batch task starting instruction exists in an anti-replay control table or not, wherein the task record comprises task execution time information and task execution server information;
if not, generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information, adding the task record into the anti-duplication control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is duplicated.
2. The method according to claim 1, wherein after determining whether the task record corresponding to the batch task invocation instruction exists in the anti-replay control table, the method comprises:
if the task record corresponding to the batch task starting instruction exists in the judging anti-replay control table, judging whether the task record is overtime according to task execution time information in the task record;
if the execution is overtime, deleting the task record from the anti-replay control table, generating a new task record according to the current time information and the current server information, adding the new task record into the anti-replay control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is repeated.
3. The method for batch processing of tasks deployed under a cluster architecture according to claim 1, wherein after the execution of the corresponding tasks according to the batch task invocation instruction, the method comprises:
and after the task is executed, deleting the corresponding task record from the anti-replay control table and updating the anti-replay control table.
4. The method according to claim 3, wherein after the task record corresponding to the batch task invoking instruction is generated according to the current time information and the current server information and added to the anti-replay control table, before the corresponding task is executed according to the batch task invoking instruction, the method comprises:
judging whether the newly added task record exists in the anti-duplication control table;
if not, judging that the tasks are repeated, and not responding to the batch task starting instruction.
5. The method according to claim 1, wherein the task record comprises a task start execution time, a task execution server IP address, and a random factor.
6. A task batch processing device under deployment of a cluster architecture is characterized by comprising:
the device comprises a task record judging module, a task re-preventing judging module and a task re-preventing module, wherein the task record judging module is used for judging whether a task record corresponding to a batch task starting instruction exists in a re-preventing control table after the batch task starting instruction is received, and the task record comprises task execution time information and task execution server information;
and the batch execution module is used for generating a task record corresponding to the batch task starting instruction according to the current time information and the current server information and adding the task record into the anti-replay control table if the task record corresponding to the batch task starting instruction does not exist in the anti-replay control table, and executing the corresponding task according to the batch task starting instruction, otherwise, judging that the task is repeated.
7. The apparatus for task batch processing under deployment of cluster architecture according to claim 6, wherein the re-judgment prevention module comprises:
the overtime judging unit is used for judging whether the task record is overtime according to the task execution time information in the task record if judging that the task record corresponding to the batch task starting instruction exists in the anti-replay control table;
and the overtime execution unit is used for deleting the task record from the anti-replay control table if the execution is overtime, generating a new task record according to the current time information and the current server information, adding the new task record into the anti-replay control table, executing the corresponding task according to the batch task starting instruction, and otherwise, judging that the task is repeated.
8. The apparatus for task batch processing deployed in cluster architecture of claim 6, wherein the batch execution module comprises:
and the control table updating unit is used for deleting the corresponding task record from the anti-replay control table and updating the anti-replay control table after the task is executed.
9. The apparatus for task batch processing deployed in cluster architecture of claim 8, wherein the batch execution module comprises:
a newly added record checking unit for judging whether the newly added task record exists in the anti-duplication control table;
and the newly-added recorded processing unit is used for judging that the tasks are repeated if the batch task starting instruction does not exist, and does not respond to the batch task starting instruction any more.
10. The apparatus for task batching under cluster architecture deployment as claimed in claim 6, further comprising:
and the task record establishing unit is used for forming a task record according to the task starting execution time, the IP address of the task execution server and the random factor.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method for batch processing of tasks deployed in a cluster architecture according to any one of claims 1 to 5 when executing the program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a method for batch processing of tasks as deployed in a cluster architecture according to any one of claims 1 to 5.
13. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the steps of a method for batch processing of tasks under a cluster architecture deployment according to any of claims 1 to 5.
CN202210277661.3A 2022-03-21 2022-03-21 Task batch processing method and device under cluster architecture deployment Pending CN114637587A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210277661.3A CN114637587A (en) 2022-03-21 2022-03-21 Task batch processing method and device under cluster architecture deployment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210277661.3A CN114637587A (en) 2022-03-21 2022-03-21 Task batch processing method and device under cluster architecture deployment

Publications (1)

Publication Number Publication Date
CN114637587A true CN114637587A (en) 2022-06-17

Family

ID=81950731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210277661.3A Pending CN114637587A (en) 2022-03-21 2022-03-21 Task batch processing method and device under cluster architecture deployment

Country Status (1)

Country Link
CN (1) CN114637587A (en)

Similar Documents

Publication Publication Date Title
CN111786885B (en) Distributed full-link gray level routing method and device
CN111031058A (en) Websocket-based distributed server cluster interaction method and device
CN110908875B (en) Inspection method and device based on operation terminal
CN110764881A (en) Distributed system background retry method and device
CN112953908A (en) Network isolation configuration method, device and system
CN111679790A (en) Remote software development storage space distribution method and device
CN111445331A (en) Transaction matching method and device
CN111367561B (en) Remote development method and device for software program
CN113342330A (en) Front-end engineering generation method and device
CN111338905A (en) Application node data processing method and device
CN112689012A (en) Cross-network proxy communication method and device
CN111767558A (en) Data access monitoring method, device and system
CN115562898A (en) Distributed payment system exception handling method and device
CN113452776B (en) PaaS platform service scheduling method and device and PaaS platform
CN111930624B (en) Test link message data processing method and device
CN116185755A (en) Data processing method and device for distributed load balancing system
CN114637587A (en) Task batch processing method and device under cluster architecture deployment
CN114374614A (en) Network topology configuration method and device
CN112559158A (en) Micro-service timing task scheduling method and device
CN114697339A (en) Load balancing method and device under centralized architecture
CN114416212A (en) Mobile terminal application program data resource processing method and device
CN113434423A (en) Interface test method and device
CN113050985A (en) Front-end engineering dependence automatic registration method and device
CN113377385A (en) Client automatic deployment method and device
CN111953847A (en) Client message risk reminding method, device and system

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