CN106250254B - A kind of task processing method and system - Google Patents

A kind of task processing method and system Download PDF

Info

Publication number
CN106250254B
CN106250254B CN201610578726.2A CN201610578726A CN106250254B CN 106250254 B CN106250254 B CN 106250254B CN 201610578726 A CN201610578726 A CN 201610578726A CN 106250254 B CN106250254 B CN 106250254B
Authority
CN
China
Prior art keywords
processing
task
message
node
nth
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.)
Active
Application number
CN201610578726.2A
Other languages
Chinese (zh)
Other versions
CN106250254A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610578726.2A priority Critical patent/CN106250254B/en
Publication of CN106250254A publication Critical patent/CN106250254A/en
Application granted granted Critical
Publication of CN106250254B publication Critical patent/CN106250254B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • 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/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. 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/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

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

Abstract

The embodiment of the present invention provides a kind of task processing method and system, wherein, the described method includes: the n-th processing node, which obtains the n-th task from message channel, handles message, and message is handled according to n-th task and executes the n-th predetermined operation, feedback message is sent to the message channel according to the implementing result of the n-th predetermined operation;When n-th predetermined operation execution is correct, the (n+1)th processing node is obtained the (n+1)th task formed based on the feedback message from the message channel and handles message, and handles message the (n+1)th predetermined operation of execution according to (n+1)th task;Wherein, the (n+1)th processing node is next running node of the n-th processing node;N-th predetermined operation and (n+1)th predetermined operation are to respond the response operation of same task requests;The n is the positive integer less than N;The N is the total number of the processing node of the response task requests.

Description

