CN111309456A - Task execution method and system - Google Patents

Task execution method and system Download PDF

Info

Publication number
CN111309456A
CN111309456A CN201811520589.2A CN201811520589A CN111309456A CN 111309456 A CN111309456 A CN 111309456A CN 201811520589 A CN201811520589 A CN 201811520589A CN 111309456 A CN111309456 A CN 111309456A
Authority
CN
China
Prior art keywords
task
directory node
processing service
service process
task processing
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.)
Granted
Application number
CN201811520589.2A
Other languages
Chinese (zh)
Other versions
CN111309456B (en
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.)
Shenzhen Ipanel TV Inc
Original Assignee
Shenzhen Ipanel TV Inc
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 Shenzhen Ipanel TV Inc filed Critical Shenzhen Ipanel TV Inc
Priority to CN201811520589.2A priority Critical patent/CN111309456B/en
Publication of CN111309456A publication Critical patent/CN111309456A/en
Application granted granted Critical
Publication of CN111309456B publication Critical patent/CN111309456B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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
    • 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/505Allocation 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 the load
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application provides a task execution method and a system, in the application, a task manager obtains task processing service process information from a shared queue of a relay server, under the condition that a task processing service process breaks down, the task manager can still obtain related task processing service process information from the shared queue, normally generates a corresponding task allocation instruction, and writes the corresponding task allocation instruction into the shared queue, under the condition that the task manager temporarily breaks down, each task processing service process can obtain the task allocation instruction from the shared queue, and the reliability of the task processing service process for obtaining the task allocation instruction is ensured, so that the reliability of dispatching the task allocation instruction is improved.

Description

