CN114020442A - Task processing method and device, electronic equipment and readable storage medium - Google Patents

Task processing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114020442A
CN114020442A CN202210000919.5A CN202210000919A CN114020442A CN 114020442 A CN114020442 A CN 114020442A CN 202210000919 A CN202210000919 A CN 202210000919A CN 114020442 A CN114020442 A CN 114020442A
Authority
CN
China
Prior art keywords
task processing
task
processing node
node
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210000919.5A
Other languages
Chinese (zh)
Inventor
郑勇
刘弯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lianbao Hangzhou Information Technology Co ltd
Original Assignee
Lianbao Hangzhou Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lianbao Hangzhou Information Technology Co ltd filed Critical Lianbao Hangzhou Information Technology Co ltd
Priority to CN202210000919.5A priority Critical patent/CN114020442A/en
Publication of CN114020442A publication Critical patent/CN114020442A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a task processing method, which comprises the following steps: receiving target node execution progress information of a first task processing node in a target task; the first task processing node is any task processing node in a task processing node sequence corresponding to the target task, and whether a task processing node associated with a second task processing node exists in the task processing node sequence is judged; the second task processing node is a next task processing node to the first task processing node; if yes, acquiring node execution progress information of the associated task processing node; and when the node execution progress information of the associated task processing node indicates that the execution is completed, sending a task execution instruction to the second task processing node so that the second task processing node responds to the task execution instruction to execute task processing. By the technical scheme, the task processing time is shortened, the code is optimized, and the error probability is reduced.

Description