Task processing method and system
Technical Field
The invention relates to the technical field of computers, in particular to a task processing method and system.
Background
Some existing systems including multiple subsystem interactions generally perform a process from beginning to end, and interactions between nodes are invoked by contexts of programs. However, if an exception occurs in the execution of a certain node during the task execution, the system cannot acquire exception information. When the task fails, the data cannot be completely rolled back; in addition, since decoupling cannot be performed between nodes, the upgrading of a certain node code necessarily affects the execution of the task.
Disclosure of Invention
Accordingly, embodiments of the present invention are directed to a task processing method and system, which can solve at least one of the above problems.
The technical scheme of the invention is realized as follows:
the embodiment of the invention provides a task processing method, which is applied to a task processing system comprising a message channel and a plurality of processing nodes connected with the message channel, and comprises the following steps:
the nth processing node acquires an nth task processing message from a message channel, executes an nth preset operation according to the nth task processing message, and sends a feedback message to the message channel according to an execution result of the nth preset operation; wherein the nth predetermined operation is one or more predetermined sub-operations performed by the nth processing node;
when the nth predetermined operation is executed correctly, the (n + 1) th processing node acquires an (n + 1) th task processing message formed based on the feedback message from the message channel and executes the (n + 1) th predetermined operation according to the (n + 1) th task processing message;
wherein the n +1 th processing node is a next operation node of the nth processing node; the nth preset operation and the (n + 1) th preset operation are response operations for responding to the same task request; n is a positive integer less than N; the N is the total number of processing nodes responding to the task request;
and when the n-th preset operation is executed in error, the abnormal processing node acquires an abnormal task processing message formed based on the feedback message from the message channel and executes abnormal processing operation according to the abnormal task processing message.
An embodiment of the present invention provides a task processing system, where the system includes:
the message channel is used for transmitting messages;
the nth processing node is connected with the message channel and used for acquiring the nth task processing message from the message channel, executing nth preset operation according to the nth task processing message and sending feedback message to the message channel according to the execution result of the nth preset operation; wherein the nth predetermined operation is one or more predetermined sub-operations performed by the nth processing node;
the (n + 1) th processing node is connected with the message channel and used for acquiring an (n + 1) th task processing message formed based on the feedback message from the message channel when the n-th scheduled operation is executed correctly, and executing the (n + 1) th scheduled operation according to the (n + 1) th task processing message; wherein the n +1 th predetermined operation is one or more predetermined sub-operations performed by the n +1 th processing node; wherein the n +1 th processing node is a next operation node of the nth processing node; the nth preset operation and the (n + 1) th preset operation are response operations for responding to the same task request; n is a positive integer less than N; the N is the total number of processing nodes responding to the task request;
and the exception handling node is connected with the message channel and used for acquiring an exception task handling message formed based on the feedback message from the message channel when the nth preset operation is wrong in execution and executing exception handling operation according to the exception task handling message.
By adopting the technical scheme of the embodiment of the invention, as the nth processing node and the (n + 1) th processing node which respond to the same task request, the nth processing node and the (n + 1) th processing node only need to acquire the task processing message from the message channel, then execute the corresponding preset operation according to the task processing message acquired from the message channel, and feed back the execution result of executing the corresponding preset operation to the message channel, so that the nth processing node is not required to directly send the task processing message to the (n + 1) th processing node, and the nth processing node and the (n + 1) th processing node are not required to be mutually called. Compared with the prior art that the nth processing node and the (n + 1) th processing node are mutually called through the context of a program, and a system cannot acquire abnormal information when an error occurs, the method introduces the abnormal processing node to be responsible for processing the abnormal event, and because the information is transmitted between different processing nodes through the information channel, one processing node does not directly give the next processing node; thus, when an error occurs, the exception handling node can acquire a processing message transmitted between the two processing nodes from the message channel to perform error analysis; the problem that the system cannot acquire abnormal information due to strong coupling between different processing nodes in the prior art is at least solved.
Drawings
Fig. 1 is a schematic flow chart illustrating an implementation of a task processing method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating three processing nodes executing a task request according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating delivery of task processing messages to processing nodes according to an embodiment of the present invention;
FIG. 4 is another schematic diagram of delivering task processing messages to processing nodes according to an embodiment of the present invention;
FIG. 5 is another diagram illustrating three processing nodes executing a task request according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating three processing nodes performing exception handling for a task request according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating query task execution according to an embodiment of the present invention;
FIG. 8 is another diagram illustrating query task execution according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a debugging node backing up task processing messages of each processing node according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a task processing system according to an embodiment of the present invention;
FIG. 11 is a diagram of an alternative hardware configuration of a server for implementing a task processing system according to an embodiment of the present invention;
fig. 12 is a schematic hardware structure diagram of a task processing system according to an embodiment of the present invention;
fig. 13 is an operation and maintenance flow architecture diagram of a task processing system according to an embodiment of the present invention.
Detailed Description
The technical solution of the present invention is further elaborated below with reference to the drawings and the specific embodiments.
Example one
An embodiment of the present invention provides a task processing method, which may be applied to a server side, as shown in fig. 1, and the method mainly includes:
step 101: the nth processing node acquires the nth task processing message from the message channel, executes nth preset operation according to the nth task processing message, and sends feedback message to the message channel according to the execution result of the nth preset operation.
Wherein N is a positive integer less than N; and N is the total number of processing nodes responding to a task request.
The nth task processing message comprises an operation required to be executed by the nth processing node in response to a task request and a parameter corresponding to the operation.
Here, the operation to be performed refers to a step that the nth processing node needs to perform in response to a task request. The parameter refers to a parameter used by the nth processing node for responding to a step required to be executed by a task request; wherein the parameter may include a processing result of a processing node immediately preceding the nth processing node.
For example, the content required to be executed includes: an nth predetermined operation; the nth predetermined operation is a response operation in response to the task request.
Wherein the nth predetermined operation is one or more predetermined sub-operations performed by the nth processing node.
That is, the nth processing node supports the execution of at least one predetermined sub-operation, and different functions can be implemented when the nth processing node executes different predetermined sub-operations.
For example, there are 2 processing nodes, each capable of performing a plurality of predetermined sub-operations. The 1 st processing node may support two predetermined sub-operations S1, S2; the preset sub-operation of S1 is to obtain login information, and the preset sub-operation of S2 is to judge whether to allow entering an account system according to an authentication result; the 2 nd processing node may support two predetermined sub-operations S3, S4; the predetermined sub-operation of S3 is to authenticate the login information and return the authentication result; s4 specifies a sub-operation to establish a correspondence between the account and the password. Then, when receiving a task request for logging in a certain account, the 1 st processing node performs S1 predetermined operation, that is, acquires login information; the 2 nd processing node executes S3 predetermined operation, namely, the login information is authenticated; the 2 nd processing node executes S3 preset operation, namely, the login information is authenticated, and an authentication result is returned; the 3 rd processing node executes the predetermined operation of S2, that is, determines whether to allow entering into a certain account system according to the authentication result. To this end, the task request can be completed by the 1 st processing node and the 2 nd processing node executing the respective predetermined sub-operations.
In this embodiment, the message channel is configured to store task processing messages of each processing node, and is further configured to receive feedback messages of each processing node. For example, the message channel includes various transmission channels such as a message queue, a data bus, and the like. Preferably, the message channel includes a message queue, which is a container for holding messages during transmission of the messages.
In an optional embodiment, the message channel includes a plurality of sub-message channels, each processing node corresponds to one sub-message channel, and each processing node can obtain a task processing message from the corresponding sub-message channel and send a feedback message to the corresponding sub-message channel; the plurality of sub-message channels are all connected with a total message channel, and the total message channel takes out feedback messages from all the sub-message channels, distributes and sends task processing messages to all the sub-message channels based on the feedback messages. In this way, since the sub-message channels are independent from each other, each processing node can identify and acquire the task processing message corresponding to the processing node.
Step 102: and when the n-th scheduled operation is executed correctly, the n + 1-th processing node acquires an n + 1-th task processing message formed based on the feedback message from the message channel, and executes the n + 1-th scheduled operation according to the n + 1-th task processing message.
Wherein the n +1 th predetermined operation is one or more predetermined sub-operations performed by the n +1 th processing node.
Wherein the n +1 th processing node is a processing node next to the nth processing node; the nth predetermined operation and the (n + 1) th predetermined operation are response operations for responding to the same task request.
For example, a task request requires the processing nodes a, B, and C to complete cooperatively. Each processing node can implement different functions, for example, the a processing node can execute three predetermined operations a1, a2 and A3, and the response results brought by the different predetermined operations are different; the B processing node can execute four predetermined operations B1, B2, B3 and B4, and response results brought by different predetermined operations are different; the C processing node can execute three predetermined operations of C1, C2 and C3, and response results brought by different predetermined operations are different.
As shown in fig. 2, when a task request is executed, the a processing node needs to perform a3 predetermined operation, the B processing node needs to perform B2 predetermined operation, and the C processing node needs to perform C1 predetermined operation; and the execution sequence is a3 predetermined operation, B2 predetermined operation, C1 predetermined operation. Therefore, the a processing node acquires the a task processing message from the message channel, the B processing node acquires the B task processing message from the message channel when the result of the execution of the predetermined operation of the a3 by the a processing node is correct, the C processing node acquires the C task processing message from the message channel when the result of the execution of the predetermined operation of the B2 by the B processing node is correct, and the task requests the completion of the execution when the result of the execution of the predetermined operation of the C1 by the C processing node is correct.
As another example, task request 1 requires the use of the A processing node, B processing node, C processing node shown in FIG. 2, and requires the A processing node to perform the A3 predetermined operation, the B processing node to perform the B2 predetermined operation, and the C processing node to perform the C1 predetermined operation; the task request 4 needs to use the A processing node and the B processing node shown in FIG. 2, and needs the A processing node to execute the A2 predetermined operation and needs the B processing node to execute the B1 predetermined operation; if the task request 1 is executed, the predetermined operation of the a3 executed by the a processing node is correctly executed, the predetermined operation of the B2 executed by the B processing node is correctly executed, at this time, the C processing node is in an upgrade state, and the task request 1 cannot be completed temporarily, and at this time, because the task processing message is distributed through the message channel, the task processing message can be continuously sent to the C processing node or the standby C processing node after a period of time. And while the task 1 is executed, distributing a task processing message for executing the predetermined operation A2 to the A processing node through the message channel, and after the A processing node correctly distributes and executes the predetermined operation A2, distributing a task processing message for executing the predetermined operation B1 to the B processing node. Obviously, the execution of task request 1 does not constitute an impact on the execution of task request 2.
In an optional implementation manner, after the sending the feedback message to the message channel according to the execution result of the nth predetermined operation, the method further includes:
the control node judges whether the execution result of the nth preset operation is executed correctly or not based on the feedback message, wherein the feedback message comprises the execution result of the nth preset operation;
and when the n-th scheduled operation is executed correctly, the task processing clearing way based on the task request sends an n + 1-th task processing message formed based on the feedback message to the message channel.
Wherein the feedback message includes a result of the execution of the nth predetermined operation.
Wherein the n +1 th task processing message includes an n +1 th predetermined operation performed by the n +1 th processing node, and the n +1 th task processing message is determined by the control node based on a task processing list.
The task processing list comprises N processing nodes for executing the task request and an execution sequence of predetermined operations executed by the N processing nodes.
As shown in fig. 3, when a system receives a task request, a control node formulates a task processing list according to the task request, allocates task processing messages to each processing node based on the task processing list, and receives feedback messages returned by each processing node;
that is, it is determined by the control node whether the execution result of the nth predetermined operation by the nth processing node is executed correctly, and the execution result of the nth processing node does not need to be determined. The nth processing node only needs to acquire the predetermined operation to be executed by the nth processing node and the execution parameter to be returned by the nth processing node from the nth task processing message without concern of who the next node is operated by.
In another optional embodiment, the method further comprises:
the nth processing node judges whether the nth preset operation is executed correctly;
when the nth preset operation is executed correctly, feeding back a first type of message to the message channel according to the execution result of the nth preset operation; the first type of message comprises an execution result of the nth processing node, a node identifier of the (n + 1) th processing node determined by the nth processing node according to a task processing list, and the task processing list; the task processing list comprises node identifiers of processing nodes involved in executing the task request, an execution sequence among the processing nodes and a preset operation.
As shown in fig. 4, when a system receives a task request, a control node formulates a task processing list according to the task request, and sends the task processing list to a first processing node in the task processing list through a message channel, and then directly sends a first type of message fed back by the first processing node as a task processing message of a next processing node to the next processing node designated by the first processing node through the message channel, and so on, the control node does not need to determine the task processing message of the next processing node according to feedback information of each processing node.
That is to say, the nth processing node determines whether the execution result of the nth predetermined operation executed by the nth processing node is executed correctly, the nth processing node determines who the next processing node is according to the task processing list and designates to send the first type of message to the determined nth +1 processing node, and the control node only needs to send the encapsulated first type of message to the nth +1 processing node through the message channel according to the delivery object designated by the nth processing node.
Step 103: and when the n-th preset operation is executed in error, the abnormal processing node acquires an abnormal task processing message formed based on the feedback message from the message channel and executes abnormal processing operation according to the abnormal task processing message.
Therefore, the task request for processing the exception can be processed in time by processing the task request for processing the exception through a special processing node. The task request with abnormal execution is processed through a special processing node, so that the problem with abnormal execution can be found in time, and the problem can be responded in time according to the problem. For example, the exception handling node sends the task processing message corresponding to the processing node with the problem to another standby processing node capable of executing the task processing message through a message channel, so that when the execution result of the standby processing node is correct, the task request can be continuously executed, and the task request is not aborted due to an error occurring in a middle link.
For example, the task request 1 and the task request 2 both need to use the processing node a, the processing node B, and the processing node C shown in fig. 2; and the B processing nodes are all required to execute the predetermined operation of B2, if the predetermined operation of B2 is abnormal when the task request 1 is executed, the execution progress of the task request 2 is affected if the data generated by the task request 1 is not cleaned in time. And the abnormal processing node is adopted to specially process the abnormal task processing message, and the data generated by the task request 1 is processed in time, so that the execution of the task request 2 is not greatly influenced.
As another example, task request 1 requires the use of the A processing node, B processing node, C processing node shown in FIG. 2, and requires the A processing node to perform the A3 predetermined operation, the B processing node to perform the B2 predetermined operation, and the C processing node to perform the C1 predetermined operation; if the B processing node performs the B2 scheduled operation and an exception occurs while executing the task request 1, the exception handling node may send a notification message channel to the standby B ' processing node to notify the B ' processing node of performing the B2 scheduled operation, so that when the execution result of the B ' processing node performing the B2 scheduled operation is correct, the C processing node can continue to perform the C1 scheduled operation, and thus the task request 1 cannot continue to be executed due to an error in the execution result of the B processing node.
Here, the step 102 and the step 103 are in parallel. After step 101, if the nth predetermined operation is executed correctly, step 102 is executed; if the nth predetermined operation is performed incorrectly, go to step 103.
In an optional implementation manner, after the sending the feedback message to the message channel according to the execution result of the nth predetermined operation, the method further includes:
the control node judges whether the execution result of the nth preset operation is executed correctly or not based on the feedback message, wherein the feedback message comprises the execution result of the nth preset operation;
when the n-th preset operation is executed in error, the control node informs an exception handling node in the system, and the exception handling node sends an exception task handling message formed based on the feedback message to the message channel based on a task handling list; the task processing list comprises N processing nodes for executing the task request and an execution sequence of predetermined operations executed by the N processing nodes.
In another optional embodiment, the method further comprises:
the nth processing node judges whether the nth preset operation is executed correctly;
when the execution of the nth preset operation is abnormal, feeding back a second type of message to the message channel according to the execution result of the nth preset operation; the second type of message comprises an execution result of the nth processing node, an exception processing node determined by the nth processing node and the task processing list;
and the abnormal processing node determined by the nth processing node sends an abnormal task processing message formed based on the second type of message to the message channel based on the task processing clearing way.
Here, the exception handling node in the system may be plural.
Continuing to execute a task request, the A processing node needs to execute the A3 predetermined operation, the B processing node needs to execute the B2 predetermined operation, and the C processing node needs to execute the C1 predetermined operation; and the execution sequence is a3 predetermined operation, B2 predetermined operation, C1 predetermined operation as an example. As shown in fig. 5, the a processing node acquires an a task processing message from the message channel, the B processing node acquires a B task processing message from the message channel when the execution result of the a processing node performing the a3 predetermined operation is correct, the C processing node acquires a C task processing message from the message channel when the execution result of the B processing node performing the B2 predetermined operation is correct, and the exception processing node acquires an exception task processing message formed based on a feedback message of the C processing node from the message channel and performs an exception processing operation according to the exception task processing message when the execution result of the C processing node performing the C1 predetermined operation is an execution error.
In one embodiment, the exception task processing message formed based on the feedback message includes:
determining each processing node which needs to execute the exception processing operation and the order of executing the exception processing.
For example, the exception handling operation includes: deleting data generated during the execution of the task request.
In this way, when the same storage space is reused, it is convenient that data related to the task request generated previously interferes with the currently executed task request when other task requests are executed or when the task request is re-executed.
For another example, the exception handling operation includes: a rollback operation is performed.
Here, the rollback operation refers to an action of restoring the program or data to the last correct state.
Continuing to execute a task request, the A processing node needs to execute the A3 predetermined operation, the B processing node needs to execute the B2 predetermined operation, and the C processing node needs to execute the C1 predetermined operation; and the execution sequence is a3 predetermined operation, B2 predetermined operation, C1 predetermined operation as an example. When the execution result of the predetermined operation of the a processing node a3 is correct, the execution result of the predetermined operation of the B processing node B2 is correct, and the execution result of the predetermined operation of the C1 is an execution error, the exception processing node acquires an exception task processing message formed based on the feedback message of the C processing node from the message channel, and executes a rollback operation according to the exception task processing message, and the exception processing node acquires an exception task processing message formed based on the feedback message of the C processing node from the message channel, and executes an exception processing operation according to the exception task processing message, wherein the exception task processing message comprises: the C processing node needs to execute E1 predetermined operation, the B processing node needs to execute E1 predetermined operation, and the A processing node needs to execute E1 predetermined operation; and the execution sequence is C processing node, B processing node, A processing node, wherein, the E1 predetermined operation represents a rollback operation; when the C processing node finishes the E1 scheduled operation, the B processing node finishes the E1 scheduled operation, and when the A processing node finishes the E1 scheduled operation, the rollback operation for the task request is completed.
In an optional embodiment, the order of executing exception handling is: and taking the processing node with the exception currently executing the task request as a starting point, and sequencing according to the reverse order mode of the execution order of each processing node executing the task request.
For example, as shown in fig. 6, the exception handling node obtains, from the message channel, an exception task handling message formed based on a feedback message of the C processing node, and performs an exception handling operation according to the exception task handling message, where the exception task handling message includes: the C processing node needs to execute E1 predetermined operation, the B processing node needs to execute E1 predetermined operation, and the A processing node needs to execute E1 predetermined operation; and the execution sequence is C processing node, B processing node and A processing node. As shown in fig. 6, the C processing node acquires the C exception task processing message from the message channel, the B processing node acquires the B exception task processing message from the message channel when the C processing node completes the E1 predetermined operation, the a processing node acquires the a exception task processing message from the message channel when the B processing node completes the E1 predetermined operation, and the exception processing operation for the task request is completed when the a processing node completes the E1 predetermined operation.
In the foregoing scheme, optionally, the method further includes:
and sending the processing result of each processing node to a storage device, wherein the processing result stored in the storage device is used for responding to an inquiry request for inquiring the execution of the task request.
In the foregoing scheme, optionally, the method further includes:
when a system receives a task request, a control node estimates the time required for completing the task request;
when the required time is greater than or equal to a preset time threshold, allocating a task identification code for the client sending the task request; and the task identification code is used for inquiring the processing result of the task request.
Therefore, when the time required for completing the task request sent by the client is long, a task identification code can be allocated to the client, and the client is reminded of inquiring the execution condition of the task request according to the task identification code after a long time.
Of course, in a specific embodiment, when the required time is less than the preset time threshold, the task identifier is not allocated to the client sending the task request.
Or, in a specific embodiment, a task identification code is allocated to the client sending the task request, but the task identification code is not sent to the client.
In an embodiment, the method further comprises:
detecting a query request sent by a client;
and responding to the query request, and sending execution state information to the client according to the processing result stored in the storage device.
In a specific embodiment, the detecting a query request sent by a client includes: and the storage equipment receives a query request carrying the task identification code from the client. Correspondingly, the obtaining a processing result from the storage device in response to the query request includes: and the storage equipment inquires a processing result corresponding to the task identification code according to the task identification code. Here, the storage device stores a correspondence relationship between the task identification code and the processing result.
As shown in fig. 7, the client M sends an inquiry request related to the task request 1 to the storage device, and after receiving the inquiry request, the storage device inquires a processing result corresponding to the task identifier of the client M from the storage device, and returns the execution state information to the client M.
Therefore, the client can directly interact with the storage device query without querying by a third party, the processing result of the task request is queried from the storage device through the task identification code, the client is convenient to query, and the convenience of querying the task execution result is improved.
In another specific embodiment, the detecting a query request sent by a client includes: the predetermined interface receives a query request carrying identification information of the client from the client. Correspondingly, the obtaining a processing result from the storage device in response to the query request includes: and inquiring a processing result corresponding to the identification information, and returning the execution state information to the client. Here, the storage device stores a correspondence relationship between client identification information and a processing result.
As shown in fig. 8, the client a sends an inquiry request related to the task request 1 to the predetermined interface, and after receiving the inquiry request, the predetermined interface inquires a processing result corresponding to the identification information of the client a from the storage device and returns the execution state information to the client a.
Therefore, the client cannot directly interact with the storage device query, the processing result of the task request is queried from the storage device through the preset interface, the execution state information is sent to the client through the preset interface, and the security of data stored in the storage device can be improved due to the fact that the client cannot be in contact with the storage device.
In the foregoing scheme, optionally, the method further includes:
the debugging node backs up all the processing messages in the message channel; wherein the backup processing message is used for debugging errors.
As shown in fig. 9, the Debug node includes processing messages of each backup processing node, and provides a window for observing system operation, which is convenient for a worker to develop and Debug, for example, the processing messages of the backup in the Debug node are operated in Debug, and a programmed program is checked for bugs, so as to eliminate errors or bugs as much as possible.
In the technical solution of this embodiment, as the nth processing node and the (n + 1) th processing node that respond to the same task request, the nth processing node and the (n + 1) th processing node acquire a task processing message from a message channel, and execute a corresponding predetermined operation according to the task processing message acquired from the message channel, without interaction and call between the nth processing node and the (n + 1) th processing node, thereby solving a strong coupling problem between different processing nodes in the prior art, and facilitating subsequent maintenance of each processing node; meanwhile, the abnormal task request is processed by the abnormal processing node, so that various abnormal conditions can be processed in time, for example, complete data rollback can be realized, namely, data generated in the process of executing the task request is deleted.
Example two
An embodiment of the present invention provides a task processing system, as shown in fig. 10, the system includes:
the nth processing node 10 is configured to acquire an nth task processing message from a message channel, execute an nth predetermined operation according to the nth task processing message, and send a feedback message to the message channel according to an execution result of the nth predetermined operation; wherein the nth predetermined operation is one or more predetermined sub-operations performed by the nth processing node;
the (n + 1) th processing node 20 is configured to, when the n-th predetermined operation is correctly executed, acquire an (n + 1) th task processing message formed based on the feedback message from the message channel, and execute the (n + 1) th predetermined operation according to the (n + 1) th task processing message; wherein the n +1 th predetermined operation is one or more predetermined sub-operations performed by the n +1 th processing node;
wherein the n +1 th processing node is a next operation node of the nth processing node; the nth preset operation and the (n + 1) th preset operation are response operations for responding to the same task request; n is a positive integer less than N; and N is the total number of processing nodes responding to the task request.
And the exception handling node 30 is configured to, when the nth predetermined operation is in error, acquire an exception task handling message formed based on the feedback message from the message channel, and perform an exception handling operation according to the exception task handling message.
In an optional embodiment, the system further comprises:
a control node 40 for:
after the nth processing node sends a feedback message to the message channel according to the execution result of the nth predetermined operation, judging whether the execution result of the nth predetermined operation is executed correctly based on the feedback message, wherein the feedback message comprises the execution result of the nth predetermined operation;
when the nth scheduled operation is executed correctly, a task processing clearing way based on the task request sends an n +1 th task processing message formed based on the feedback message to the message channel; the task processing list comprises N processing nodes for executing the task request and an execution sequence of predetermined operations executed by the N processing nodes;
and when the n-th predetermined operation is in error, notifying the exception handling node 30, and sending an exception task handling message formed based on the feedback message to the message channel by the exception handling node 30 based on the task cleaning.
In a specific embodiment, the nth processing node 10 is further configured to:
judging whether the nth preset operation is executed correctly;
when the nth preset operation is executed correctly, feeding back a first type of message to the message channel according to the execution result of the nth preset operation; the first type of message comprises an execution result of the nth processing node, a node identifier of the (n + 1) th processing node determined by the nth processing node according to a task processing list, and the task processing list; the task processing list comprises node identifiers of processing nodes involved in executing the task request, an execution sequence among the processing nodes and a preset operation.
In another specific embodiment, the nth processing node 10 is further configured to:
judging whether the nth preset operation is executed correctly;
when the execution of the nth preset operation is abnormal, feeding back a second type of message to the message channel according to the execution result of the nth preset operation; the second type message comprises an execution result of the nth processing node, an exception processing node determined by the nth processing node and the task processing list.
In a specific embodiment, the exception handling node 30 is further configured to:
determining each processing node which needs to execute the exception processing operation and the order of executing the exception processing.
In an optional embodiment, the system further comprises:
the storage device 50 is configured to store processing results sent by each processing node, store the processing results in the storage device, and respond to an inquiry request for inquiring about execution of the task request.
In an optional embodiment, the system further comprises:
the detection node 60 is used for detecting the query request sent by the client;
and the response node 70 is configured to respond to the query request and send execution state information to the client according to the processing result stored in the storage device.
In a specific embodiment, the system further comprises:
an allocation node 80 for:
estimating the time required for completing the task request when the task request is received;
when the required time is greater than or equal to a preset time threshold, allocating a task identification code for the client sending the task request; and the task identification code is used for inquiring the processing result of the task request.
In a specific embodiment, the detection node 60 is further configured to receive, from a client, a query request carrying the task identifier through a storage device;
the response node 70 is further configured to query, through the storage device, a processing result corresponding to the task identification code according to the task identification code.
In another specific embodiment, the detection node 60 is further configured to receive, from a client, a query request carrying identification information of the client through a predetermined interface;
the response node 70 is further configured to query a processing result corresponding to the identification information through the predetermined interface, and return the execution state information to the client.
In an optional embodiment, the system further comprises:
the debugging node 90 is used for backing up all processing messages in the message channel; wherein the backup processing message is used for debugging errors.
Those skilled in the art should understand that the functions of each node in the task processing system of the present embodiment can be understood by referring to the related description of the task processing method.
In practical applications, the specific structures of the nth processing node 10, the n +1 th processing node 20, the exception handling node 30, the control node 40, the detection node 60, the response node 70, the distribution node 80, and the debug node 90 may all correspond to a processor or a server. The specific structure of the processor may be a Central Processing Unit (CPU), a Micro Controller Unit (MCU), a Digital Signal Processor (DSP), a Programmable Logic Controller (PLC), or other electronic components or a collection of electronic components having a Processing function. The processor includes executable codes, the executable codes are stored in a storage medium, the processor can be connected with the storage medium through a communication interface such as a bus, and when the corresponding functions of specific units are executed, the executable codes are read from the storage medium and executed. The portion of the storage medium used to store the executable code is preferably a non-transitory storage medium. The storage device 50 may be various types of memories or servers having a storage function, such as a database.
In practical applications, each functional module in the task processing system may be implemented cooperatively by hardware resources in the server, such as computing resources such as a processor, and communication resources (e.g., for supporting communication in various manners).
Fig. 11 illustrates an alternative hardware configuration of the server, which includes a processor 11, an input/output interface 13 (e.g., a display screen, a touch screen, a speaker), a storage medium 14, and a network interface 12, which may be communicatively coupled via a system bus 15. Accordingly, the storage medium 14 of the server 10 stores therein executable instructions for executing the task processing method provided by the embodiment of the present invention.
The storage medium 14 may be any medium capable of storing program codes, such as a removable storage device, a Random Access Memory (RAM), a Read-Only Memory (ROM), a magnetic disk, or an optical disk. Preferably, the storage medium 14 may be a non-volatile storage medium.
The processor 11 may be a CPU, an MCU, a DSP, a PLC, or a processing circuit, such as an Application Specific Integrated Circuit (ASIC).
Specifically, the processor 11 reads and executes the executable instructions of the task processing method from the storage medium 14 through the system bus 15, and may perform the following steps:
informing an nth processing node to acquire an nth task processing message from a message channel, executing an nth preset operation according to the nth task processing message, and sending a feedback message to the message channel according to an execution result of the nth preset operation; wherein the nth predetermined operation is one or more predetermined sub-operations performed by the nth processing node; when the n-th scheduled operation is executed correctly, informing the n + 1-th processing node to acquire an n + 1-th task processing message formed based on the feedback message from the message channel, and executing the n + 1-th scheduled operation according to the n + 1-th task processing message; wherein the n +1 th predetermined operation is one or more predetermined sub-operations performed by the n +1 th processing node; when the n-th preset operation is executed in error, informing an exception processing node to acquire an exception task processing message formed based on the feedback message from the message channel, and executing exception processing operation according to the exception task processing message; wherein the n +1 th processing node is a next operation node of the nth processing node; the nth preset operation and the (n + 1) th preset operation are response operations for responding to the same task request; n is a positive integer less than N; and N is the total number of processing nodes responding to the task request.
The task processing system of the embodiment solves the problem of strong coupling between different processing nodes in the prior art, thereby being beneficial to the subsequent maintenance of each processing node; meanwhile, the abnormal task request is processed by the abnormal processing node, so that various abnormal conditions can be processed in time, for example, complete data rollback can be realized, namely, data generated in the process of executing the task request is deleted.
EXAMPLE III
The task processing system may be implemented by hardware, and fig. 11 is a schematic diagram of a hardware structure of the task processing system, as shown in fig. 11, including a plurality of servers and a plurality of storage devices; wherein,
the servers are classified into a plurality of categories including:
the first type of server is a distribution node, a server a in the graph represents the distribution node, and the distribution node is responsible for estimating the time required for completing the task request when receiving the task request sent by the client; when the required time is greater than or equal to a preset time threshold, allocating a task identification code for the client sending the task request; the task identification code is used for inquiring the processing result of the task request;
the second type of server is a control node, a server b in the graph represents the control node, and the control node is responsible for managing the message channel; the system is also responsible for generating a task processing list based on a task request sent by a client and distributing task processing messages to each processing node through a message channel; acquiring feedback messages sent to the message channel by each processing node;
the third type of server is a conventional processing node, wherein the servers n and n +1 in the graph represent the nth processing node and the n +1 th processing node which respond to the same task request, and the nth processing node and the n +1 th processing node are responsible for acquiring task processing messages from the message channel, executing corresponding preset operation according to the task processing messages acquired from the message channel, and sending feedback messages to the message channel according to the execution result of the preset operation;
the fourth type of server is an exception handling node, and a server c in the graph represents the exception handling node; the exception handling node is responsible for acquiring exception task handling information formed by feedback information for executing errors based on the execution result of the predetermined operation from the information channel when the execution result of the predetermined operation executed by the nth processing node or the (n + 1) th processing node is the execution error, and executing exception handling operation according to the exception task handling information;
the fifth type of server is a detection node, and a server d in the graph represents the detection node; the detection node is responsible for detecting a query request sent by the client;
the sixth type of server is a response node, and a server e in the graph represents the response node; the response node is responsible for responding to the query request and sending execution state information to the client according to the processing result stored in the first storage device;
the seventh type of server is a debugging node, and a server f in the graph represents the debugging node; the debugging node is responsible for debugging according to the processing message in the message channel backed up in the second storage device;
the first storage device is used for storing processing results sent by each processing node, the processing results stored in the storage device are used for responding to a query request for querying the execution of the task request;
and the second storage device is used for backing up all the processing messages in the message channel so as to debug the debugging node.
As can be seen from fig. 11, the client can interact with the first storage device through the detection node and the response node according to the task identification code allocated to the client by the allocation node, and query the processing result of the task request from the storage device through the task identification code, thereby facilitating the query of the client and improving the convenience of querying the task execution result. The nth processing node and the (n + 1) th processing node which respond to the same task request only need to acquire the task processing message from the message channel, then execute corresponding preset operation according to the task processing message acquired from the message channel, and feed back an execution result of executing the corresponding preset operation to the message channel, and the nth processing node does not need to directly send the task processing message to the (n + 1) th processing node, and does not need to mutually call the nth processing node and the (n + 1) th processing node. The system is responsible for processing the abnormal event through the abnormal processing node, because the different processing nodes transmit the message through the message channel, and one processing node does not directly send the message to the next processing node; thus, when an error occurs, the exception handling node can acquire a processing message transmitted between the two processing nodes from the message channel to perform error analysis; the problem that the system cannot acquire abnormal information due to strong coupling between different processing nodes in the prior art is at least solved. The debugging node acquires the processing information of each backup processing node from the second processing equipment, and can provide a window for observing the operation of the system, thereby facilitating development, debugging and the like of workers.
Example four
Fig. 12 is an operation and maintenance flow architecture diagram of a task processing system according to an embodiment of the present invention, as shown in fig. 12, the architecture mainly includes three major parts:
the first part is an access stratum, which comprises: an interface and task request processing unit;
wherein, the interface is a functional interface provided by the whole system and used for a web page or other system calls.
The task request processing unit is responsible for analyzing the received task request and splitting the task request into a plurality of processing steps, wherein each processing step is realized by one processing module.
Specifically, the working principle of the task request processing unit is as follows: after receiving the function request, the function request is disassembled into the atomic interfaces of the internal subsystems in the processing module, and the atomic interfaces are arranged into ordered steps according to the task request, for example, the function request is disassembled into the step (step)1, step2 and step3, and is delivered to the message queue as a task processing message. Wherein the processing module comprises internal subsystems and an actuator.
Optionally, the task request processing unit is also responsible for assigning a task identification code. And the interface is also responsible for returning the task identification code to a calling party. For example, the caller is a client. The caller may query processing results based on the task identification code.
In practical application, the interface for receiving the task request and the interface for returning the processing result can be combined into one interface.
The second part is a transport layer comprising: a message queue;
the message queue is a channel for driving the whole system to operate. The processing modules communicate through a message queue.
The third part is an execution layer, which comprises: a conventional actuator, and a subsystem corresponding to the conventional actuator.
Wherein the conventional executors are atomic interface executors, and each conventional executor corresponds to one internal subsystem. Here, the atomic interface is an interface capable of feeding back information on success or failure of execution, and the information output by the atomic interface is explicit information.
The conventional executor is responsible for monitoring task processing messages belonging to the conventional executor in the message queue, and the task processing messages are delivered by the task request providing processing unit or other upstream conventional executors. After receiving the task processing message belonging to the conventional executor, performing personalized logic processing, and writing a processing result into a storage device such as a transcog for a calling party to inquire after the processing is completed; the conventional executor is also responsible for re-posting feedback messages into the message queue.
Optionally, the execution layer further comprises: exception handling Executor (Error Executor), backup Executor (Debug Executor).
And the exception handling executor is responsible for acquiring an exception task handling message formed based on the feedback message from the message channel and executing exception handling operation according to the exception task handling message.
All the conventional executors are executed in error, the receiver of the message is set as an exception handling executor, and the exception handling executor is responsible for determining exception task processing messages and re-delivering the exception task processing messages to the message queue. For example, when the third executor executes step3 and is abnormal, the third executor, the second executor and the first executor are informed to execute the rollback operation according to step3- > step2- > step1 in sequence.
In addition, the exception handling executor can be used as a window for observing system exception, logs do not need to be searched everywhere on each subsystem, and therefore nodes with exception can be located conveniently.
And the backup actuator is responsible for backing up all the processing messages in the message channel and is used for developing and debugging, and the backup actuator can also be used as a window for observing the operation of the whole large system.
The internal subsystem corresponding to the conventional actuator is an operation and maintenance system providing specific services, and is responsible for interacting with intelligent software, intelligent equipment, an intelligent robot, a computer system or the like to ensure that each step can be realized.
Optionally, the architecture further comprises:
a fourth section comprising: storage devices (e.g., TransLog).
The storage device is responsible for processing results sent by each executor, and the processing results stored in the storage device are used for responding to query requests for querying execution of the task requests.
In particular, the storage device may use nosql storage or DB storage.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media capable of storing program codes, such as a removable Memory device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, and an optical disk.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (22)

