CN113127172A - Task execution method and device, electronic equipment and storage medium - Google Patents

Task execution method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113127172A
CN113127172A CN202110431134.9A CN202110431134A CN113127172A CN 113127172 A CN113127172 A CN 113127172A CN 202110431134 A CN202110431134 A CN 202110431134A CN 113127172 A CN113127172 A CN 113127172A
Authority
CN
China
Prior art keywords
task
server
current server
current
determining
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
CN202110431134.9A
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.)
Shanghai Krypton Information Technology Co ltd
Original Assignee
Shanghai Krypton Information Technology Co 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 Shanghai Krypton Information Technology Co ltd filed Critical Shanghai Krypton Information Technology Co ltd
Priority to CN202110431134.9A priority Critical patent/CN113127172A/en
Publication of CN113127172A publication Critical patent/CN113127172A/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/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5033Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering data affinity

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The application discloses a task execution method, which comprises the following steps: acquiring a target position label of a current server in a Redis queue, and inquiring task identifiers of tasks; the Redis queue is used for storing the IP of each server; determining a task identifier matched with the target position label according to the task identifier, and determining a task corresponding to the task identifier matched with the target position label as a task executed on the current server; and after determining the task executed by the current server, executing the corresponding task. The method can ensure the service logic of certain tasks which needs to be executed in the same server, and can simultaneously execute the tasks which can be parallel in a plurality of servers, thereby not only ensuring that the service logic is not influenced, but also improving the task execution efficiency. The application also provides a task execution device, an electronic device and a computer readable storage medium, which have the beneficial effects.

Description