Task processing method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer data processing technologies, and in particular, to a task processing method and apparatus, an electronic device, and a readable storage medium.
Background
At present, when a multi-stage and multi-step task is processed, a timing task is mostly adopted to scoop up an unprocessed and completed non-final state task, and because the processing timeliness of each link of each task is different, the timing task is scooped up uniformly, so that the time waiting exists, and the problem of low judgment efficiency caused by repeated scooping up of the timing task for many times exists.
If cross-dependency links exist among tasks, the waiting time is increased, control codes are scattered in the links, good closing-up cannot be achieved, and if dependency logic changes, nodes of timing tasks need to be modified, so that the coding style is easily disordered.
Disclosure of Invention
The present application provides a task processing method, an apparatus, an electronic device and a readable storage medium capable of efficiently processing an interconnected multi-stage multi-step task to overcome the above-mentioned drawbacks of the prior art.
In order to solve the technical problem, the application provides the following technical scheme:
according to a first aspect of embodiments of the present application, there is provided a task processing method, where the method includes:
receiving target node execution progress information of a first task processing node in a target task; the first task processing node is any task processing node in a task processing node sequence corresponding to a target task, and the task processing node sequence comprises a plurality of task processing nodes obtained by decomposing the execution sequence of the target task;
judging whether a task processing node associated with a second task processing node exists in the task processing node sequence; the second task processing node is a next task processing node to the first task processing node;
if yes, acquiring node execution progress information of the associated task processing node;
and when the node execution progress information of the associated task processing node indicates that the execution is completed, sending a task execution instruction to the second task processing node so that the second task processing node responds to the task execution instruction to execute task processing.
In an exemplary embodiment, the method further comprises:
and if the associated task processing node does not exist, sending a task execution instruction to the second task processing node, so that the second task processing node responds to the task execution instruction to execute task processing.
In an exemplary embodiment, the determining whether there is an associated task processing node of the second task processing node in the task processing node sequence includes:
acquiring node association information corresponding to the target task;
and judging whether the task processing node sequence has the associated task processing node of the second task processing node or not based on the node associated information.
In an exemplary embodiment, the method further comprises:
responding to a node association configuration instruction aiming at the target task, and acquiring the node association information corresponding to the target task;
and storing the node association information corresponding to the target task.
In an exemplary embodiment, the method further comprises:
receiving target node execution progress information of a second task processing node in a target task;
judging whether the second task processing node is the last task processing node in the task processing node sequence;
if yes, terminating the task processing of the target task;
if not, judging whether a task processing node associated with a third task processing node exists in the task processing node sequence or not; the third task processing node is a next task processing node of the second task processing node.
In an exemplary embodiment, the method further comprises:
acquiring the service logic information of the target task;
and decomposing the target task into a plurality of task processing nodes based on the business logic information.
Optionally, the service logic information includes a service flow, a flow sequence, a flow node, and node association information.
In an exemplary embodiment, the receiving of the target node execution progress information of the first task processing node in the target task and the sending of the task execution instruction to the second task processing node are both implemented by transaction message middleware.
Optionally, the transaction message middleware adopts a rockmq transaction message middleware, and the rockmq transaction message middleware has the characteristics of supporting a strict message sequence, supporting two modes of Topic and Queue, hundred million-level message accumulation capability, relatively friendly distributed characteristics, simultaneously supporting consumption of messages in a Push and Pull mode, and the like.
According to a second aspect of embodiments of the present application, there is provided a task processing apparatus, the apparatus including:
the target node execution progress information receiving module is used for receiving target node execution progress information of a first task processing node in a target task; the first task processing node is any task processing node in a task processing node sequence corresponding to a target task, and the task processing node sequence comprises a plurality of task processing nodes obtained by decomposing the execution sequence of the target task;
the first associated task processing node judging module is used for judging whether an associated task processing node of a second task processing node exists in the task processing node sequence or not; the second task processing node is a next task processing node to the first task processing node;
a node execution progress information obtaining module, configured to obtain node execution progress information of a second task processing node based on an associated task processing node of the second task processing node existing in the task processing node sequence
And the first task execution instruction sending module is used for sending a task execution instruction to the second task processing node when the node execution progress information of the associated task processing node indicates that the execution is completed, so that the second task processing node responds to the task execution instruction to execute the task processing.
In an exemplary embodiment, the apparatus further comprises:
and the second task execution instruction sending module is used for sending a task execution instruction to the second task processing node based on the fact that the task processing node does not have the associated task processing node of the second task processing node in the task processing node sequence, so that the second task processing node responds to the task execution instruction to execute task processing.
In an exemplary embodiment, the apparatus further comprises:
and the node association information acquisition module is used for acquiring the node association information corresponding to the target task.
In an exemplary embodiment, the apparatus further comprises:
and the node association information storage module is used for storing the node association information corresponding to the target task.
In an exemplary embodiment, the apparatus further comprises:
a task termination judging module, configured to judge whether the second task processing node is a last task processing node in the sequence of task processing nodes;
a task termination execution module, configured to send a task termination instruction based on that the second task processing node is a last task processing node in the sequence of task processing nodes;
a second associated task processing node determining module, configured to determine whether an associated task processing node of a third task processing node exists in the task processing node sequence based on whether the second task processing node is not a last task processing node in the task processing node sequence; the third task processing node is a next task processing node of the second task processing node.
In an exemplary embodiment, the apparatus further comprises:
and the service logic information acquisition module is used for acquiring the service logic information of the target task.
According to a third aspect of the embodiments of the present application, there is provided an electronic device, including a processor and a memory, where at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the task processing method described above.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the above task processing method.
By adopting the technical scheme, the application has the following beneficial effects:
according to the task processing method, the task processing device, the electronic equipment and the readable storage medium, the target task is decomposed into the plurality of task processing nodes, the quasi-real-time task processing of the interconnected multi-stage and multi-step task is achieved, the task processing time is effectively shortened, the target task is decomposed into the plurality of task processing nodes, a program has a good closing-up, the code optimization is facilitated, the error probability is reduced, and even if each node depends on logic to change, the encoding style confusion caused by the fact that each task node needs to be modified can be avoided.
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 creative efforts.
Fig. 1 is a schematic flowchart of a task processing method according to an embodiment of the present application;
fig. 2 is a block diagram of a task processing device according to an embodiment of the present disclosure;
fig. 3 is a block diagram of a hardware structure of an electronic device that executes a task processing method according to an embodiment of 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. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic may be included in at least one implementation of the present application. In the description of the embodiments of the present application, it is to be understood that the terms "upper", "lower", "top", "bottom", and the like, indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, are only for convenience in describing the present application and simplifying the description, and do not indicate or imply that the referred devices or elements must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. Moreover, the terms "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein.
Referring to fig. 1, a schematic flow chart of a task processing method according to an embodiment of the present application is shown, where the task processing method includes:
step S1, receiving target node execution progress information of a first task processing node in the target task; the first task processing node is any task processing node in a task processing node sequence corresponding to the target task, and the task processing node sequence comprises a plurality of task processing nodes obtained by decomposing the execution sequence of the target task;
step S2, judging whether a task processing node associated with the second task processing node exists in the task processing node sequence; the second task processing node is a next task processing node of the first task processing node;
if yes, step S201 is to obtain the node execution progress information of the associated task processing node;
step S3: and when the node execution progress information of the associated task processing node indicates that the execution is completed, sending a task execution instruction to the second task processing node so that the second task processing node executes task processing in response to the task execution instruction.
In a specific embodiment, the target node execution progress information of the first task processing node in the plurality of task processing nodes decomposed according to the execution order is received through step S1, where the target node execution progress information of the first task processing node refers to the execution completion information of the first task processing node; step S2 is then performed to determine whether a task processing node associated with a second task processing node exists in the task processing node sequence, which can avoid that after a task execution instruction is sent to the second task processing node, the second task processing node is found to have an associated task processing node, and then associated task node information is fed back, which leads to idle running of the task execution instruction and is likely to cause code confusion; if the second task processing node has the associated task processing node, acquiring node execution progress information of the associated task processing node through step S201, where the node execution progress information of the associated task processing node refers to the execution progress of the associated task processing node, but not to the execution completion information of the associated task processing node; through step S3, when the node execution progress information of the associated task processing node indicates completion of execution, a task execution instruction is sent to the second task processing node, so that generation of idle time can be effectively prevented. By the technical scheme, the quasi-real-time task processing of the interconnected multi-stage and multi-step tasks can be realized, the task processing time is effectively shortened, and the target task is decomposed into the plurality of task processing nodes, so that the program has better closing-in, the code optimization is facilitated, the error probability is reduced, and the encoding style chaos caused by the fact that each node is required to be modified depending on the logic can be avoided. Practical applications are for example exchange remittance systems.
It should be noted that, the implementation of the present embodiment adopts a java language coded control judgment program.
It should be further noted that, in this embodiment, the service logic may be controlled according to the specific service self-encoding.
It should also be noted that the target task has a unique identification number.
Specifically, the embodiment of the present application may further include a step that no associated task processing node exists in step S2, where the step specifically includes:
step S202: and if the associated task processing node does not exist, sending a task execution instruction to the second task processing node, so that the second task processing node responds to the task execution instruction to execute task processing.
In a specific embodiment, if it is determined in step S2 that there is no associated task processing node in the second task processing node, step S202 is performed to send a task execution instruction to the second task processing node, where the step is performed in near real time, so as to effectively prevent generation of idle time.
Specifically, the embodiment of the present application may further include a step of determining whether a judgment rule of a task processing node associated with the second task processing node exists in the task processing node sequence, where the step specifically includes:
acquiring node association information corresponding to a target task;
and judging whether the task processing node sequence has the associated task processing node of the second task processing node or not based on the node associated information.
In a specific embodiment, the associated task processing node information corresponding to the task processing node is obtained through the node associated information, so that whether the task processing node has the associated task processing node or not is accurately judged, and the program is prevented from running empty.
Specifically, the embodiment of the present application may further include a step of storing the node association information, where the step specifically includes:
responding to a node association configuration instruction aiming at the target task, and acquiring node association information corresponding to the target task;
and storing the node association information corresponding to the target task.
In a specific embodiment, the node association information corresponding to the target task is stored through the above steps, so that information acquisition is performed when it is determined whether the task processing node has an associated task processing node.
Specifically, the embodiment of the present application may further include a step of determining whether the task can be terminated, where the step specifically includes:
step S4: receiving target node execution progress information of a second task processing node in a target task;
step S5: judging whether the second task processing node is the last task processing node in the task processing node sequence;
if yes, step S501: terminating the task processing of the target task;
if not, step S502: judging whether a task processing node associated with a third task processing node exists in the task processing node sequence; the third task processing node is a next task processing node of the second task processing node.
In a specific embodiment, the step S4 is to receive target node execution progress information of a second task processing node in the target task, where the target node execution progress information of the second task processing node refers to execution completion information of the target node; judging whether the second task processing node is the last task processing node in the task processing node sequence through the step S5, so that the task processing node can finish the task in near real time when finishing, and the program can be prevented from running empty; ending the task through step S501; by entering the judgment of the associated task processing node of the next task processing node in step S502, it is avoided that after the task execution instruction is sent to the third task processing node, the third task processing node is found to have the associated task processing node, and then the associated task node information is fed back, resulting in idle running of the task execution instruction.
If the second task processing node is not the last task processing node in the task processing node sequence, steps S2 to S5 need to be repeated until the process proceeds to step S501, and the process of the target task cannot be ended.
Specifically, the embodiment of the present application may further include a step of determining the target task decomposition rule, where the step specifically includes:
acquiring service logic information of a target task;
and decomposing the target task into a plurality of task processing nodes based on the business logic information.
In a specific embodiment, the service logic information is implanted into the scheduling program, and the target task can be divided into task processing nodes according to the service logic information, so that the task processing process has better closing-up, the code optimization is facilitated, the error probability is reduced, and the encoding style confusion caused by the fact that each task node needs to be modified even if each node depends on logic to change can be avoided.
Optionally, the service logic information includes service flows, flow sequences, flow nodes, and node association information; so as to divide the target task more reasonably.
Specifically, receiving the target node execution progress information of the first task processing node in the target task and sending the task execution instruction to the second task processing node are both realized through the transaction message middleware.
In a particular embodiment, the reliability of instruction and message delivery is guaranteed through transaction message middleware.
Optionally, the transaction message middleware adopts a rockmq transaction message middleware, and the rockmq transaction message middleware has the characteristics of supporting a strict message sequence, supporting two modes of a Topic and a Queue, a hundred million-level message accumulation capability, a friendly distributed characteristic, and simultaneously supporting consumption of messages in a Push and Pull mode.
According to the technical scheme, the target task is decomposed into the plurality of task processing nodes, the quasi-real-time task processing of the interconnected multi-stage and multi-step tasks is achieved, the task processing time is effectively shortened, the target task is decomposed into the plurality of task processing nodes, the program has better closing-in, the code optimization is facilitated, the error probability is reduced, and the encoding style confusion caused by the fact that the nodes need to be modified depending on logic can be avoided even if the nodes are changed.
Corresponding to the task processing method provided by the foregoing embodiment, an embodiment of the present application further provides a task processing device, and since the task processing device provided by the embodiment of the present application corresponds to the task processing method provided by the foregoing embodiment, the foregoing embodiment of the task processing method is also applicable to the task processing device provided by the present embodiment, and is not described in detail in the present embodiment.
Referring to fig. 2, a block diagram of a task processing device according to an embodiment of the present disclosure is shown, where the task processing device includes:
the target node execution progress information receiving module is used for receiving target node execution progress information of a first task processing node in a target task; the first task processing node is any task processing node in a task processing node sequence corresponding to the target task, and the task processing node sequence comprises a plurality of task processing nodes obtained by decomposing the execution sequence of the target task;
the first associated task processing node judging module is used for judging whether an associated task processing node of a second task processing node exists in the task processing node sequence or not; the second task processing node is a next task processing node of the first task processing node;
a node execution progress information obtaining module, configured to obtain node execution progress information of a second task processing node based on a task processing node associated with the second task processing node in the task processing node sequence
And the first task execution instruction sending module is used for sending a task execution instruction to the second task processing node when the node execution progress information of the associated task processing node indicates that the execution is completed, so that the second task processing node responds to the task execution instruction to execute the task processing.
In a specific embodiment, a target node execution progress information receiving module receives target node execution progress information of a first task processing node in a plurality of task processing nodes obtained by decomposition according to an execution sequence, wherein the target node execution progress information of the first task processing node refers to execution completion information of the first task processing node; the first associated task processing node judgment module can avoid that the associated task processing node exists in the second task processing node after the task execution instruction is sent to the second task processing node, and then feeds back the associated task node information to cause idle running of the task execution instruction and easily cause code confusion; if the second task processing node has the associated task processing node, acquiring node execution progress information of the associated task processing node through a node execution progress information acquisition module, wherein the node execution progress information of the associated task processing node refers to the execution progress of the associated task processing node, but not the execution completion information of the associated task processing node; through the first task execution instruction sending module, when the node execution progress information of the associated task processing node indicates that the execution is finished, the task execution instruction is sent to the second task processing node, and the idle time can be effectively prevented from being generated. By the technical scheme, the quasi-real-time task processing of the interconnected multi-stage and multi-step tasks can be realized, the task processing time is effectively shortened, and the target task is decomposed into the plurality of task processing nodes, so that the program has better closing-in, the code optimization is facilitated, the error probability is reduced, and the encoding style chaos caused by the fact that each node is required to be modified depending on the logic can be avoided. Such as an exchange remittance apparatus.
It should be noted that, the implementation of the present embodiment adopts a java language coded control judgment program.
It should be further noted that, in this embodiment, the service logic may be controlled according to the specific service self-encoding.
It should be further noted that the target task in the target task module has a unique identification number.
Specifically, the embodiment of the present application may further include a module that does not have a related task processing node in the first related task processing node determining module, where the module specifically includes:
and the second task execution instruction sending module is used for sending a task execution instruction to the second task processing node based on the fact that the task processing node does not have the associated task processing node of the second task processing node in the task processing node sequence, so that the second task processing node responds to the task execution instruction to execute task processing.
In a specific embodiment, if it is determined that the second task processing node does not have the associated task processing node after the determination by the first associated task processing node determining module, the second task execution instruction sending module sends the task execution instruction to the second task processing node in the target task module, and the execution is quasi-real-time, so that the generation of idle time can be effectively prevented.
Specifically, the embodiment of the present application may further include a module for acquiring the information of the associated task processing node, where the module specifically includes:
a node association information acquisition module, configured to acquire the node association information corresponding to the target task;
in a specific embodiment, whether the associated task processing node of the second task processing node exists in the task processing node sequence is determined based on the node associated information in the node associated information obtaining module, that is, the associated task processing node information corresponding to the task processing node is obtained through the node associated information, so as to accurately determine whether the associated task processing node exists in the task processing node, thereby avoiding program idle running.
Specifically, the embodiment of the present application may further include a module for storing the node association information, where the module specifically includes:
and the node association information storage module is used for storing the node association information corresponding to the target task.
In a specific embodiment, in response to a node association configuration instruction for a target task, node association information corresponding to the target task is acquired, and then the node association information corresponding to the target task is stored, so that information acquisition is performed when it is determined whether a task processing node has an associated task processing node.
Specifically, the embodiment of the present application may further include a module for determining whether the task may be terminated, where the module specifically includes:
the task termination judging module is used for judging whether the second task processing node is the last task processing node in the task processing node sequence;
the task termination execution module is used for sending a task termination instruction based on the fact that the second task processing node is the last task processing node in the task processing node sequence;
the second associated task processing node judging module is used for judging whether an associated task processing node of a third task processing node exists in the task processing node sequence or not based on the fact that the second task processing node is not the last task processing node in the task processing node sequence; the third task processing node is a next task processing node of the second task processing node.
In a specific embodiment, target node execution progress information of a second task processing node in a target task is received through a target node execution progress information receiving module, wherein the target node execution progress information of the second task processing node refers to execution completion information of the second task processing node; judging whether the second task processing node is the last task processing node in the task processing node sequence through a task termination judging module, so that the task processing node can finish the task in a quasi-real-time manner when finishing, and the program is prevented from running empty; if the second task processing node is the last task processing node in the task processing node sequence, a task termination instruction is sent through the termination task execution module, and the target task is ended; if the second task processing node is not the last task processing node in the task processing node sequence, the second associated task processing node judgment module enters the associated task processing node judgment of the next task processing node, the phenomenon that after a task execution instruction is sent to a third task processing node, the third task processing node is found to have the associated task processing node is avoided, and then the associated task node information is fed back, so that the task execution instruction runs empty.
It should be noted that the processing of the target task cannot be finished until it is determined that the current task processing node is the last task processing node in the task processing node sequence.
Specifically, the embodiment of the present application may further include a module for determining the target task decomposition rule, where the module specifically includes:
and the service logic information acquisition module is used for acquiring the service logic information of the target task.
In a specific embodiment, the task processing nodes of the target task are divided according to the service logic information, so that a program has better closing-in, codes are optimized, the error probability is reduced, and the encoding style confusion caused by the fact that each task node needs to be modified even if each node depends on logic to change can be avoided.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The task processing device of the embodiment of the application realizes the quasi-real-time task processing of the interconnected multi-stage multi-step task by decomposing the target task into the plurality of task processing nodes, effectively shortens the task processing time, enables the program to have better closing-in due to the fact that the target task is decomposed into the plurality of task processing nodes, is beneficial to optimizing codes, reduces error probability, and can avoid encoding style confusion caused by the fact that each task node needs to be modified even if each node depends on logic to change.
The embodiment of the present application further provides an electronic device, which includes a processor and a memory, where at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the task processing method provided in the foregoing method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and task processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
The method embodiments provided in the embodiments of the present application may be executed in a computer terminal, a server, or a similar computing device, that is, the electronic device may include a computer terminal, a server, or a similar computing device. Fig. 3 is a block diagram of a hardware structure of an electronic device for executing a task processing method according to an embodiment of the present application, and as shown in fig. 3, an internal structure of the electronic device may include, but is not limited to: a processor, a network interface, and a memory. The processor, the network interface, and the memory in the electronic device may be connected by a bus or in other manners, and fig. 3 shown in the embodiment of the present disclosure is exemplified by being connected by a bus.
The processor (or CPU) is a computing core and a control core of the electronic device. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.). A Memory (Memory) is a Memory device in an electronic device for storing programs and data. It is understood that the memory herein may be a high-speed RAM storage device, or may be a non-volatile storage device (non-volatile memory), such as at least one magnetic disk storage device; optionally, at least one memory device located remotely from the processor. The memory provides storage space that stores an operating system of the electronic device, which may include, but is not limited to: a Windows system (an operating system), a Linux system (an operating system), an Android system, an IOS system, etc., which are not limited in this application; also, one or more instructions, which may be one or more computer programs (including program code), are stored in the memory space and are adapted to be loaded and executed by the processor. In the embodiment of the present specification, the processor loads and executes one or more instructions stored in the memory to implement the task processing method provided by the above method embodiment.
The embodiment of the present application further provides a computer-readable storage medium, where at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the task processing method provided by the method embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed.