1. A task processing method is applied to a task processing system comprising a message channel and a plurality of processing nodes connected with the message channel, and comprises the following steps:
the nth processing node acquires an nth task processing message from a message channel, executes an nth preset operation according to the nth task processing message, and sends a feedback message to the message channel according to an execution result of the nth preset operation; wherein the nth predetermined operation is one or more predetermined sub-operations performed by the nth processing node;
when the nth predetermined operation is executed correctly, the (n + 1) th processing node acquires an (n + 1) th task processing message formed based on the feedback message from the message channel and executes the (n + 1) th predetermined operation according to the (n + 1) th task processing message; wherein the n +1 th predetermined operation is one or more predetermined sub-operations performed by the n +1 th processing node;
wherein the n +1 th processing node is a next operation node of the nth processing node; the nth preset operation and the (n + 1) th preset operation are response operations for responding to the same task request; n is a positive integer less than N; the N is the total number of processing nodes responding to the task request;
and when the n-th preset operation is executed in error, the abnormal processing node acquires an abnormal task processing message formed based on the feedback message from the message channel and executes abnormal processing operation according to the abnormal task processing message.
2. The method according to claim 1, wherein after sending the feedback message to the message channel according to the execution result of the nth predetermined operation, the method further comprises:
the control node judges whether the execution result of the nth preset operation is executed correctly or not based on the feedback message, wherein the feedback message comprises the execution result of the nth preset operation;
when the nth scheduled operation is executed correctly, a task processing clearing way based on the task request sends an n +1 th task processing message formed based on the feedback message to the message channel; the task processing list comprises N processing nodes for executing the task request and an execution sequence of predetermined operations executed by the N processing nodes;
and when the n-th preset operation is in error, sending an abnormal task processing message formed based on the feedback message to the message channel based on the task processing clearing way.
3. The method of claim 1, further comprising:
the nth processing node judges whether the nth preset operation is executed correctly;
when the nth preset operation is executed correctly, feeding back a first type of message to the message channel according to the execution result of the nth preset operation; the first type of message comprises an execution result of the nth processing node, a node identifier of the (n + 1) th processing node determined by the nth processing node according to a task processing list, and the task processing list; the task processing list comprises node identifiers of processing nodes involved in executing the task request, an execution sequence among the processing nodes and a preset operation.
4. The method of claim 1, further comprising:
the nth processing node judges whether the nth preset operation is executed correctly;
when the execution of the nth preset operation is abnormal, feeding back a second type of message to the message channel according to the execution result of the nth preset operation; the second type of message comprises an execution result of the nth processing node, an exception processing node determined by the nth processing node and a task processing list; the task processing list comprises node identifications of all processing nodes related to the task execution request, and execution sequence and preset operation among all the processing nodes.
5. The method of claim 1, wherein the exception task processing message formed based on the feedback message comprises:
determining each processing node which needs to execute the exception processing operation and the order of executing the exception processing.
6. The method of claim 1, further comprising:
and sending the processing result of each processing node to a storage device, wherein the processing result stored in the storage device is used for responding to an inquiry request for inquiring the execution of the task request.
7. The method of claim 6, further comprising:
detecting a query request sent by a client;
and responding to the query request, and sending execution state information to the client according to the processing result stored in the storage device.
8. The method of claim 7, further comprising:
estimating the time required for completing the task request when the task request is received;
when the required time is greater than or equal to a preset time threshold, allocating a task identification code for the client sending the task request; and the task identification code is used for inquiring the processing result of the task request.
9. The method of claim 8,
the detecting the query request sent by the client comprises the following steps:
the storage device receives a query request carrying the task identification code from a client;
the obtaining a processing result from the storage device in response to the query request includes:
the storage device inquires a processing result corresponding to the task identification code according to the task identification code; and the storage equipment stores the mapping relation between the task identification code and the processing result.
10. The method of claim 7,
the detecting the query request sent by the client comprises the following steps:
the method comprises the steps that a preset interface receives a query request carrying identification information of a client from the client;
the obtaining a processing result from the storage device in response to the query request includes:
inquiring a processing result corresponding to the identification information from the storage equipment through a preset interface, and returning execution state information to the client;
the storage device stores the mapping relation between the identification information of the client and the processing result.
11. The method of claim 1, further comprising:
the debugging node backs up all the processing messages in the message channel; wherein the backup processing message is used for debugging errors.
12. A task processing system, the system comprising:
the message channel is used for transmitting messages;
the nth processing node is connected with the message channel and used for acquiring the nth task processing message from the message channel, executing nth preset operation according to the nth task processing message and sending feedback message to the message channel according to the execution result of the nth preset operation; wherein the nth predetermined operation is one or more predetermined sub-operations performed by the nth processing node;
the (n + 1) th processing node is connected with the message channel and used for acquiring an (n + 1) th task processing message formed based on the feedback message from the message channel when the n-th scheduled operation is executed correctly, and executing the (n + 1) th scheduled operation according to the (n + 1) th task processing message; wherein the n +1 th predetermined operation is one or more predetermined sub-operations performed by the n +1 th processing node; wherein the n +1 th processing node is a next operation node of the nth processing node; the nth preset operation and the (n + 1) th preset operation are response operations for responding to the same task request; n is a positive integer less than N; the N is the total number of processing nodes responding to the task request;
and the exception handling node is connected with the message channel and used for acquiring an exception task handling message formed based on the feedback message from the message channel when the nth preset operation is wrong in execution and executing exception handling operation according to the exception task handling message.
13. The system of claim 12, further comprising:
a control node for:
after the nth processing node sends a feedback message to the message channel according to the execution result of the nth predetermined operation, judging whether the execution result of the nth predetermined operation is executed correctly based on the feedback message, wherein the feedback message comprises the execution result of the nth predetermined operation;
when the nth scheduled operation is executed correctly, a task processing clearing way based on the task request sends an n +1 th task processing message formed based on the feedback message to the message channel; the task processing list comprises N processing nodes for executing the task request and an execution sequence of predetermined operations executed by the N processing nodes;
and when the n-th preset operation is in error, sending an abnormal task processing message formed based on the feedback message to the message channel based on the task processing clearing way.
14. The system of claim 12,
the nth processing node is further configured to:
judging whether the nth preset operation is executed correctly;
when the nth preset operation is executed correctly, feeding back a first type of message to the message channel according to the execution result of the nth preset operation; the first type of message comprises an execution result of the nth processing node, a node identifier of the (n + 1) th processing node determined by the nth processing node according to a task processing list, and the task processing list; the task processing list comprises node identifiers of processing nodes involved in executing the task request, an execution sequence among the processing nodes and a preset operation.
15. The system of claim 12,
the nth processing node is further configured to:
judging whether the nth preset operation is executed correctly;
when the execution of the nth preset operation is abnormal, feeding back a second type of message to the message channel according to the execution result of the nth preset operation; the second type of message comprises an execution result of the nth processing node, an exception processing node determined by the nth processing node and a task processing list; the task processing list comprises node identifications of all processing nodes related to the task execution request, and execution sequence and preset operation among all the processing nodes.
16. The system of claim 12, wherein the exception handling node is further configured to:
determining each processing node which needs to execute the exception processing operation and the order of executing the exception processing.
17. The system of claim 12, further comprising:
and the storage device is used for storing the processing results sent by each processing node, storing the processing results in the storage device and responding to the query request for querying the execution of the task request.
18. The system of claim 17, further comprising:
the detection node is used for detecting the query request sent by the client;
and the response node is used for responding to the query request and sending execution state information to the client according to the processing result stored in the storage device.
19. The system of claim 18, further comprising:
an allocation node for:
estimating the time required for completing the task request when the task request is received;
when the required time is greater than or equal to a preset time threshold, allocating a task identification code for the client sending the task request; and the task identification code is used for inquiring the processing result of the task request.
20. The system of claim 19,
the detection node is also used for receiving a query request carrying the task identification code from a client through a storage device;
the response node is further used for inquiring a processing result corresponding to the task identification code through the storage equipment according to the task identification code; and the storage equipment stores the mapping relation between the task identification code and the processing result.
21. The system of claim 18,
the detection node is also used for receiving a query request carrying identification information of the client from the client through a preset interface;
the response node is further configured to query a processing result corresponding to the identification information from a storage device through the predetermined interface, and return execution state information to the client; the storage device stores the mapping relation between the identification information of the client and the processing result.
22. The system of claim 12, further comprising:
the debugging node is used for backing up all processing messages in the message channel; wherein the backup processing message is used for debugging errors.
CN201610578726.2A 2016-07-21 2016-07-21 A kind of task processing method and system Active CN106250254B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610578726.2A CN106250254B (en) 2016-07-21 2016-07-21 A kind of task processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610578726.2A CN106250254B (en) 2016-07-21 2016-07-21 A kind of task processing method and system