Task execution method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a task execution method and apparatus, an electronic device, and a computer-readable storage medium.
Background
At present, in order not to affect business logic, business personnel set each task under a project in a certain server before the project is executed, so that the efficiency is low, the blocking is easy, and the task failure caused by overlarge server load is easy to cause. Or in order to improve the execution efficiency, the tasks of the project are simply and roughly distributed to different servers for execution, so that the business logic of the tasks which must be executed on the same server is disturbed, and the task fails.
Disclosure of Invention
The task execution method can ensure that certain tasks need to be executed in the same server, can simultaneously execute the tasks which can be executed in parallel in a plurality of servers, ensures that the business logic is not influenced, and can improve the task execution efficiency. The specific scheme is as follows:
in a first aspect, the present application discloses a task execution method, including:
acquiring a target position label of a current server in a Redis queue, and inquiring task identifiers of tasks; the Redis queue is used for storing the IP of each server;
determining a task identifier matched with the target position label according to the task identifier, and determining a task corresponding to the task identifier matched with the target position label as a task executed on the current server;
and executing the corresponding task after determining the task executed by the current server.
Optionally, the determining, according to the task identifier, the task identifier matched with the target location label includes:
performing complementation on the task identifier of each task and the queue length of the Redis queue to generate each remainder;
and determining the remainder equal to the target position label as the task identifier matched with the target position label.
Optionally, after the executing the corresponding task, the method further includes:
judging whether the task executed on the current server is alive or not;
if not, restarting the current server and executing the current task.
Optionally, before restarting the current server, the method further includes:
judging whether the number of times of executing the current task is greater than a preset threshold value;
if so, recording the current task execution failure;
and if not, executing the step of restarting the current server.
Optionally, if the task executed on the current server does not survive, restarting the current server, and executing the current task, including:
if the task executed on the current server does not survive, restarting the current server, and determining the IP of the current server after restarting;
and replacing the IP of the current server before restarting in the Redis queue with the IP of the current server after restarting, and executing the current task.
Optionally, before obtaining the target location label of the current server in the Redis queue, the method further includes:
judging whether the IP of the current server is stored in the Redis queue;
if not, judging whether the number of the servers currently stored in the Redis queue is smaller than the queue length of the Redis queue; if yes, adding the IP of the current server into the Redis queue; if not, searching the server IP which can not be accessed in the Redis queue, and replacing the server IP which can not be accessed with the IP of the current server.
In a second aspect, the present application discloses a task execution device, comprising:
the query module is used for acquiring a target position label of the current server in the Redis queue and querying a task identifier of each task; the Redis queue is used for storing the IP of each server;
the determining module is used for determining a task identifier matched with the target position label according to the task identifier and determining a task corresponding to the task identifier matched with the target position label as a task executed on the current server;
and the execution module is used for executing the corresponding task after determining the task executed by the current server.
Optionally, the determining module includes:
the generating unit is used for performing complementation on the task identifier of each task and the queue length of the Redis queue to generate each remainder;
and the determining unit is used for determining the remainder which is equal to the target position label as the task identifier matched with the target position label.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and a processor for implementing the steps of the task execution method when executing the computer program.
In a fourth aspect, the present application discloses a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the task execution method as described above.
The application provides a task execution method, which comprises the following steps: task identification of each task; determining a task identifier matched with the target position label according to the task identifier, and determining a task corresponding to the task identifier matched with the target position label as a task executed on the current server; and executing the corresponding task after determining the task executed by the current server.
Therefore, the target position label of the current server and the task identifier of each task are obtained, and the task corresponding to the task identifier matched with the target position label is determined and used as the task executed on the current server; the method can determine the tasks corresponding to the same target position label to be executed on the same server, and can obtain that the tasks corresponding to different target position labels run on different servers, so that the method not only can meet the service requirements that certain tasks need to be executed on the same server, but also can improve the parallel rate and the execution efficiency of the tasks, and avoids the defects that all the tasks in the related art are executed in the same server and are low in efficiency and easy to block, or all the tasks are directly distributed to different servers to be executed, so that the service logic is disturbed, and the task execution fails. The application also provides a task execution device, an electronic device and a computer readable storage medium, which have the beneficial effects and are not described herein again.
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, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a task execution method according to an embodiment of the present application;
FIG. 2 is a block diagram of an embodiment of the present application;
fig. 3 is a schematic structural diagram of a task execution device according to 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, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the task execution of the related art, each task of a project is generally set to be executed in a certain server, which is inefficient and easy to block, or in order to improve the execution efficiency of the task, the tasks under the project are distributed to different servers, which may cause the service logic of the tasks that should be executed in the same server to be disturbed, resulting in service failure. Based on the above technical problems, this embodiment provides a task execution method, which can ensure that some tasks need to be executed in the same server, and for tasks that can be executed in parallel, the task execution method can be executed simultaneously in multiple servers, and the service logic is not affected, and task execution efficiency can also be improved, specifically please refer to fig. 1, where fig. 1 is a flowchart of a task execution method provided in this embodiment of the present application, and specifically includes:
s101, acquiring a target position label of a current server in a Redis queue, and inquiring task identifiers of tasks; the Redis queue is used to store the IP of each server.
The Redis queue in this embodiment is used to store the IP of each server, and after the server is started, the IP of the server may change. It can be understood that the location label corresponds to the IP of the server, that is, the IP of the server can be determined through the location label, and then the corresponding server can be found. It can also be understood that the task identifier in this embodiment is used to represent each task, that is, the corresponding task can be determined by the task identifier.
In a specific embodiment, in order to ensure that the IP of the current server is stored in the Redis queue, before obtaining the target location identifier of the current server in the Redis queue, the method may further include:
judging whether the IP of the current server is stored in a Redis queue or not;
if not, judging whether the number of the servers currently stored in the Redis queue is smaller than the queue length of the Redis queue or not; if yes, adding the IP of the current server into a Redis queue; if not, searching the server IP which can not be accessed in the Redis queue, and replacing the server IP which can not be accessed with the IP of the current server.
In this embodiment, whether the IP of the current server is stored in the Redis queue is determined, and when the IP of the current server is not stored in the Redis queue, it is continuously determined whether the number of servers currently stored in the Redis queue is smaller than the queue length of the Redis queue. For example, there are 8 servers in total, and the queue length of the Redis queue is 8. When the number of the servers currently stored in the Redis queue is smaller than the queue length of the Redis queue, adding the IP of the current server into the Redis queue; and if the number of the servers currently stored in the Redis queue is greater than or equal to the queue length of the Redis queue, searching the IP of the server which cannot be accessed in the Redis queue, and replacing the IP of the server which cannot be accessed with the IP of the current server. The IP of the current server can be ensured to be stored in the Redis queue, and the Redis queue can be updated in time.
And S102, determining a task identifier matched with the target position label according to the task identifier, and determining the task corresponding to the task identifier matched with the target position label as the task executed on the current server.
In the embodiment, the task identifier matched with the target position label is determined through the task identifier, and as the target position identifier is the position identifier of the current server, the task executed on the current server can be obtained after the task identifier matched with the target position label is determined.
The specific process of determining the task identifier matched with the target position label according to the task identifier is not limited in this embodiment, as long as the task identifier and the target position label are enabled to establish a corresponding relationship, or a corresponding task identifier is determined by the target position label. In a specific embodiment, determining the task identifier matching the target location label according to the task identifier may include:
the task identification of each task and the queue length of the Redis queue are complemented to generate each remainder;
and determining the remainder equal to the target position index as the task identifier matched with the target position index.
In this embodiment, each remainder is obtained by performing complementation on the task identifier of each task and the queue length of the Redis queue, and the remainder equal to the target position label is determined as the task identifier matched with the target position label. And then the task corresponding to the task identifier matched with the target position label can be determined as the task executed on the current server.
And S103, after determining the task executed by the current server, executing the corresponding task.
In this embodiment, after the current server determines the task to be executed, the corresponding task may be executed. The present embodiment does not limit the subsequent operation of the current server for executing the corresponding task. In a specific embodiment, in order to improve the success rate of task execution, after the corresponding task is executed in this embodiment, the method may further include:
judging whether a task executed on a current server is alive or not;
if not, the current server is restarted, and the current task is executed.
That is, after the corresponding task is executed, the present embodiment further determines whether the executed task is alive, that is, determines whether the task is normally executed and whether the task is blocked, and restarts the current server and executes the current task again when the task is not normally executed, that is, the task is not alive. According to the embodiment, through the judgment of whether the task is alive or not, when the task is not alive, the server is restarted and the task is executed again, so that the success rate of task execution can be improved.
Based on the foregoing embodiments, this embodiment does not limit the specific process of restarting the current server and executing the current task when the task is not alive. In a specific embodiment, to avoid wasting server resources, before restarting the current server, the method may further include:
judging whether the number of times of executing the current task is greater than a preset threshold value or not;
if so, recording the current task execution failure;
if not, the step of restarting the current server is executed.
That is, in this embodiment, when the task does not survive, the current server determines whether the number of times that the current task is executed is greater than a preset threshold before restarting, and this embodiment does not limit the specific size of the preset threshold, and may be set according to an actual situation. And if the execution times of the current task is greater than a preset threshold value, recording the execution failure of the current task, and not executing the step of restarting the current server. And if the current server is not beyond the preset threshold, executing the operation of restarting the current server. The method can prevent the waste of server resources due to the ineffectiveness such as tasks and the like.
The present embodiment does not limit the specific process of restarting the current server and executing the current task. In a specific embodiment, if the task executed on the current server does not survive, restarting the current server, and executing the current task may include:
if the task executed on the current server does not survive, restarting the current server, and determining the IP of the restarted current server;
and replacing the IP of the current server before restarting in the Redis queue with the IP of the current server after restarting, and executing the current task.
In this embodiment, when the task executed by the current server does not survive, the current server is restarted, and the IP of the current server after being restarted is determined, so that the IP of the current server after being restarted replaces the IP of the server in the Redis queue, that is, the IP of the server before being restarted, and the current task is executed.
Based on the technical scheme, the embodiment determines that the tasks corresponding to the same target position label are executed on the same server, and can obtain that the tasks corresponding to different target position labels are executed on different servers, so that the service requirements that some tasks need to be executed on the same server can be met, the parallel rate and the execution efficiency of the tasks can be improved, the service logic is not influenced, and the task execution efficiency can be improved.
Specific embodiments of a task execution method are provided below.
1. Task initialization
(1) And jointly using the current version ID of the item and the issue time of the item as the unique identifier of the Redis queue.
(2) When a project is started, acquiring the IP of a current server, judging whether the IP of the current server exists in a Redis queue, and judging whether the Redis queue reaches the number of machines, namely the queue length; if the IP of the current server does not exist in the Redis queue, storing the IP to the Redis queue; if the current Redis queue reaches the number of machines, the server is restarted, the server IP which cannot be accessed in the Redis queue is found, and the server IP which cannot be accessed is replaced by the IP of the current server.
(3) After each server is started, the IP of the server is pushed to the Redis queue, and finally the Redis queue with the length being the number of machines is obtained.
2. Process for task execution
(1) Determining a target position label of the IP of the current server in the Redis queue, and marking the target position label as index;
(2) the task identification (such as serial identification) of each task is inquired to determine the surplus of the number of the machines, and the task with the surplus result equal to index is determined as the task executed at the current server; thus each server determines the task to be performed;
(3) starting multi-thread execution among a plurality of tasks;
(4) judging whether the state of the task is in execution, namely whether the task is alive or not, judging whether the task is alive or not by accessing the IP of the current server by the task in execution, restarting the server and retrying the task under the abnormal condition, and recording the task failure after retrying a certain number of times, namely exceeding a preset threshold value.
Fig. 2 is a block diagram of a specific embodiment provided in this embodiment. And when a certain server is crashed suddenly, the server is restarted, the IP of the restarted server replaces the IP of the server which cannot be accessed in the current Redis queue, and the current task is continuously executed, so that the bottom-finding scheme is realized. And when the task block is not normally executed and the execution times do not exceed a preset threshold value, implementing a retry mechanism and restarting the server to continue executing the current task.
An embodiment is provided below that is particularly useful for scenarios. The task execution method provided by the application is applied to a large-batch customer seeking function. Getting 100 enterprises to a getting list; selecting all the items in the pick-up list and converting the items into clues; recording tasks to a database, and inquiring the tasks to a certain server through a serial identification to run; and after all operations are finished, sending a message to the user, and displaying a conversion result.
1. The method for finding the treasure for the visitor before using the invention has great limitation
(1) The efficiency of large batch of picking tasks in picking is very low, and data picking needs to wait for a long time;
(2) when different employees of different enterprises take the information at the same time, the server pressure is high, so that the task is easily blocked, and the picking fails.
2. Efficiency is obviously improved after the task execution method provided by the application is used
(1) The tasks are grouped and distributed to a plurality of servers, and the efficiency is changed from the original single thread to the multithreading;
(2) the tasks needing to be serialized in the server are still kept serialized, and are executed on the same server, so that the service logic is not influenced;
(3) a bottom-of-pocket scheme is made for automatic restarting and releasing of the server, and task blockage cannot be caused if the server is restarted due to inefficacy.
(4) And a retry mechanism is kept for the task which fails to be executed, so that the phenomenon that the task fails to be executed due to a short-time network is prevented.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a task execution device according to an embodiment of the present application, where the task execution device described below and the task execution method described above are referred to in correspondence, and the task execution device includes:
in some specific embodiments, the method specifically includes:
the query module 301 is configured to obtain a target position label of a current server in a Redis queue, and query a task identifier of each task; the Redis queue is used for storing the IP of each server;
a determining module 302, configured to determine, according to the task identifier, a task identifier matching the target location label, and determine, as a task executed on the current server, a task corresponding to the task identifier matching the target location label;
and the executing module 303 is configured to execute the corresponding task after determining the task executed by the current server.
In some specific embodiments, the determining module 302 includes:
the generating unit is used for performing complementation on the task identifier of each task and the queue length of the Redis queue to generate each remainder;
and the determining unit is used for determining the remainder equal to the target position index as the task identifier matched with the target position index.
In some specific embodiments, the method further comprises:
the first judgment module is used for judging whether the task executed on the current server is alive or not;
and the restarting module is used for restarting the current server and executing the current task if the current server is not started.
In some specific embodiments, the method further comprises:
the second judgment module is used for judging whether the executed times of the current task are greater than a preset threshold value or not;
and the recording module is used for recording the current task execution failure if the current task execution failure is detected.
In some specific embodiments, the restart module includes:
the restarting unit is used for restarting the current server if the task executed on the current server is not alive and determining the IP of the restarted current server;
and the replacing unit is used for replacing the IP of the current server before restarting in the Redis queue with the IP of the current server after restarting and executing the current task.
In some specific embodiments, the method further comprises:
the third judging module is used for judging whether the IP of the current server is stored in the Redis queue or not;
the fourth judging module is used for judging whether the number of the servers currently stored in the Redis queue is smaller than the queue length of the Redis queue or not if the number of the servers currently stored in the Redis queue is not smaller than the queue length of the Redis queue;
the adding module is used for adding the IP of the current server into the Redis queue if the IP of the current server is in the Redis queue;
and the searching module is used for searching the server IP which cannot be accessed in the Redis queue if the server IP is not accessed, and replacing the server IP which cannot be accessed with the IP of the current server.
Since the embodiment of the task performing device portion corresponds to the embodiment of the task performing method portion, please refer to the description of the embodiment of the task performing method portion for the embodiment of the task performing device portion, which is not repeated here.
In the following, an electronic device provided by an embodiment of the present application is introduced, and the electronic device described below and the task execution method described above may be referred to correspondingly.
The application also discloses an electronic device, including:
a memory for storing a computer program;
and a processor for implementing the steps of the task execution method when executing the computer program.
Since the embodiment of the electronic device portion corresponds to the embodiment of the task execution method portion, please refer to the description of the embodiment of the task execution method portion for the embodiment of the electronic device portion, which is not repeated here.
In the following, a computer-readable storage medium provided by an embodiment of the present application is described, and the computer-readable storage medium described below and the task execution method described above may be referred to correspondingly.
The present application also discloses a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the task execution method as described above.
Since the embodiment of the computer-readable storage medium portion corresponds to the embodiment of the task execution method portion, please refer to the description of the embodiment of the task execution method portion for the embodiment of the computer-readable storage medium portion, which is not repeated here.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above detailed description is provided for a task execution method, a task execution device, an electronic device, and a computer-readable storage medium. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A method of task execution, comprising:
acquiring a target position label of a current server in a Redis queue, and inquiring task identifiers of tasks; the Redis queue is used for storing the IP of each server;
determining a task identifier matched with the target position label according to the task identifier, and determining a task corresponding to the task identifier matched with the target position label as a task executed on the current server;
and executing the corresponding task after determining the task executed by the current server.
2. The task execution method of claim 1, wherein the determining the task identifier matching the target location label according to the task identifier comprises:
performing complementation on the task identifier of each task and the queue length of the Redis queue to generate each remainder;
and determining the remainder equal to the target position label as the task identifier matched with the target position label.
3. The task execution method according to claim 1, further comprising, after the executing the corresponding task:
judging whether the task executed on the current server is alive or not;
if not, restarting the current server and executing the current task.
4. The task execution method of claim 3, further comprising, before restarting the current server:
judging whether the number of times of executing the current task is greater than a preset threshold value;
if so, recording the current task execution failure;
and if not, executing the step of restarting the current server.
5. The task execution method of claim 3, wherein restarting the current server and executing the current task if the task executed on the current server is not alive comprises:
if the task executed on the current server does not survive, restarting the current server, and determining the IP of the current server after restarting;
and replacing the IP of the current server before restarting in the Redis queue with the IP of the current server after restarting, and executing the current task.
6. The task execution method of claim 1, further comprising, before obtaining the target location label of the current server in the Redis queue:
judging whether the IP of the current server is stored in the Redis queue;
if not, judging whether the number of the servers currently stored in the Redis queue is smaller than the queue length of the Redis queue; if yes, adding the IP of the current server into the Redis queue; if not, searching the server IP which can not be accessed in the Redis queue, and replacing the server IP which can not be accessed with the IP of the current server.
7. A task execution apparatus, comprising:
the query module is used for acquiring a target position label of the current server in the Redis queue and querying a task identifier of each task; the Redis queue is used for storing the IP of each server;
the determining module is used for determining a task identifier matched with the target position label according to the task identifier and determining a task corresponding to the task identifier matched with the target position label as a task executed on the current server;
and the execution module is used for executing the corresponding task after determining the task executed by the current server.
8. The task execution device of claim 7, wherein the determination module comprises:
the generating unit is used for performing complementation on the task identifier of each task and the queue length of the Redis queue to generate each remainder;
and the determining unit is used for determining the remainder which is equal to the target position label as the task identifier matched with the target position label.
9. An electronic device, comprising:
a memory for storing a computer program;
processor for implementing the steps of the task execution method according to any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the task execution method according to any one of claims 1 to 6.
CN202110431134.9A 2021-04-21 2021-04-21 Task execution method and device, electronic equipment and storage medium Pending CN113127172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110431134.9A CN113127172A (en) 2021-04-21 2021-04-21 Task execution method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110431134.9A CN113127172A (en) 2021-04-21 2021-04-21 Task execution method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113127172A true CN113127172A (en) 2021-07-16