Claims (11)

1. A method for processing a task, the method comprising:
receiving target node execution progress information of a first task processing node in a target task; the first task processing node is any task processing node in a task processing node sequence corresponding to a target task, and the task processing node sequence comprises a plurality of task processing nodes obtained by decomposing the execution sequence of the target task;
judging whether a task processing node associated with a second task processing node exists in the task processing node sequence; the second task processing node is a next task processing node to the first task processing node;
if yes, acquiring node execution progress information of the associated task processing node;
and when the node execution progress information of the associated task processing node indicates that the execution is completed, sending a task execution instruction to the second task processing node so that the second task processing node responds to the task execution instruction to execute task processing.
2. A task processing method according to claim 1, wherein the method further comprises:
and if the associated task processing node does not exist, sending a task execution instruction to the second task processing node, so that the second task processing node responds to the task execution instruction to execute task processing.
3. The method according to claim 1 or 2, wherein the determining whether the task processing node associated with the second task processing node exists in the task processing node sequence comprises:
acquiring node association information corresponding to the target task;
and judging whether the task processing node sequence has the associated task processing node of the second task processing node or not based on the node associated information.
4. A task processing method according to claim 3, wherein the method further comprises:
responding to a node association configuration instruction aiming at the target task, and acquiring the node association information corresponding to the target task;
and storing the node association information corresponding to the target task.
5. A task processing method according to claim 1, wherein the method further comprises:
receiving target node execution progress information of a second task processing node in a target task;
judging whether the second task processing node is the last task processing node in the task processing node sequence;
if yes, terminating the task processing of the target task;
if not, judging whether a task processing node associated with a third task processing node exists in the task processing node sequence or not; the third task processing node is a next task processing node of the second task processing node.
6. A task processing method according to claim 1, wherein the method further comprises:
acquiring the service logic information of the target task;
and decomposing the target task into a plurality of task processing nodes based on the business logic information.
7. The task processing method according to claim 1, wherein the receiving of the target node execution progress information of the first task processing node in the target task and the sending of the task execution instruction to the second task processing node are both implemented by transaction message middleware.
8. A task processing apparatus, characterized in that the apparatus comprises:
the target node execution progress information receiving module is used for receiving target node execution progress information of a first task processing node in a target task; the first task processing node is any task processing node in a task processing node sequence corresponding to a target task, and the task processing node sequence comprises a plurality of task processing nodes obtained by decomposing the execution sequence of the target task;
the first associated task processing node judging module is used for judging whether an associated task processing node of a second task processing node exists in the task processing node sequence or not; the second task processing node is a next task processing node to the first task processing node;
a node execution progress information obtaining module, configured to obtain node execution progress information of a second task processing node based on an associated task processing node of the second task processing node existing in the task processing node sequence
And the first task execution instruction sending module is used for sending a task execution instruction to the second task processing node when the node execution progress information of the associated task processing node indicates that the execution is completed, so that the second task processing node responds to the task execution instruction to execute the task processing.
9. A task processing device according to claim 8, wherein said device further comprises:
and the task termination judging module is used for judging whether the second task processing node is the last task processing node in the task processing node sequence.
10. An electronic device, comprising a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded by the processor and executed to implement the task processing method according to any one of claims 1 to 7.
11. A computer-readable storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement a method of task processing according to any one of claims 1 to 7.
CN202210000919.5A 2022-01-04 2022-01-04 Task processing method and device, electronic equipment and readable storage medium Pending CN114020442A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210000919.5A CN114020442A (en) 2022-01-04 2022-01-04 Task processing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210000919.5A CN114020442A (en) 2022-01-04 2022-01-04 Task processing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114020442A true CN114020442A (en) 2022-02-08