Task execution method and system
Technical Field
The present application relates to the field of cluster system technologies, and in particular, to a method and a system for task execution.
Background
With the continuous expansion of internet applications and enterprise applications, large-scale server cluster systems are required to deploy various application services.
In a large-scale server cluster system, a task manager generally dispatches tasks to processing servers, and the processing servers execute the corresponding tasks. The task can be executed normally on the premise that the task is reliably dispatched, but how to realize the reliable dispatch of the task becomes a problem.
Disclosure of Invention
In order to solve the foregoing technical problems, embodiments of the present application provide a method and a system for task execution to achieve the purpose of improving reliability of task allocation instruction dispatching, where the technical scheme is as follows:
a task execution method, comprising:
the task manager acquires task processing service process information from a shared queue of the relay server, and takes a task processing service process corresponding to the acquired task processing service process information as a task processing service process to be used;
the task manager responds to the task processing request, selects a task processing service process from the task processing service processes to be used as an execution terminal of a task to be executed, and generates a corresponding task allocation instruction, wherein the task allocation instruction comprises: the task to be executed and the identity of the task processing service process executing the task to be executed are identified;
the task manager writes a corresponding task allocation instruction into the shared queue;
each task processing service process acquires a task allocation instruction from the shared queue, takes the task allocation instruction as a target task allocation instruction, and judges whether the identity of each task processing service process is matched with the identity in the target task allocation instruction;
if so, executing the task to be executed in the target task allocation instruction;
and if not, deleting the target task allocation instruction.
Preferably, the method further comprises:
the task manager acquires terminal information reported by a task processing service process from the shared queue;
the task manager takes the acquired terminal information as a target directory node and adds the target directory node into a monitoring list;
the monitoring server responds to a directory node creation request of the task processing service process to create a directory node;
the task manager acquires each directory node created by the monitoring server from the monitoring server and judges whether a node matched with the acquired directory node exists in the monitoring list or not;
if the directory node exists, the monitoring server is instructed to monitor the matched directory node, so that the monitoring server monitors the matched directory node and feeds back a monitoring result;
and if not, sending a unmatched directory node deleting instruction to the monitoring server.
Preferably, the instructing the monitoring server to monitor the directory node matched with the directory node includes:
judging whether the history records have the records of the matched directory nodes;
if not, indicating the monitoring server to monitor the matched directory node;
if yes, judging whether the data of the historical directory node in the historical record is the same as the data of the matched directory node, wherein the historical directory node and the matched directory node correspond to the same task processing service process;
and if not, sending an instruction for deleting the historical directory node to the monitoring server.
Preferably, the monitoring server monitors the matched directory node and feeds back a monitoring result, including:
the monitoring server judges whether the communication between the task processing service processes corresponding to the matched directory nodes is abnormal or not;
and if so, the monitoring server releases the matched directory node and feeds back release information to the task manager.
Preferably, the monitoring server monitors the matched directory node and feeds back a monitoring result, including:
the monitoring server monitors whether the operation of the task processing service process corresponding to the matched directory node is abnormal or not;
if yes, feeding back the information of abnormal operation of the matched directory node to the task manager;
the method further comprises the following steps:
and the task manager reselects a task processing service process to execute the task corresponding to the directory node with abnormal operation according to the information of the abnormal operation of the matched directory node.
A task execution system, comprising: the system comprises a task manager, a transfer server and a plurality of task processing service processes;
the task manager is configured to acquire task processing service process information from a shared queue of the relay server, use a task processing service process corresponding to the acquired task processing service process information as a task processing service process to be used, respond to a task processing request, select a task processing service process from the task processing service processes to be used as an execution terminal of a task to be executed, generate a corresponding task allocation instruction, and write the corresponding task allocation instruction into the shared queue, where the task allocation instruction includes: the task to be executed and the identity of the task processing service process executing the task to be executed are identified;
each task processing service process is used for acquiring a task allocation instruction from the shared queue, using the task allocation instruction as a target task allocation instruction, and judging whether the identity of the task processing service process is matched with the identity in the target task allocation instruction;
if so, executing the task to be executed in the target task allocation instruction;
and if not, deleting the target task allocation instruction.
Preferably, the system further comprises: a monitoring server;
the task manager is also used for acquiring terminal information reported by the task processing service process from the shared queue, and adding the acquired terminal information into a monitoring list as a target directory node;
the monitoring server is used for responding to a directory node creation request of the task processing service process and creating a directory node;
the task manager is also used for acquiring each directory node created by the monitoring server from the monitoring server and judging whether a node matched with the acquired directory node exists in the monitoring list or not;
if the directory node exists, the monitoring server is instructed to monitor the matched directory node, so that the monitoring server monitors the matched directory node and feeds back a monitoring result;
and if not, sending a unmatched directory node deleting instruction to the monitoring server.
Preferably, the task manager is specifically configured to determine whether a history record includes a record of the matching directory node;
if not, indicating the monitoring server to monitor the matched directory node;
if yes, judging whether the data of the historical directory node in the historical record is the same as the data of the matched directory node, wherein the historical directory node and the matched directory node correspond to the same task processing service process;
and if not, sending an instruction for deleting the historical directory node to the monitoring server.
Preferably, the monitoring server is specifically configured to determine whether communication between task processing service processes corresponding to the directory nodes matched with the monitoring server is abnormal; and if so, releasing the matched directory node, and feeding back release information to the task manager.
Preferably, the monitoring server is specifically configured to monitor whether the task processing service process corresponding to the matched directory node runs abnormally;
if yes, feeding back the information of abnormal operation of the matched directory node to the task manager;
and the task manager is also used for reselecting a task processing service process to execute the task corresponding to the directory node with abnormal operation according to the information of the abnormal operation of the matched directory node.
Compared with the prior art, the beneficial effect of this application is:
in the application, the task manager acquires the information of the task processing service processes from the shared queue of the relay server, and under the condition that the task processing service processes have faults, the task manager can still acquire the related information of the task processing service processes from the shared queue, normally generate corresponding task allocation instructions, and write the corresponding task allocation instructions into the shared queue.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only 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 inventive labor.
FIG. 1 is a flow chart of a task execution method provided herein;
FIG. 2 is another flow chart of a task execution method provided herein;
FIG. 3 is a sub-flow diagram of a task execution method provided herein;
FIG. 4 is another sub-flow diagram of a task execution method provided herein;
FIG. 5 is a further sub-flow diagram of a task execution method provided herein;
fig. 6 is a schematic diagram of a logical structure of a task execution system provided in the present application.
Detailed Description
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 only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application discloses a task execution method, which comprises the following steps: the task manager acquires task processing service process information from a shared queue of the relay server, and takes a task processing service process corresponding to the acquired task processing service process information as a task processing service process to be used; the task manager responds to the task processing request, selects a task processing service process from the task processing service processes to be used as an execution terminal of a task to be executed, and generates a corresponding task allocation instruction, wherein the task allocation instruction comprises: the task to be executed and the identity of the task processing service process executing the task to be executed are identified; the task manager writes a corresponding task allocation instruction into the shared queue; each task processing service process acquires a task allocation instruction from the shared queue, takes the task allocation instruction as a target task allocation instruction, and judges whether the identity of each task processing service process is matched with the identity in the target task allocation instruction; if so, executing the task to be executed in the target task allocation instruction; and if not, deleting the target task allocation instruction. In the application, the reliability of task allocation instruction dispatching can be improved.
Referring to fig. 1, a task execution method disclosed in an embodiment of the present application is described below, which may include:
step S11, the task manager acquires the task processing service process information from the shared queue of the relay server, and takes the task processing service process corresponding to the acquired task processing service process information as a task processing service process to be used.
The information of the task processing service process in the shared queue of the transit server can be actively reported by the task processing service process, so that the expansion and reduction of the task processing service process in the system are facilitated, fixed configuration can be omitted, and the work of operation and maintenance personnel can be reduced.
Preferably, the transit server may be: a RabbitMQ server.
More preferably, the method may be: three RabbitMQ servers are deployed in the system, one RabbitMQ server is selected from the three RabbitMQ servers for use, and when the currently used RabbitMQ server is abnormal, the server can be switched to any remaining RabbitMQ server to execute related services, so that the information in the shared queue is ensured not to be lost and normally received and sent.
In this embodiment, the following may be set: the shared queue of the RabbitMQ server and the information in the shared queue can be persistent, so that the information cannot be lost under the condition that the RabbitMQ server is down.
And step S12, the task manager responds to the task processing request, selects a task processing service process from the task processing service processes to be used as an execution service process of the task to be executed, and generates a corresponding task allocation instruction.
The task allocation instructions include: and the to-be-executed task and the identity of the task processing service process executing the to-be-executed task.
In this embodiment, according to the resource load capacity and/or the health condition of the task processing service processes to be used, a suitable task processing service process may be selected from the task processing service processes to be used as an execution terminal of the task to be executed, so as to ensure the execution efficiency of the task to be executed.
And step S13, the task manager writes the corresponding task allocation instruction into the shared queue.
The task processor writes the corresponding task allocation instruction into the shared queue, and simultaneously can save the storage space of the task allocation instruction to the task processor.
Of course, the task manager may not store the corresponding task allocation instruction, so as to save the storage space.
Step S14, each task processing service process obtains a task allocation instruction from the shared queue, and uses the task allocation instruction as a target task allocation instruction, and determines whether its own identity matches with an identity in the target task allocation instruction.
If yes, go to step S15; if not, go to step S16.
It should be noted that, when the task manager does not store the corresponding task allocation instruction, each task processing service process can only obtain the task allocation instruction from the shared queue.
The task processing service process can acquire the task allocation instruction from the shared queue in a callback notification mode, polling is not needed, and the running efficiency of the task processing service process can be improved.
The task allocation instruction is acquired from the shared queue by means of callback notification, and the method can be understood as follows: when a task allocation instruction is written in the shared queue, the transfer server pushes the task allocation instruction to the task processing service process; or when a task allocation instruction is generated in the task management, the transfer server pushes the task allocation instruction to the task processing service process.
Each task processing service process acquires a task allocation instruction from the shared queue as a target task allocation instruction, and determines whether the identity of each task processing service process is matched with the identity in the target task allocation instruction, which can be understood as follows: triggering each task processing service process to execute, acquiring a task allocation instruction from the shared queue as a target task allocation instruction, and judging whether the identity of the task allocation instruction is matched with the identity in the target task allocation instruction.
And step S15, executing the task to be executed in the target task allocation instruction.
After the task processing service process executes the task to be executed in the target task allocation instruction, the execution result can be written into the shared queue. The task manager can acquire the execution result from the shared queue to check the task execution condition, and can use the task execution condition as a reference basis for subsequently allocating the task processing service process.
And step S16, deleting the target task allocation instruction.
And deleting the target task allocation instruction by the task processing service process under the condition that the identity identification is judged to be unmatched, so as to save the storage space.
In the application, the task manager acquires the information of the task processing service processes from the shared queue of the relay server, and under the condition that the task processing service processes have faults, the task manager can still acquire the related information of the task processing service processes from the shared queue, normally generate corresponding task allocation instructions, and write the corresponding task allocation instructions into the shared queue.
In another embodiment of the present application, another task execution method is introduced, and referring to fig. 2, the method may include:
step S21, the task manager acquires the task processing service process information from the shared queue of the relay server, and takes the task processing service process corresponding to the acquired task processing service process information as a task processing service process to be used.
And step S22, the task manager responds to the task processing request, selects a task processing service process from the task processing service processes to be used as an execution service process of the task to be executed, and generates a corresponding task allocation instruction.
The task allocation instructions include: and the to-be-executed task and the identity of the task processing service process executing the to-be-executed task.
And step S23, the task manager writes the corresponding task allocation instruction into the shared queue.
Step S24, each task processing service process obtains a task allocation instruction from the shared queue, and uses the task allocation instruction as a target task allocation instruction, and determines whether its own identity matches with an identity in the target task allocation instruction.
If yes, go to step S25; if not, go to step S26.
Steps S21-S26 are the same as steps S11-S16 in the previous embodiment, and the detailed procedures of steps S21-S26 can be referred to the related descriptions of steps S11-S16, and are not described herein again.
Step S27, the task manager obtains the process information reported by the task processing service process from the shared queue.
In this embodiment, the task processing service process may report the process information periodically. The task processing service process reports the process information, so that the task manager can know which processing service processes exist conveniently, and the trouble of manual configuration can be saved.
The process information may include: machine serial number, service process PID value, service PORT PORT identification.
Step S28, the task manager adds the acquired process information as a target directory node to the listening list.
The task manager adds the acquired process information as a target directory node into the monitoring list, and can monitor the operation state of the directory node in the monitoring list.
The task manager takes the acquired process information as a target directory node, and the name of the target directory node can be named as: msn _ pid _ port. Wherein msn represents a machine serial number, pid represents a service process pid value, and PORT represents a service PORT PORT identifier.
Step S29, the monitoring server responds to the directory node creation request of the task processing service process, and creates a directory node.
The monitoring server responds to the directory node creation request of the task processing service process, creates a directory node, and can monitor the operation condition of the created directory node after the directory node is created.
Monitoring the operation condition of the created directory node can be understood as: and monitoring the running condition of the task processing service process corresponding to the created directory node.
Preferably, the monitoring server may be: ZooKeeper server.
It should be noted that, for the same task processing service process, the names of the directory nodes created by the monitoring server need to be consistent with the names of the directory nodes in the monitoring list in the task manager.
Step S210, the task manager acquires each directory node created by the monitoring server from the monitoring server, and determines a directory node condition in the monitoring list according to the acquired directory node.
The task manager can obtain the directory node created by the server to be monitored according to the information reported by the task processing process, and judge the directory node condition of the monitoring list. Specifically, the monitoring server obtains the existence of the directory node and determines the Value stored in the directory node, that is, the directory node path is a Key Value, the Value stored in the directory node is a Value, and the standard KV structure is adopted. Similar to what font in word indicates a Key, which font is used, such as "bold", which is a value, there may be many sons, regular scripts, etc. but there is only one corresponding Key.
In another embodiment of the present application, the process of determining the directory node condition in the monitoring list according to the obtained directory node is described, referring to fig. 3, which may include:
step S31, determine whether there is a record of a directory node matching the obtained directory node in the records in the monitoring list.
If not, go to step S32; if yes, go to step S33.
In this embodiment, the records in the listening list are generated and managed by the task manager.
And step S32, instructing the monitoring server to monitor the matched directory node.
Step S33, determining whether the data of the directory node in the monitoring list is the same as the data of the matching directory node.
And the directory node in the registry corresponds to the matched directory node and is the same task processing service process.
In this embodiment, whether the task processing service process has been restarted is determined by determining whether the data of the historical directory node in the record in the registry is the same as the latest data of the matched directory node.
If not, it indicates that the task processing service process is restarted, and step S34 is executed.
Step S34, updating the value stored in the latest directory node into the record of the monitoring list, and sending the identification of the processing service process and the deletion message to the task manager.
If the data are judged to be different in the previous steps, if the identification and the deletion message of the processing service process are not sent to the task manager, the identification and the deletion message of the processing service process can be sent to the task manager.
And sending the identification and the deletion message of the processing service process to the task manager. And the management server receives the deletion message and can check whether the restarted machine has tasks which are not finished originally or not, and if so, the restarted machine can redistribute the unfinished tasks.
In another embodiment of the present application, a process of monitoring the matching directory node by the monitoring server and feeding back a monitoring result is introduced, please refer to fig. 4, which may include:
step S41, the monitoring server determines whether the communication between the task processing service processes corresponding to the matched directory nodes is abnormal.
If yes, the server corresponding to the directory node with abnormal communication is determined to be failed, and step S42 is executed.
The step of judging whether the communication between the task processing service processes corresponding to the matched directory nodes is abnormal or not by the monitoring server can be understood as follows:
and the monitoring server judges whether the link or the network between the task processing service processes corresponding to the matched directory nodes is abnormal or not.
And under the condition that the processing task service process is halted due to the error of the program, the monitoring server can also judge the communication abnormity among the task processing service processes corresponding to the matched directory nodes.
Step S42, the monitoring server notifies the connection-monitored client that the time is out and actively releases the directory node created by the server with the failure.
The task manager obtains the relevant information by inquiring whether the directory node exists.
In another embodiment of the present application, another process for the monitoring server to monitor the matched directory node and feed back the monitoring result is introduced, and referring to fig. 5, the process may include:
step S51, the monitoring server monitors whether the operation of the task processing service process corresponding to the matched directory node is abnormal.
If yes, go to step S52.
And step S52, feeding back the abnormal operation information of the matched directory nodes to the task manager.
Step S52 is a specific implementation manner of the feedback monitoring result in the foregoing embodiment.
In this embodiment, after the monitoring server monitors the running exception of the task processing service process corresponding to the matched directory node, the task execution method may further include:
and the task manager reselects a task processing service process to execute the task corresponding to the directory node with abnormal operation according to the information of the abnormal operation of the matched directory node.
In this embodiment, the database may be used to record the task list of the task processing service process in real time, and update the state of the task in real time to the shared queue of the relay server. The task manager can acquire the information of the task processing service process from the shared queue of the transit server, reselect a task corresponding to the directory node with abnormal operation executed by the task processing service process, and complete the task transfer and execution.
Next, a task execution system provided in the present application is described, and the task execution system described below and the task execution method described above may be referred to correspondingly.
Referring to fig. 6, the task execution system includes: a task manager 11, a transit server 12, and a plurality of task processing service processes 13.
The task manager 11 is configured to acquire information of a task processing service process 13 from a shared queue of the relay server 12, use the task processing service process 13 corresponding to the acquired information of the task processing service process 13 as a task processing service process 13 to be used, and in response to a task processing request, select the task processing service process 13 from the task processing service processes 13 to be used as an execution service process of a task to be executed, generate a corresponding task allocation instruction, and write the corresponding task allocation instruction into the shared queue, where the task allocation instruction includes: the identity of the task to be executed and the task processing service process 13 executing the task to be executed.
Each task processing service process 13 is configured to obtain a task allocation instruction from the shared queue, use the task allocation instruction as a target task allocation instruction, and determine whether an identity of the task processing service process is matched with an identity in the target task allocation instruction.
And if so, executing the task to be executed in the target task allocation instruction.
And if not, deleting the target task allocation instruction.
In this embodiment, the task execution system may further include: and monitoring the server.
The task manager 11 is further configured to obtain process information reported by the task processing service process 13 from the shared queue, and add the obtained process information to the monitoring list as a target directory node.
The monitoring server is configured to respond to the directory node creation request of the task processing service process 13 to create a directory node.
The task manager 11 is further configured to obtain each directory node created by the monitoring server from the monitoring server, and determine a directory node condition in the monitoring list according to the obtained directory node.
In this embodiment, the task manager 11 may specifically be configured to:
judging whether a record of the directory node matched with the obtained directory node exists in the records in the monitoring list;
if not, indicating the monitoring server to monitor the matched directory node;
if yes, judging whether the data of the directory node in the monitoring list is the same as the data of the matched directory node;
and if not, updating the value stored by the latest directory node into the record of the monitoring list, and sending an identification and a deletion message for processing the service process to the task manager.
In this embodiment, the monitoring server may be specifically configured to determine whether communication between the task processing service processes 13 corresponding to the directory nodes that are matched with each other is abnormal; if yes, informing the client end connected with the monitoring to overtime and actively releasing the directory node created by the server with the fault.
In this embodiment, the monitoring server may be specifically configured to monitor whether the task processing service process 13 corresponding to the matched directory node runs abnormally.
If yes, feeding back the information of abnormal operation of the matched directory node to the task manager 11;
the task manager 11 may be further configured to reselect a task processing service process 13 to execute a task corresponding to the directory node with the abnormal operation according to the information that the matched directory node has the abnormal operation.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The above detailed description is provided for a task execution method and system, and a specific example is applied in this document to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, 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 application.