Family

ID=76778738

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110431134.9A Pending CN113127172A (en) 2021-04-21 2021-04-21 Task execution method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113127172A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100175076A1 (en) * 2009-01-06 2010-07-08 International Business Machines Corporation Method for executing a software routine identified in a task object
CN101938528A (en) * 2010-08-12 2011-01-05 漳州市顺和达软件有限公司 Dynamic IP curing analytic method and system
CN107368359A (en) * 2017-05-31 2017-11-21 杭州大搜车汽车服务有限公司 A kind of asynchronous task performs method and its storage medium, device
CN109447411A (en) * 2018-09-26 2019-03-08 平安普惠企业管理有限公司 Business Process Control method, apparatus, computer equipment and storage medium
CN109614209A (en) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 A kind of task processing method, application server and system
CN109995842A (en) * 2018-01-02 2019-07-09 北京奇虎科技有限公司 A kind of group technology and device for distributed server cluster
CN111782360A (en) * 2020-06-28 2020-10-16 中国工商银行股份有限公司 Distributed task scheduling method and device
CN112099958A (en) * 2020-11-17 2020-12-18 深圳壹账通智能科技有限公司 Distributed multi-task management method and device, computer equipment and storage medium
CN112395107A (en) * 2020-11-17 2021-02-23 航天信息股份有限公司 Tax control equipment control method and device, storage medium and electronic equipment
CN112540914A (en) * 2020-11-27 2021-03-23 北京百度网讯科技有限公司 Execution method, execution device, server and storage medium for unit test

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100175076A1 (en) * 2009-01-06 2010-07-08 International Business Machines Corporation Method for executing a software routine identified in a task object
CN101938528A (en) * 2010-08-12 2011-01-05 漳州市顺和达软件有限公司 Dynamic IP curing analytic method and system
CN107368359A (en) * 2017-05-31 2017-11-21 杭州大搜车汽车服务有限公司 A kind of asynchronous task performs method and its storage medium, device
CN109995842A (en) * 2018-01-02 2019-07-09 北京奇虎科技有限公司 A kind of group technology and device for distributed server cluster
CN109447411A (en) * 2018-09-26 2019-03-08 平安普惠企业管理有限公司 Business Process Control method, apparatus, computer equipment and storage medium
CN109614209A (en) * 2018-10-26 2019-04-12 阿里巴巴集团控股有限公司 A kind of task processing method, application server and system
CN111782360A (en) * 2020-06-28 2020-10-16 中国工商银行股份有限公司 Distributed task scheduling method and device
CN112099958A (en) * 2020-11-17 2020-12-18 深圳壹账通智能科技有限公司 Distributed multi-task management method and device, computer equipment and storage medium
CN112395107A (en) * 2020-11-17 2021-02-23 航天信息股份有限公司 Tax control equipment control method and device, storage medium and electronic equipment
CN112540914A (en) * 2020-11-27 2021-03-23 北京百度网讯科技有限公司 Execution method, execution device, server and storage medium for unit test