Publications (2)

Publication Number Publication Date
CN106250254A CN106250254A (en) 2016-12-21
CN106250254B true CN106250254B (en) 2019-02-22

Family

ID=57603719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610578726.2A Active CN106250254B (en) 2016-07-21 2016-07-21 A kind of task processing method and system

Country Status (1)

Country Link
CN (1) CN106250254B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218338B (en) * 2017-06-29 2021-05-25 北京京东尚科信息技术有限公司 Information processing system, method and device
CN108153596A (en) * 2017-12-15 2018-06-12 珠海金山网络游戏科技有限公司 A kind of message treatment method and device based on lock-free queue
CN110502317B (en) * 2018-05-16 2024-03-01 北京京东尚科信息技术有限公司 Transaction management method and device
CN109274755B (en) * 2018-10-12 2019-12-10 成都信息工程大学 longitudinal, transverse, bidirectional and cross-node cross collaborative interaction method based on multi-core cross-domain network
CN113467908B (en) * 2021-06-23 2024-02-20 深圳市蘑菇财富技术有限公司 Task execution method, device, computer readable storage medium and terminal equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184056A (en) * 2007-12-04 2008-05-21 浙江大学 Distributed enterprise service bus message switching method
US7512668B2 (en) * 2004-04-21 2009-03-31 Sap Ag Message-oriented middleware server instance failover
US7937433B1 (en) * 2003-09-23 2011-05-03 Embarq Holdings Company, Llc Queuing connector to promote message servicing
CN102521044A (en) * 2011-12-30 2012-06-27 北京拓明科技有限公司 Distributed task scheduling method and system based on messaging middleware
CN103019866A (en) * 2012-10-24 2013-04-03 北京京东世纪贸易有限公司 Distributed method and system based on message queue
CN104866378A (en) * 2015-05-29 2015-08-26 北京京东尚科信息技术有限公司 System and method for coordinating execution tasks

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7937433B1 (en) * 2003-09-23 2011-05-03 Embarq Holdings Company, Llc Queuing connector to promote message servicing
US7512668B2 (en) * 2004-04-21 2009-03-31 Sap Ag Message-oriented middleware server instance failover
CN101184056A (en) * 2007-12-04 2008-05-21 浙江大学 Distributed enterprise service bus message switching method
CN102521044A (en) * 2011-12-30 2012-06-27 北京拓明科技有限公司 Distributed task scheduling method and system based on messaging middleware
CN103019866A (en) * 2012-10-24 2013-04-03 北京京东世纪贸易有限公司 Distributed method and system based on message queue
CN104866378A (en) * 2015-05-29 2015-08-26 北京京东尚科信息技术有限公司 System and method for coordinating execution tasks