Claims (10)

1. A method of task execution, comprising:
the task manager acquires task processing service process information from a shared queue of the relay server, and takes a task processing service process corresponding to the acquired task processing service process information as a task processing service process to be used;
the task manager responds to the task processing request, selects a task processing service process from the task processing service processes to be used as an execution service process of a task to be executed, and generates a corresponding task allocation instruction, wherein the task allocation instruction comprises: the task to be executed and the identity of the task processing service process executing the task to be executed are identified;
the task manager writes a corresponding task allocation instruction into the shared queue;
each task processing service process acquires a task allocation instruction from the shared queue, takes the task allocation instruction as a target task allocation instruction, and judges whether the identity of each task processing service process is matched with the identity in the target task allocation instruction;
if so, executing the task to be executed in the target task allocation instruction;
and if not, deleting the target task allocation instruction.
2. The method of claim 1, further comprising:
the task manager acquires process information reported by a task processing service process from the shared queue;
the task manager takes the acquired process information as a target directory node and adds the target directory node into a monitoring list;
the monitoring server responds to a directory node creation request of the task processing service process to create a directory node;
and the task manager acquires each directory node created by the monitoring server from the monitoring server and judges the directory node condition in the monitoring list according to the acquired directory node.
3. The method according to claim 2, wherein the determining, according to the obtained directory node, a directory node condition in the snoop list comprises:
judging whether a record of the directory node matched with the obtained directory node exists in the records in the monitoring list;
if not, indicating the monitoring server to monitor the matched directory node;
if yes, judging whether the data of the directory node in the monitoring list is the same as the data of the matched directory node;
and if not, updating the value stored by the latest directory node into the record of the monitoring list, and sending an identification and a deletion message for processing the service process to the task manager.
4. The method of claim 2, wherein the monitoring server monitors the matched directory node and feeds back a monitoring result, comprising:
the monitoring server judges whether the communication between the task processing service processes corresponding to the matched directory nodes is abnormal or not;
if yes, the monitoring server informs the client connected with the monitoring to be overtime and actively releases the directory node created by the server with the fault.
5. The method of claim 2, wherein the monitoring server monitors the matched directory node and feeds back a monitoring result, comprising:
the monitoring server monitors whether the operation of the task processing service process corresponding to the matched directory node is abnormal or not;
if yes, feeding back the information of abnormal operation of the matched directory node to the task manager;
the method further comprises the following steps:
and the task manager reselects a task processing service process to execute the task corresponding to the directory node with abnormal operation according to the information of the abnormal operation of the matched directory node.
6. A task execution system, comprising: the system comprises a task manager, a transfer server and a plurality of task processing service processes;
the task manager is configured to acquire task processing service process information from a shared queue of the relay server, use a task processing service process corresponding to the acquired task processing service process information as a task processing service process to be used, respond to a task processing request, select a task processing service process from the task processing service processes to be used as an execution service process of a task to be executed, generate a corresponding task allocation instruction, and write the corresponding task allocation instruction into the shared queue, where the task allocation instruction includes: the task to be executed and the identity of the task processing service process executing the task to be executed are identified;
each task processing service process is used for acquiring a task allocation instruction from the shared queue, using the task allocation instruction as a target task allocation instruction, and judging whether the identity of the task processing service process is matched with the identity in the target task allocation instruction;
if so, executing the task to be executed in the target task allocation instruction;
and if not, deleting the target task allocation instruction.
7. The system of claim 6, further comprising: a monitoring server;
the task manager is also used for acquiring process information reported by the task processing service process from the shared queue, and adding the acquired process information into a monitoring list as a target directory node;
the monitoring server is used for responding to a directory node creation request of the task processing service process and creating a directory node;
the task manager is further configured to obtain each directory node created by the monitoring server from the monitoring server, and determine a directory node condition in the monitoring list according to the obtained directory node.
8. The system of claim 7, wherein the task manager is specifically configured to:
judging whether a record of the directory node matched with the obtained directory node exists in the records in the monitoring list;
if not, indicating the monitoring server to monitor the matched directory node;
if yes, judging whether the data of the directory node in the monitoring list is the same as the data of the matched directory node;
and if not, updating the value stored by the latest directory node into the record of the monitoring list, and sending an identification and a deletion message for processing the service process to the task manager.
9. The system according to claim 7, wherein the monitoring server is specifically configured to determine whether communication between task processing service processes corresponding to the matched directory nodes is abnormal; if yes, informing the client end connected with the monitoring to overtime and actively releasing the directory node created by the server with the fault.
10. The system according to claim 7, wherein the monitoring server is specifically configured to monitor whether the task processing service process corresponding to the matched directory node runs abnormally;
if yes, feeding back the information of abnormal operation of the matched directory node to the task manager;
and the task manager is also used for reselecting a task processing service process to execute the task corresponding to the directory node with abnormal operation according to the information of the abnormal operation of the matched directory node.
CN201811520589.2A 2018-12-12 2018-12-12 Task execution method and system Active CN111309456B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811520589.2A CN111309456B (en) 2018-12-12 2018-12-12 Task execution method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811520589.2A CN111309456B (en) 2018-12-12 2018-12-12 Task execution method and system