Similar Documents

Publication Publication Date Title
US10439937B2 (en) Service addressing in distributed environment
CN101196912B (en) Method and apparatus for application state synchronization
CN106817295B (en) Message processing device and method
US7698602B2 (en) Systems, methods and computer products for trace capability per work unit
CN107608860B (en) Method, device and equipment for classified storage of error logs
CN106844055B (en) Task execution method and device
CN112181627A (en) Timing task scheduling method, device and system
CN109710679B (en) Data extraction method and device
CN113946427A (en) Task processing method, processor and storage medium for multi-operating system
CN110888739B (en) Distributed processing method and device for delayed tasks
CN110888790B (en) Log management method and device, electronic equipment and storage medium
CN111913804A (en) Pre-visit report generation method and device, electronic equipment and storage medium
CN113127172A (en) Task execution method and device, electronic equipment and storage medium
CN110928885B (en) Method and device for updating data of Mysql database to Es database
CN111181777A (en) Service degradation method, device, computer equipment and storage medium
CN114625515A (en) Task management method, device, equipment and storage medium
CN110543349B (en) Application starting acceleration method and device and computer readable storage medium
CN114138371A (en) Configuration dynamic loading method and device, computer equipment and storage medium
CN112596783A (en) Code automatic merging method and device, computer equipment and storage medium
US10885014B2 (en) Assigning monitoring responsibilities in distributed systems using optimistic concurrency
CN111756778A (en) Server disk cleaning script pushing method and device and storage medium
CN103713982A (en) Method and device for monitoring return result of remote service
CN115866017B (en) Message processing method, device, communication equipment and storage medium
US20230385113A1 (en) Progress Monitoring Service
US20210342077A1 (en) Automated resource selection for software-defined storage deployment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210716