CN115168003A - Timed task processing method and device for cluster server - Google Patents

Timed task processing method and device for cluster server Download PDF

Info

Publication number
CN115168003A
CN115168003A CN202210779123.4A CN202210779123A CN115168003A CN 115168003 A CN115168003 A CN 115168003A CN 202210779123 A CN202210779123 A CN 202210779123A CN 115168003 A CN115168003 A CN 115168003A
Authority
CN
China
Prior art keywords
task
execution
timing
identifier
server
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
CN202210779123.4A
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 CN202210779123.4A priority Critical patent/CN115168003A/en
Publication of CN115168003A publication Critical patent/CN115168003A/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/2358Change logging, detection, and notification
    • 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 invention provides a method and a device for processing a timing task of a cluster server, and relates to the technical field of distribution. The method comprises the following steps: accessing a database at regular time to obtain a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; and if the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed, updating the task execution state included by the timed task information in the timed task list in the database into the task in execution and executing the timed task corresponding to the task identifier. The device is used for executing the method. The method and the device for processing the timing task of the cluster server provided by the embodiment of the invention improve the reliability of the execution of the timing task.

Description

Timed task processing method and device for cluster server
Technical Field
The invention relates to the field of distributed technology, in particular to a method and a device for processing a timing task of a cluster server.
Background
Due to the characteristics of strong expansion capability, high availability and the like, the cluster server becomes one of solutions for large application platform server deployment.
In the prior art, cluster servers are used for executing timing tasks, and when the timing tasks are deployed, each cluster server deploys the timing tasks uniformly, so that the same timing tasks are repeatedly executed. Therefore, how to provide a method for processing a timing task of a cluster server to avoid repeated execution of the timing task becomes an important problem to be solved urgently in the field.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for processing a timing task of a cluster server, which can at least partially solve the problems in the prior art.
In a first aspect, the present invention provides a method for processing a timed task of a cluster server, including:
accessing a database at regular time to obtain a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state;
and if the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed, updating the task execution state included by the timed task information in the timed task list in the database into the executed timed task and executing the timed task corresponding to the task identifier.
Further, the method for processing the timing task of the cluster server provided by the embodiment of the present invention further includes:
and after the timing task is executed, accessing the database to update the task execution state corresponding to the timing task in the timing task list to be unexecuted.
Further, the method for processing the timing task of the cluster server provided by the embodiment of the present invention further includes:
and if the task execution state is judged and known to be in execution, the timing task corresponding to the task identifier is not executed.
Further, the method for processing the timing task of the cluster server provided by the embodiment of the present invention further includes:
and if the execution server identifier included in the timing task information is judged and acquired to be not matched with the local identifier, the timing task corresponding to the task identifier is not executed.
Further, the execution server identification is an IP address of the server or a server identification.
In a second aspect, the present invention provides a device for processing a timed task of a cluster server, including:
the acquisition unit is used for accessing the database at regular time and acquiring a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state;
and the first judging unit is used for updating the task execution state included by the timed task information in the timed task list in the database into execution and executing the timed task corresponding to the task identifier after judging that the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed.
Further, the device for processing a timed task of a cluster server provided in the embodiment of the present invention further includes:
and the updating unit is used for accessing the database to update the task execution state corresponding to the timing task in the timing task list to be unexecuted after the timing task is executed and completed.
Further, the device for processing a timed task of a cluster server provided in the embodiment of the present invention further includes:
and the second judging unit is used for not executing the timing task corresponding to the task identifier after judging that the task execution state is in execution.
Further, the device for processing a timed task of a cluster server provided in the embodiment of the present invention further includes:
and the third judging unit is used for not executing the timing task corresponding to the task identifier after judging and knowing that the execution server identifier included in the timing task information is not matched with the local identifier.
Further, the execution server identification is an IP address of the server or a server identification.
In a third aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the method for processing the timed task of the cluster server according to any of the above embodiments.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method for processing the timed task of the cluster server according to any of the above embodiments.
In a fifth aspect, the present invention provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the method for processing the timed task of the cluster server according to any of the above embodiments.
The method and the device for processing the timing task of the cluster server can access the database at regular time and acquire the timing task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; if the task execution time included by the timing task information is matched with the current time, the execution server identifier included by the timing task information is matched with the local identifier, and the task execution state is not executed, the task execution state included by the timing task information in the timing task list in the database is updated to be in execution and the timing task corresponding to the task identifier is executed, the executed timing task is locked through the task execution state, the timing task is prevented from being executed repeatedly, and the reliability of the timing task execution is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic flowchart of a method for processing a timing task of a cluster server according to a first embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a timed task processing device of a cluster server according to a second embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a timed task processing device of a cluster server according to a third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a timed task processing device of a cluster server according to a fourth embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a timed task processing apparatus of a cluster server according to a fifth embodiment of the present invention.
Fig. 6 is a schematic physical structure diagram of a computer device according to a sixth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
In order to facilitate understanding of the technical solutions provided in the present application, the following first describes relevant contents of the technical solutions in the present application.
Cluster server: it means that many servers are collected together to perform the same service, and it looks like only one server to the client. The cluster server can utilize a plurality of servers for mutual standby, so that when one or a plurality of servers fail, the cluster server can also provide services for the outside or perform tasks normally.
The following describes a specific implementation process of the method for processing a timing task of a cluster server according to an embodiment of the present invention, by taking a server as an execution subject. Any one of the cluster servers may execute the method for processing the timing task of the cluster server provided by the embodiment of the present invention.
Fig. 1 is a schematic flowchart of a method for processing a timing task of a cluster server according to a first embodiment of the present invention, and as shown in fig. 1, the method for processing a timing task of a cluster server according to the embodiment of the present invention includes:
s101, accessing a database at regular time to obtain a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state;
specifically, a timing task table is preset and stored in a database, the timing task table stores timing task information, and each server in the cluster servers accesses the timing task table. The server can access the database at regular time to obtain a regular task list. The timing task information may include a task identifier, a task execution time, at least one execution server identifier, and a task execution state. The timing tasks correspond to the task identifiers one to one; the task execution time refers to the time for starting a timing task; the execution server identification corresponds to the server one by one and is used for indicating that the timing task can be executed on the server corresponding to the execution server identification; the task execution states can be divided into two types of non-execution and execution, wherein the non-execution indicates that no server executes the timing task currently, and the execution summary indicates that the server executes the timing task currently.
It can be understood that the executing server identifier included in the timing task information may be set to correspond to all the servers in the cluster server, so that any one of the servers in the cluster server may execute the timing task.
And S102, if it is judged that the task execution time included in the timed task information is matched with the current time, the execution server identifier included in the timed task information is matched with the local identifier, and the task execution state is not executed, updating the task execution state included in the timed task information in the timed task list in the database into the execution state and executing the timed task corresponding to the task identifier.
Specifically, after obtaining the timed task list, the server compares the current time with the task execution time included in the timed task information, compares an execution server identifier included in the timed task information with a local identifier, and obtains the task execution state, if the current time matches the task execution time included in the timed task information, the execution server identifier included in the timed task information includes the local identifier, and the task execution state is not executed, which indicates that the timed task corresponding to the task identifier included in the timed task information has reached the time for starting execution and has not been executed by the server, and the server is a server capable of executing the timed task corresponding to the task identifier included in the timed task information, and then the server accesses the database, changes the task execution state included in the timed task information from not executed to being executed, and executes the timed task corresponding to the task identifier.
For example, if the time difference between the current time and the task execution time is less than a preset value, the current time matches the task execution time. The preset value is set according to actual experience, and the embodiment of the invention is not limited.
For example, the executing server identification adopts an IP address, the timing task information comprises 100 IP addresses, the server compares the local IP address with the 100 IP addresses comprised by the timing task information one by one, and if the 100 IP addresses have the same IP address as the local IP address, the IP earthquake comprised by the timing task information is matched with the local IP address.
The timing task processing method of the cluster server provided by the embodiment of the invention can access the database at regular time and acquire the timing task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; if the task execution time included by the timed task information is matched with the current time, the execution server identification included by the timed task information is matched with the local identification and the task execution state is not executed, the task execution state included by the timed task information in the timed task list in the database is updated to be in execution and the timed task corresponding to the task identification is executed, the executed timed task is locked through the task execution state, the timed task is prevented from being executed repeatedly, and the reliability of the execution of the timed task is improved.
On the basis of the foregoing embodiments, further, the method for processing a timing task of a cluster server according to an embodiment of the present invention further includes:
and after the timing task is executed, accessing the database to update the task execution state corresponding to the timing task in the timing task list to be unexecuted.
Specifically, after the server executes the timing task, the server accesses the database, queries timing task information corresponding to the timing task from a timing task list according to a task identifier corresponding to the timing task, and updates a task execution state included in the timing task information from execution to non-execution.
On the basis of the foregoing embodiments, further, the method for processing a timing task of a cluster server according to an embodiment of the present invention further includes:
and if the task execution state is judged to be in execution, the timing task corresponding to the task identifier is not executed.
Specifically, the server obtains a task execution state included in the timing task information, and if the task execution state is in execution, it indicates that the timing task corresponding to the timing task information is already executed, and the server does not execute the timing task corresponding to the task identifier included in the timing task information any more.
On the basis of the foregoing embodiments, further, the method for processing a timing task of a cluster server according to an embodiment of the present invention further includes:
and if the execution server identifier included in the timing task information is judged to be not matched with the local identifier, the timing task corresponding to the task identifier is not executed.
Specifically, the server compares an executing server identifier included in the timing task information with a local identifier, and if the executing server identifier included in the timing task information does not include the local identifier, it indicates that the server is not a server for executing the timing task corresponding to the timing task information, the server does not execute the timing task corresponding to the task identifier included in the timing task information.
For example, the executing server identifier is a server identifier, the timing task information includes 200 server identifiers, the server compares the local server identifiers with the 200 server identifiers one by one, and if the 200 server identifiers do not include a local server identifier, it indicates that the server is not a server for executing the timing task corresponding to the timing task information, and the server does not execute the timing task corresponding to the timing task information.
On the basis of the foregoing embodiments, further, the method for processing a timing task of a cluster server according to an embodiment of the present invention further includes:
and if the task execution time included in the timing task information is judged and obtained to be not matched with the current time, the timing task corresponding to the task identifier is not executed.
On the basis of the foregoing embodiments, further, the execution server identifier is an IP address of a server or a server identifier. Each server in the server cluster has a unique corresponding IP address and a unique corresponding server identification.
The method for processing the timing task of the cluster server provided by the embodiment of the invention runs the timing task by using the shared locking transaction management mechanism of the database, judges whether any server is executing the timing task according to the task execution state on the premise of cluster deployment, can ensure that the timing task is not repeatedly executed, and executes the timing task as long as one server in the cluster server is normal, thereby ensuring that the execution of the timing task is not influenced when a part of servers are down.
Fig. 2 is a schematic structural diagram of a timed task processing apparatus of a cluster server according to a second embodiment of the present invention, and as shown in fig. 2, the timed task processing apparatus of the cluster server according to the embodiment of the present invention includes an obtaining unit 201 and a first determining unit 202, where:
the acquiring unit 201 is configured to access a database at regular time and acquire a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; the first determining unit 202 is configured to update the task execution state included in the timed task information in the timed task list in the database to be in execution and execute the timed task corresponding to the task identifier after it is determined that the task execution time included in the timed task information matches the current time, the execution server identifier included in the timed task information matches the local identifier, and the task execution state is not in execution.
Specifically, the obtaining unit 201 accesses the database at regular time to obtain the regular task list. The timing task information may include a task identifier, a task execution time, at least one execution server identifier, and a task execution state. The timing tasks correspond to the task identifiers one to one; the task execution time refers to the time for starting a timing task; the execution server identification corresponds to the server one by one and is used for indicating that the timing task can be executed on the server corresponding to the execution server identification; the task execution state can be divided into two types of non-execution and execution, wherein the non-execution indicates that no server executes the timing task currently, and the execution summary indicates that the server executes the timing task currently.
After obtaining the timed task list, the first determining unit 202 compares the current time with the task execution time included in the timed task information, compares the execution server identifier included in the timed task information with the local identifier, and obtains the task execution state, and if the current time matches the task execution time included in the timed task information, the execution server identifier included in the timed task information includes the local identifier, and the task execution state is not executed, the first determining unit 202 accesses the database, changes the task execution state included in the timed task information from not executed to executed, and executes the timed task corresponding to the task identifier.
The timing task processing device of the cluster server provided by the embodiment of the invention can access the database at regular time and acquire the timing task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; if the task execution time included by the timing task information is matched with the current time, the execution server identifier included by the timing task information is matched with the local identifier, and the task execution state is not executed, the task execution state included by the timing task information in the timing task list in the database is updated to be in execution and the timing task corresponding to the task identifier is executed, the executed timing task is locked through the task execution state, the timing task is prevented from being executed repeatedly, and the reliability of the timing task execution is improved.
Fig. 3 is a schematic structural diagram of a timing task processing device of a cluster server according to a third embodiment of the present invention, and as shown in fig. 3, on the basis of the foregoing embodiments, further, the timing task processing device of the cluster server according to the embodiment of the present invention further includes an updating unit 203, where:
the updating unit 203 is configured to, after the timed task is executed and completed, access the database to update the task execution state corresponding to the timed task in the timed task list to be unexecuted.
Fig. 4 is a schematic structural diagram of a timed task processing apparatus of a cluster server according to a fourth embodiment of the present invention, and as shown in fig. 4, on the basis of the foregoing embodiments, further, the timed task processing apparatus of the cluster server according to the embodiment of the present invention further includes a second determining unit 204, where:
the second determining unit 204 is configured to not execute the timing task corresponding to the task identifier after determining that the task execution state is in execution.
Fig. 5 is a schematic structural diagram of a timing task processing device of a cluster server according to a fifth embodiment of the present invention, and as shown in fig. 5, on the basis of the foregoing embodiments, the timing task processing device of the cluster server according to the embodiment of the present invention further includes:
the third determining unit 205 is configured to not execute the timing task corresponding to the task identifier after determining that the execution server identifier included in the timing task information is not matched with the local identifier.
On the basis of the foregoing embodiments, further, the execution server identifier is an IP address of the server or a server identifier.
The embodiment of the apparatus provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the apparatus are not described herein again, and refer to the detailed description of the above method embodiments.
It should be noted that the method and the apparatus for processing the timing task of the cluster server provided in the embodiment of the present invention may be used in the financial field, and may also be used in any technical field other than the financial field.
Fig. 6 is a schematic physical structure diagram of a computer device according to a sixth embodiment of the present invention, and as shown in fig. 6, the computer device may include: a processor (processor) 601, a communication Interface (Communications Interface) 602, a memory (memory) 603 and a communication bus 604, wherein the processor 601, the communication Interface 602 and the memory 603 complete communication with each other through the communication bus 604. The processor 601 may call logic instructions in the memory 603 to perform the following method: accessing a database at regular time to obtain a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; and if the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed, updating the task execution state included by the timed task information in the timed task list in the database into the execution state and executing the timed task corresponding to the task identifier.
In addition, the logic instructions in the memory 603 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above method embodiments, for example, including: accessing a database at regular time to obtain a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; and if the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed, updating the task execution state included by the timed task information in the timed task list in the database into the executed timed task and executing the timed task corresponding to the task identifier.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes: accessing a database at regular time to obtain a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state; and if the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed, updating the task execution state included by the timed task information in the timed task list in the database into the executed timed task and executing the timed task corresponding to the task identifier.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention 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.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (13)