Publications (2)

Publication Number Publication Date
CN111309456A true CN111309456A (en) 2020-06-19
CN111309456B CN111309456B (en) 2023-04-18

Family

ID=71154406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811520589.2A Active CN111309456B (en) 2018-12-12 2018-12-12 Task execution method and system

Country Status (1)

Country Link
CN (1) CN111309456B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968472A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Process processing method and device, storage medium and processor
CN114138371A (en) * 2021-12-02 2022-03-04 北京天融信网络安全技术有限公司 Configuration dynamic loading method and device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020144006A1 (en) * 2000-10-04 2002-10-03 Cranston Wayne M. High performance interprocess communication
US20040024774A1 (en) * 2002-08-01 2004-02-05 Oracle International Corporation Buffered message queue architecture for database management systems
CN102521044A (en) * 2011-12-30 2012-06-27 北京拓明科技有限公司 Distributed task scheduling method and system based on messaging middleware
CN103500119A (en) * 2013-09-06 2014-01-08 西安交通大学 Task allocation method based on pre-dispatch
CN106294386A (en) * 2015-05-19 2017-01-04 北大方正集团有限公司 Task distribution performs method and system
CN107423131A (en) * 2017-03-29 2017-12-01 努比亚技术有限公司 A kind of sharing method and server
CN108829504A (en) * 2018-06-28 2018-11-16 泰康保险集团股份有限公司 A kind of method for scheduling task, device, medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020144006A1 (en) * 2000-10-04 2002-10-03 Cranston Wayne M. High performance interprocess communication
US20040024774A1 (en) * 2002-08-01 2004-02-05 Oracle International Corporation Buffered message queue architecture for database management systems
CN102521044A (en) * 2011-12-30 2012-06-27 北京拓明科技有限公司 Distributed task scheduling method and system based on messaging middleware
CN103500119A (en) * 2013-09-06 2014-01-08 西安交通大学 Task allocation method based on pre-dispatch
CN106294386A (en) * 2015-05-19 2017-01-04 北大方正集团有限公司 Task distribution performs method and system
CN107423131A (en) * 2017-03-29 2017-12-01 努比亚技术有限公司 A kind of sharing method and server
CN108829504A (en) * 2018-06-28 2018-11-16 泰康保险集团股份有限公司 A kind of method for scheduling task, device, medium and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968472A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Process processing method and device, storage medium and processor
CN114138371A (en) * 2021-12-02 2022-03-04 北京天融信网络安全技术有限公司 Configuration dynamic loading method and device, computer equipment and storage medium
CN114138371B (en) * 2021-12-02 2024-02-06 北京天融信网络安全技术有限公司 Configuration dynamic loading method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111309456B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
US10152382B2 (en) Method and system for monitoring virtual machine cluster
US10509680B2 (en) Methods, systems and apparatus to perform a workflow in a software defined data center
US11526386B2 (en) System and method for automatically scaling a cluster based on metrics being monitored
CN107016480B (en) Task scheduling method, device and system
CN110830283B (en) Fault detection method, device, equipment and system
US10747529B2 (en) Version management system and version management method
CN111857998A (en) Configurable timing task scheduling method and system
CN111309456B (en) Task execution method and system
CN111565135A (en) Method for monitoring operation of server, monitoring server and storage medium
CN107508700B (en) Disaster recovery method, device, equipment and storage medium
CN112732674A (en) Cloud platform service management method, device, equipment and readable storage medium
US8468386B2 (en) Detecting and recovering from process failures
CN110798339A (en) Task disaster tolerance method based on distributed task scheduling framework
JPH11259326A (en) Hot standby system, automatic re-execution method for the same and storage medium therefor
US8677323B2 (en) Recording medium storing monitoring program, monitoring method, and monitoring system
CN105025179A (en) Method and system for monitoring service agents of call center
JP2001022709A (en) Cluster system and computer-readable storage medium storing program
CN115712521A (en) Cluster node fault processing method, system and medium
CN114816866A (en) Fault processing method and device, electronic equipment and storage medium
CN112231601B (en) Link management method, device, equipment and computer storage medium
CN111610992B (en) Deployment component update processing method and device and storage medium
CN110188008B (en) Job scheduling master-slave switching method and device, computer equipment and storage medium
JP6856574B2 (en) Service continuation system and service continuation method
CN111240857B (en) Remote service calling system and method
CN115801564A (en) Service deployment method, service deployment device, equipment and medium

Legal Events

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