Family

ID=80069558

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210000919.5A Pending CN114020442A (en) 2022-01-04 2022-01-04 Task processing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114020442A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235845A1 (en) * 2006-07-21 2010-09-16 Sony Computer Entertainment Inc. Sub-task processor distribution scheduling
US20100293546A1 (en) * 2009-05-15 2010-11-18 International Business Machines Corporation Method and system for web page breadcrumb
CN108287756A (en) * 2018-01-25 2018-07-17 联动优势科技有限公司 A kind of method and device of processing task
CN110096342A (en) * 2019-05-08 2019-08-06 深圳乐信软件技术有限公司 Task processing method, device, server and storage medium
CN112035235A (en) * 2020-09-02 2020-12-04 中国平安人寿保险股份有限公司 Task scheduling method, system, device and storage medium
CN112148480A (en) * 2020-09-03 2020-12-29 深圳壹账通智能科技有限公司 Task processing method, device and equipment based on multithreading and storage medium
CN112231098A (en) * 2020-09-29 2021-01-15 北京三快在线科技有限公司 Task processing method, device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100235845A1 (en) * 2006-07-21 2010-09-16 Sony Computer Entertainment Inc. Sub-task processor distribution scheduling
US20100293546A1 (en) * 2009-05-15 2010-11-18 International Business Machines Corporation Method and system for web page breadcrumb
CN108287756A (en) * 2018-01-25 2018-07-17 联动优势科技有限公司 A kind of method and device of processing task
CN110096342A (en) * 2019-05-08 2019-08-06 深圳乐信软件技术有限公司 Task processing method, device, server and storage medium
CN112035235A (en) * 2020-09-02 2020-12-04 中国平安人寿保险股份有限公司 Task scheduling method, system, device and storage medium
CN112148480A (en) * 2020-09-03 2020-12-29 深圳壹账通智能科技有限公司 Task processing method, device and equipment based on multithreading and storage medium
CN112231098A (en) * 2020-09-29 2021-01-15 北京三快在线科技有限公司 Task processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108776897B (en) Data processing method, device, server and computer readable storage medium
CN106302632B (en) Downloading method of basic mirror image and management node
CN112465615B (en) Method, device and system for processing bill data
CN112286664B (en) Task scheduling method, device, computer equipment and readable storage medium
CN111988429A (en) Algorithm scheduling method and system
CN106775975B (en) Process scheduling method and device
CN110333916B (en) Request message processing method, device, computer system and readable storage medium
CN114020442A (en) Task processing method and device, electronic equipment and readable storage medium
CN112559155A (en) Batch job processing method, system, computer device and readable storage medium
CN113095769A (en) Service inventory management method, device, equipment and readable storage medium
CN111143063B (en) Task resource reservation method and device
CN109697117A (en) Terminal control method, device and computer readable storage medium
CN116932220A (en) Resource adjustment method and device for service cluster, electronic equipment and storage medium
CN111459464B (en) Node fusion method, code generation method and device
CN112685145A (en) Task management method and device and computer equipment
CN113760494B (en) Task scheduling method and device
CN116361114A (en) AI board monitoring keep-alive method, device, equipment and medium
CN110673942B (en) Asynchronous process ending method and device of cloud platform and cloud platform server
CN112882940A (en) Use case task scheduling method, system, device, equipment and storage medium
CN113032118A (en) Asynchronous operation processing method for computer application program and corresponding system
CN112084014A (en) Data processing method, device, equipment and medium
CN112148803A (en) Method, device and equipment for calling tasks in block chain and readable storage medium
CN112631743B (en) Task scheduling method, device and storage medium
CN112766768B (en) Contract flow management method and device, electronic equipment and readable storage medium
CN115543343B (en) Variable cross-thread operation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220208