1. A method for processing a timing task of a cluster server is characterized by comprising the following steps:
accessing a database at regular time to obtain a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state;
and if the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed, updating the task execution state included by the timed task information in the timed task list in the database into the executed timed task and executing the timed task corresponding to the task identifier.
2. The method of claim 1, further comprising:
and after the timing task is executed, accessing the database to update the task execution state corresponding to the timing task in the timing task list to be unexecuted.
3. The method of claim 1, further comprising:
and if the task execution state is judged and known to be in execution, the timing task corresponding to the task identifier is not executed.
4. The method of claim 1, further comprising:
and if the execution server identifier included in the timing task information is judged to be not matched with the local identifier, the timing task corresponding to the task identifier is not executed.
5. The method according to any of claims 1 to 4, wherein the execution server identification is an IP address of a server or a server identification.
6. A timed task processing apparatus for a cluster server, comprising:
the acquisition unit is used for accessing the database at regular time and acquiring a regular task list; the timing task list is preset and comprises at least one piece of timing task information, and the timing task information comprises a task identifier, a task execution time, at least one execution server identifier and a task execution state;
and the first judging unit is used for updating the task execution state included by the timed task information in the timed task list in the database into execution and executing the timed task corresponding to the task identifier after judging that the task execution time included by the timed task information is matched with the current time, the execution server identifier included by the timed task information is matched with the local identifier and the task execution state is not executed.
7. The apparatus of claim 6, further comprising:
and the updating unit is used for accessing the database to update the task execution state corresponding to the timing task in the timing task list to be unexecuted after the timing task is executed and completed.
8. The apparatus of claim 6, further comprising:
and the second judging unit is used for not executing the timing task corresponding to the task identifier after judging and knowing that the task execution state is in execution.
9. The apparatus of claim 6, further comprising:
and the third judging unit is used for not executing the timing task corresponding to the task identifier after judging and knowing that the execution server identifier included in the timing task information is not matched with the local identifier.
10. The apparatus according to any of claims 6 to 9, wherein the execution server identification is an IP address of a server or a server identification.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 5.
13. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1 to 5.
CN202210779123.4A 2022-07-04 2022-07-04 Timed task processing method and device for cluster server Pending CN115168003A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210779123.4A CN115168003A (en) 2022-07-04 2022-07-04 Timed task processing method and device for cluster server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210779123.4A CN115168003A (en) 2022-07-04 2022-07-04 Timed task processing method and device for cluster server