Also Published As

Publication number Publication date
CN106250254A (en) 2016-12-21

Similar Documents

Publication Publication Date Title
CN106250254B (en) A kind of task processing method and system
US10152382B2 (en) Method and system for monitoring virtual machine cluster
US8935395B2 (en) Correlation of distributed business transactions
US8954579B2 (en) Transaction-level health monitoring of online services
CN108717379B (en) Electronic device, distributed task scheduling method and storage medium
CN109634730B (en) Task scheduling method, device, computer equipment and storage medium
CN108270837B (en) Distributed task scheduling method and system using idle resources
CN109766172B (en) Asynchronous task scheduling method and device
US9015731B2 (en) Event handling system and method
CN109542718B (en) Service call monitoring method and device, storage medium and server
KR20200078328A (en) Systems and methods of monitoring software application processes
WO2019034095A1 (en) Software processing method and apparatus, electronic device and computer-readable storage medium
US11977449B2 (en) Distributed package management using meta-scheduling
CN110890987A (en) Method, device, equipment and system for automatically creating cluster
CN111459631A (en) Automatic batch processing method and system for server
CN108038126B (en) Data export method, device, terminal equipment and storage medium
CN109828830B (en) Method and apparatus for managing containers
CN111611057A (en) Distributed retry method, device, electronic equipment and storage medium
CN107025129B (en) Data processing method and device
RU2696299C2 (en) Control when initiating elementary tasks on server platform
WO2024139011A1 (en) Information processing method
CN108241616B (en) Message pushing method and device
US20080178182A1 (en) Work state returning apparatus, work state returning method, and computer product
CN116319758A (en) Data migration method, device, electronic equipment and readable storage medium
CN107741885B (en) Transaction and service association method and system based on CS framework

Legal Events

Date Code Title Description
C06 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