Publications (1)

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

Family

ID=83490498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210779123.4A Pending CN115168003A (en) 2022-07-04 2022-07-04 Timed task processing method and device for cluster server

Country Status (1)

Country Link
CN (1) CN115168003A (en)

Similar Documents

Publication Publication Date Title
WO2018045758A1 (en) Data storage method and data centre
CN108572876B (en) Method and device for realizing read-write lock
CN107423942B (en) Service transfer method and device
CN111897558A (en) Kubernets upgrading method and device for container cluster management system
CN109885612B (en) Synchronous validation method and device for intelligent contracts of block chains
CN106598746B (en) Method and device for realizing global lock in distributed system
CN112579319A (en) Service calling method and device based on LRU Cache optimization
CN113703946A (en) Application recovery method and device, electronic equipment and computer readable storage medium
CN108536541B (en) Process engine object processing method and device
CN111752961A (en) Data processing method and device
CN113541987A (en) Method and device for updating configuration data
CN115168003A (en) Timed task processing method and device for cluster server
CN113760858B (en) Dynamic migration method and device for memory database data, computing equipment and storage equipment
CN112860708B (en) Data consistency restoration method, system, device and equipment
CN115495466A (en) Data access processing method and device for database
CN111382200A (en) Information loading method and device, server and storage medium
CN116366609B (en) Global unique identification generation method, system, computer and readable storage medium
CN112631727B (en) Monitoring method and device for pod group pod
CN113448710B (en) Distributed application system based on business resources
CN111324472B (en) Method and device for judging garbage items of information to be detected
CN116089044A (en) Timing task scheduling method, device, equipment and storage medium
CN114281550A (en) Request processing method and device, computer equipment and computer readable storage medium
CN112416398A (en) Method and device for updating configuration information of main server
CN112860708A (en) Data consistency restoration method, system, device and equipment
CN113238862A (en) Distributed task scheduling method and device

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