CN113485811A - Computing task management method and device, computer equipment and storage medium - Google Patents

Computing task management method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113485811A
CN113485811A CN202110838481.3A CN202110838481A CN113485811A CN 113485811 A CN113485811 A CN 113485811A CN 202110838481 A CN202110838481 A CN 202110838481A CN 113485811 A CN113485811 A CN 113485811A
Authority
CN
China
Prior art keywords
task
thread
node
configuration information
interrupt
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
CN202110838481.3A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202110838481.3A priority Critical patent/CN113485811A/en
Publication of CN113485811A publication Critical patent/CN113485811A/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/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

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

Abstract

The invention relates to artificial intelligence, and discloses a method, a device, computer equipment and a storage medium for managing computing tasks, wherein the method comprises the steps of receiving task configuration information and determining a target task cluster from a plurality of task clusters through a cluster load balancing strategy; sending task configuration information to task nodes in the target task cluster, and generating thread tasks corresponding to the task configuration information through a preset task generation platform; executing the thread task in the target task node, and changing the execution state of the thread task into an execution state; when any task node in all task clusters receives a task interrupt instruction, whether a thread task exists or not is inquired from an interrupt cache region according to task codes; and when the thread task exists in the interrupt cache region, interrupting the thread task and changing the execution state of the thread task into an execution cancellation state. The invention improves the efficiency and controllability in the thread task execution process.

Description

Computing task management method and device, computer equipment and storage medium
Technical Field
The present invention relates to the technical field of system resource monitoring, and in particular, to a method and an apparatus for computing task management, a computer device, and a storage medium.
Background
With the development of science and technology, more and more enterprise systems of companies adopt a distributed method to distribute computing tasks to different clusters for realization. With the increasing of computing tasks, task nodes in a distributed system complete task computing by using multiple threads, but the multiple threads of the distributed system have the problems of difficult thread management, incapability of tracking tasks and the like.
In the prior art, an enterprise system is generally degraded into a single architecture, so that thread tasks are concentrated on a single task node, and further thread task management can be performed on the task node. However, the solution of the single architecture loses the advantages of the cluster architecture in the distributed method, and thus the performance, availability and concurrency of the enterprise system are low.
Disclosure of Invention
The embodiment of the invention provides a computing task management method, a computing task management device, computer equipment and a storage medium, and aims to solve the problem that an enterprise system is low in performance, usability and concurrency.
A computing task management method, comprising:
receiving task configuration information, and determining a target task cluster corresponding to the task configuration information from a plurality of task clusters through a cluster load balancing strategy;
sending the task configuration information to task nodes in the target task cluster, and generating thread tasks corresponding to the task configuration information through a preset task generation platform; the thread task comprises a task code;
executing the thread task in a target task node, and changing the execution state of the thread task into an execution state; the target task node is a task node which receives the task configuration information in the target task cluster;
when any task node in all task clusters receives a task interrupt instruction, whether the thread task exists or not is inquired in an interrupt cache area according to the task code; the task interrupt instruction is an instruction for performing interrupt processing on the thread task; the interrupt cache region is a shared cache region of a task node receiving a task interrupt instruction;
and when the thread task exists in the interrupt cache region, interrupting the thread task and changing the execution state of the thread task into an execution cancellation state.
A computing task management device, comprising:
the task configuration information receiving module is used for receiving task configuration information and determining a target task cluster corresponding to the task configuration information from a plurality of task clusters through a cluster load balancing strategy;
the thread task generating module is used for sending the task configuration information to task nodes in the target task cluster and generating thread tasks corresponding to the task configuration information through a preset task generating platform; the thread task comprises a task code;
the thread task execution module is used for executing the thread task in a target task node and changing the execution state of the thread task into an execution state; the target task node is a task node which receives the task configuration information in the target task cluster;
the thread task query module is used for querying whether the thread task exists in the interrupt cache region according to the task code when any one task node in all the task clusters receives a task interrupt instruction; the task interrupt instruction is an instruction for performing interrupt processing on the thread task; the interrupt cache region is a shared cache region of a task node receiving a task interrupt instruction;
and the thread task interruption module is used for interrupting the thread task and changing the execution state of the thread task into an execution cancellation state when the thread task exists in the interruption cache region.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the above-mentioned computational task management method when executing said computer program.
A computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the above-described computing task management method.
According to the method, the task configuration information is received, and a target task cluster corresponding to the task configuration information is determined from a plurality of task clusters through a cluster load balancing strategy; sending the task configuration information to task nodes in the target task cluster, and generating thread tasks corresponding to the task configuration information through a preset task generation platform; the thread task comprises a task code; executing the thread task in a target task node, and changing the execution state of the thread task into an execution state; when any task node in all task clusters receives a task interrupt instruction, whether the thread task exists or not is inquired in an interrupt cache area according to the task code; and when the thread task exists in the interrupt cache region, interrupting the thread task and changing the execution state of the thread task into an execution cancellation state.
According to the invention, the thread is abstracted into the thread task through the preset task generating platform, so that a user can inquire states (such as an executing state, an executing canceling state and the like) in the thread task executing process, and the experience degree of the user and the perception degree of the task progress are improved; in addition, the method for interrupting the specific thread task is provided, so that the progress of other thread tasks cannot be influenced when the thread task has a problem, and the efficiency and the controllability in the thread task execution process are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a diagram of an application environment of a computing task management method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of computing task management in accordance with one embodiment of the present invention;
FIG. 3 is a functional block diagram of a computing task management device in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
The method for managing the computing task provided by the embodiment of the invention can be applied to an application environment as shown in fig. 1. Specifically, the computing task management method is applied to a computing task management system, where the computing task management system includes a client and a server as shown in fig. 1, and the client and the server communicate with each other through a network, so as to solve the problem that the performance, availability, and concurrency of an enterprise system are low. The client is also called a user side, and refers to a program corresponding to the server and providing local services for the client. The client may be installed on, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server may be implemented by an independent server or a server cluster composed of a plurality of servers, and the server may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
In an embodiment, as shown in fig. 2, a method for managing computing tasks is provided, which is described by taking the server in fig. 1 as an example, and includes the following steps:
s10: receiving task configuration information, and determining a target task cluster corresponding to the task configuration information from a plurality of task clusters through a cluster load balancing strategy;
as can be appreciated, task configuration information is information related to a computing task; illustratively, the task configuration information includes information such as task type, task identification, number of threads required by the task, and the like. The cluster load balancing strategy is that after the task configuration information is received, the task configuration information is distributed to the task cluster with the minimum load to perform computing tasks, so that the load of each cluster is balanced, the problem of excessive load of a single cluster is avoided, and the possibility of cluster paralysis caused by load redundancy of the clusters is reduced. A task cluster is a server, model, or platform, etc. for performing computing tasks. The target task cluster is the task cluster with the smallest load in the plurality of task clusters, the number of the target task clusters can be determined according to the task configuration information, and if the task configuration information comprises a plurality of tasks, the target task cluster with the same number as the tasks in the task configuration information can be selected.
In an embodiment, the step S10, that is, the receiving the task configuration information, includes:
receiving the task configuration information from the server cluster in real time through an MQ or an API (application program interface); or
And receiving the task configuration information from the server cluster at regular time through a polling interface.
Understandably, the server cluster contains a group of a plurality of servers, the MQ (message queuing) interface is a message queue manager interface, the task configuration information output from the server cluster is received in real time through the MQ interface, the MQ interface provides an interface of a queue-based message service, the communication modes provided by the MQ interface comprise a point-to-point communication mode, a multicast mode, a publish/subscribe mode and a cluster mode, the MQ interface can select different communication modes according to requirements, and diversity of receiving time data is provided, wherein, the MQ interface is characterized by asynchronization, decoupling, broadcasting and flow control, the asynchronization is the message queue in the MQ interface is asynchronous, and the message queue allows a receiver to retrieve messages after a long time of message sending; the decoupling reduces the coupling between services for the message queue in the MQ interface, different services can communicate through the message queue without concerning the implementation details of each other, and only the format of the message is defined; the broadcast is that the message queue in the MQ interface can send messages in a broadcast mode; the flow control is that when the processing capacity of the upstream and downstream systems is different, the message queue in the MQ interface is used as a universal 'carrier', and when the downstream system has the capacity of processing, the distribution and the processing are carried out.
The API (application Programming interface) provides an interface based on a message service provided by an application program, that is, an interface provided for message transmission with the application program, and the API interface provides characteristics of simplicity, uniformity, and symmetry, can specify interfaces of all application programs, and receives the task configuration information from the server cluster in real time through the API interface.
S20: sending the task configuration information to task nodes in the target task cluster, and generating thread tasks corresponding to the task configuration information through a preset task generation platform; the thread task comprises a task code;
it is understood that a task cluster (target task cluster) includes a plurality of task nodes, and any one task node can execute a computing task. The task configuration information is configured to be a thread (the thread cannot show the state in the execution process), so that after the thread task is generated, the execution state of the thread task can be displayed on a preset display interface, and a user can visually observe the state, information and the like in the task execution process. The task code is a unique identifier of the thread task, that is, the task codes between different thread tasks are different, and the task code can be determined according to the task identifier in the task configuration information.
Specifically, after receiving task configuration information and determining a target task cluster corresponding to the task configuration information from a plurality of task clusters through a cluster load balancing strategy, the task configuration information is sent to any one task node or a plurality of task nodes in the target task cluster, and a thread task corresponding to the task configuration information is generated through a preset task generation platform, wherein the thread task comprises information such as a thread object, a task type, a task state and a task code.
S30: executing the thread task in a target task node, and changing the execution state of the thread task into an execution state; the target task node is a task node which receives the task configuration information in the target task cluster;
it can be understood that the target task node is a task node that receives task configuration information in the target task cluster, and the number of the target task node may be one or multiple. The state in execution represents that the thread task is executed normally.
Specifically, after the task configuration information is sent to the task nodes in the target task cluster and the thread tasks corresponding to the task configuration information are generated through a preset task generating platform, the thread tasks are executed in the target task nodes receiving the task configuration information in the target task cluster, and the execution states of the thread tasks are changed into the execution states. It will be appreciated that the execution state of a thread task is a pending state before the thread task has not been executed.
In one embodiment, the thread task includes a thread object; before step S30, that is, before the thread task is executed in the target task node, the method further includes:
acquiring a preset storage example combination; the preset storage example combination comprises a key slot position and a value slot position;
it is understood that a thread object refers to an object that is processed in a thread task. The key slot bit is used for storing task codes in the thread tasks; the value slot is used to store a thread object in a thread task. It should be noted that the manner of using the preset storage example combination in this embodiment is only one example, and other data storage manners may also be implemented.
Filling a task code corresponding to the thread task into the key slot position by adopting a slot position filling mode, and filling a thread object corresponding to the thread task into the value slot position to generate a thread task combination;
it is understood that slot filling refers to a method of filling data into a corresponding slot. Specifically, after the preset storage example combination is obtained, a slot filling mode is adopted, task codes in the thread tasks are filled into the key slots, thread objects are filled into the value slots, and then the thread task combination is generated.
And storing the thread task combination into a shared cache region of the target task node.
Specifically, a slot filling mode is adopted, task codes corresponding to the thread tasks are filled into the key slots, thread objects corresponding to the thread tasks are filled into the value slots, and after a thread task combination is generated, the thread task combination is stored into a shared cache region of a target task node through modes such as a decision tree and a classifier.
In an embodiment, the storing the thread task combination into the shared cache of the target task node includes:
generating a task category label corresponding to the thread task according to the task code;
wherein the task category label refers to the classification of the thread task; it can be understood that when a thread task corresponding to the task configuration information is generated through a preset task generating platform, a task code with a unique identifier is generated according to information such as a task identifier and a task type in the task configuration information, and the task code can represent the classification of the thread task, so that a corresponding task category label can be generated according to the task code.
Searching task tree nodes matched with the task category labels from a task query tree in a shared cache region of the target task node; the task query tree is constructed by at least one thread task combination;
it is understood that the task query tree is constructed by a plurality of thread task combinations, and the task query tree can be generated in advance by a plurality of thread task combinations.
And inserting the thread task combination under the inquired task tree node.
Specifically, a task category label corresponding to the thread task is generated according to the task code, a task tree node matched with the task category label is inquired from a task inquiry tree in a shared cache region of a target task node, and then the thread task combination is inserted under the inquired task tree node, so that when the thread task needs to be inquired, the inquiry can be directly carried out under the inquired task tree node, and the efficiency of the thread task inquiry is improved.
S40: when any task node in all task clusters receives a task interrupt instruction, whether the thread task exists or not is inquired in an interrupt cache area according to the task code; the task interrupt instruction is an instruction for performing interrupt processing on the thread task; the interrupt cache region is a shared cache region of a task node receiving a task interrupt instruction;
it is understood that the task interrupt instruction is an instruction for performing interrupt processing on the thread task, and the task interrupt instruction may be automatically generated when the thread task is detected to have a thread deadlock and insufficient computing resources, or may be sent when a user has a specific need. The interrupt cache region refers to a shared cache region of a task node that receives a task interrupt instruction, and it can be understood that each task node has one shared cache region, and information of a thread task currently being executed by the task node, such as a task code of the thread task, is stored in the shared cache region.
Specifically, when any task node in all task clusters receives a task interruption instruction, a task class label corresponding to the task node is determined according to task codes, the task class label is inquired in an interruption cache region, whether a thread object corresponding to a thread task exists or not is inquired under a task tree node under the task class label, and if the thread object exists, the thread task exists in an interruption cache region is represented; and if the task type label is not inquired in the interrupt cache region or the thread object corresponding to the thread task is not inquired under the task tree node under the task type label, the thread task does not exist in the representation interrupt cache region.
In an embodiment, before any task node in all task clusters receives a task interrupt instruction, the method further includes:
detecting whether the thread task meets a preset deadlock condition in real time, and generating a task interruption instruction when the thread task meets the preset deadlock condition;
it can be understood that the preset deadlock condition is used for determining whether a thread task is in a thread deadlock phenomenon, and the preset deadlock condition includes: a mutually exclusive use condition (that is, when any resource is occupied by other threads and the resource cannot be used), a non-preemptive condition (that is, the resource which needs to be used cannot be preempted and can only be used after the thread which currently occupies the resource is actively released), a request and hold condition (that is, when a thread task occupies any resource, a request is still sent to other resources), and a circular wait condition (that is, a thread task occupies the resource of a thread task B, a thread task B occupies the resource of a thread task C, and a thread task C occupies the resource of the thread task A), when the four conditions of the mutually exclusive use condition, the non-preemptive condition, the request and hold condition, and the circular wait condition are satisfied, and determining that the thread task meets a preset deadlock condition, and further automatically generating a task interruption instruction when the thread task meets the preset deadlock condition.
And/or
And receiving a task interrupt request corresponding to the thread task, and generating the task interrupt instruction according to the task interrupt request.
It can be understood that the task interrupt request is a request for interrupting a thread task, which is sent when a user has a specific requirement, and a task interrupt instruction is generated according to the task interrupt request.
And sending the task interrupt instruction to any one task node in all task clusters.
Specifically, the task interruption instruction is generated when the thread task meets the preset deadlock condition, and/or the task interruption instruction is sent to any task node in all task clusters after a task interruption request corresponding to the thread task is received and the task interruption instruction is generated according to the task interruption request. It will be appreciated that since the distribution of thread tasks in a task cluster is uncertain, it is necessary to send a task interrupt instruction to any one task node in all clusters.
S50: and when the thread task exists in the interrupt cache region, interrupting the thread task and changing the execution state of the thread task into an execution cancellation state.
Specifically, after querying whether the thread task exists in the interrupt cache region according to the task code, if the thread task exists in the interrupt cache region, the interrupt action is executed to interrupt the thread task and the execution state of the thread task is changed to the execution cancellation state.
In this embodiment, the thread is abstracted into the thread task by the preset task generating platform, so that the user can query the states (such as the executing state, the execution canceling state and the like) in the thread task executing process, and the user experience and the perception of the task progress are improved; in addition, the method for interrupting the specific thread task is provided, so that the progress of other thread tasks cannot be influenced when the thread task has a problem, and the efficiency and the controllability in the thread task execution process are improved.
It will be appreciated that the steps described above in this application may be implemented in a distributed computing environment where steps are performed by remote processing devices that are linked through a communications network, in addition to being implemented in a server. Distributed computing environments may include, among other things, personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and any other system or device.
In an embodiment, after step S50, that is, after the querying whether the thread task exists in the interrupt cache according to the task code, the method further includes:
when the thread task does not exist in the interrupt cache region, the task code is sent to the rest task nodes; the residual task nodes refer to other task nodes except the task node which receives the task interrupt instruction in all the task clusters;
it can be understood that, in the above description, it is indicated that, if the interrupt cache region does not query the task category tag, or does not query the thread object corresponding to the thread task under the task tree node under the task category tag, it is characterized that the thread task does not exist in the interrupt cache region, and then the task code is sent to the remaining task nodes based on the publish-subscribe method. In the invention, the task nodes of all task clusters are bound to the same switch of the message queue, so that the task codes can be sent to the rest task nodes by a publish-subscribe method, and then the task nodes containing the thread tasks corresponding to the task codes are inquired in the rest task nodes.
Inquiring whether the thread task exists in a shared cache region of all the residual task nodes according to the task code;
specifically, when the thread task does not exist in the interrupt cache region, the task code is sent to the remaining task nodes, so as to inquire whether the thread task exists in the shared cache regions of all the remaining task nodes according to the task code.
And when the thread task is inquired in the shared cache region of any one of the rest task nodes, interrupting the thread task and changing the execution state of the thread task into an execution cancellation state.
Specifically, after whether the thread task exists in the shared cache region of all the remaining task nodes is queried according to the task code, when the thread task is queried in the shared cache region of any one of the remaining task nodes, the thread task is interrupted and the execution state of the thread task is changed into an execution cancellation state.
In an embodiment, after the executing the thread task in the target task node and changing the execution state of the thread task to the executing state, the method further includes:
detecting the task state of the thread task in real time;
the task state refers to the current state of the thread task, and illustratively includes a state representing the thread task execution success and a state representing the thread task execution exception.
When the task state represents that the thread task is successfully completed, changing the execution state of the thread task into an execution completion state;
and when the task state represents that the thread task is abnormal, changing the execution state of the thread task into an execution failure state.
Specifically, after the task state of the thread task is detected in real time, when the task state represents that the thread task is successfully completed, the execution state of the thread task is changed into an execution completion state; and when the task state represents the thread task abnormity, changing the execution state of the thread task into an execution failure state.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a computing task management device is provided, and the computing task management device corresponds to the computing task management method in the above embodiments one to one. As shown in fig. 3, the computing task management device includes a task configuration information receiving module 10, a thread task generating module 20, a thread task executing module 30, a thread task querying module 40, and a thread task interrupting module 50. The functional modules are explained in detail as follows:
the task configuration information receiving module 10 is configured to receive task configuration information, and determine a target task cluster corresponding to the task configuration information from a plurality of task clusters through a cluster load balancing policy;
the thread task generating module 20 is configured to send the task configuration information to a task node in the target task cluster, and generate a thread task corresponding to the task configuration information through a preset task generating platform; the thread task comprises a task code;
a thread task execution module 30, configured to execute the thread task in a target task node, and change an execution state of the thread task to an execution state; the target task node is a task node which receives the task configuration information in the target task cluster;
the thread task query module 40 is configured to query whether the thread task exists in an interrupt cache area according to the task code when any one task node in all task clusters receives a task interrupt instruction; the task interrupt instruction is an instruction for performing interrupt processing on the thread task; the interrupt cache region is a shared cache region of a task node receiving a task interrupt instruction;
and a thread task interruption module 50, configured to interrupt the thread task and change an execution state of the thread task to an execution cancellation state when the thread task exists in the interrupt cache region.
For specific limitations of the computing task management device, reference may be made to the above limitations of the computing task management method, which are not described herein again. The modules in the above-mentioned computing task management device can be implemented wholly or partially by software, hardware and their combination. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data used in the calculation task management method in the above embodiments. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a computing task management method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the computing task management method in the above embodiments is implemented.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the computing task management method in the above-described embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method for computing task management, comprising:
receiving task configuration information, and determining a target task cluster corresponding to the task configuration information from a plurality of task clusters through a cluster load balancing strategy;
sending the task configuration information to task nodes in the target task cluster, and generating thread tasks corresponding to the task configuration information through a preset task generation platform; the thread task comprises a task code;
executing the thread task in a target task node, and changing the execution state of the thread task into an execution state; the target task node is a task node which receives the task configuration information in the target task cluster;
when any task node in all task clusters receives a task interrupt instruction, whether the thread task exists or not is inquired in an interrupt cache area according to the task code; the task interrupt instruction is an instruction for performing interrupt processing on the thread task; the interrupt cache region is a shared cache region of a task node receiving a task interrupt instruction;
and when the thread task exists in the interrupt cache region, interrupting the thread task and changing the execution state of the thread task into an execution cancellation state.
2. The computing task management method of claim 1, wherein the thread task comprises a thread object; before the thread task is executed in the target task node, the method further includes:
acquiring a preset storage example combination; the preset storage example combination comprises a key slot position and a value slot position;
filling a task code corresponding to the thread task into the key slot position by adopting a slot position filling mode, and filling a thread object corresponding to the thread task into the value slot position to generate a thread task combination;
and storing the thread task combination into a shared cache region of the target task node.
3. The method for computing task management according to claim 2, wherein said storing the thread task combination into a shared cache of the target task node comprises:
generating a task category label corresponding to the thread task according to the task code;
searching task tree nodes matched with the task category labels from a task query tree in a shared cache region of the target task node; the task query tree is constructed by at least one thread task combination;
and inserting the thread task combination under the inquired task tree node.
4. The method for managing computing tasks according to claim 1, wherein before any task node in all task clusters receives a task interrupt instruction, the method further comprises:
detecting whether the thread task meets a preset deadlock condition in real time, and generating a task interruption instruction when the thread task meets the preset deadlock condition;
and/or
Receiving a task interrupt request corresponding to the thread task, and generating a task interrupt instruction according to the task interrupt request;
and sending the task interrupt instruction to any one task node in all task clusters.
5. The method for managing computing tasks according to claim 1, wherein after querying whether the thread task exists in an interrupt cache according to the task code, the method further comprises:
when the thread task does not exist in the interrupt cache region, the task code is sent to the rest task nodes; the residual task nodes refer to other task nodes except the task node which receives the task interrupt instruction in all the task clusters;
inquiring whether the thread task exists in a shared cache region of all the residual task nodes according to the task code;
and when the thread task is inquired in the shared cache region of any one of the rest task nodes, interrupting the thread task and changing the execution state of the thread task into an execution cancellation state.
6. The computing task management method of claim 1, wherein after executing the thread task in the target task node and changing the execution state of the thread task to an in-execution state, further comprising:
detecting the task state of the thread task in real time;
when the task state represents that the thread task is successfully completed, changing the execution state of the thread task into an execution completion state;
and when the task state represents that the thread task is abnormal, changing the execution state of the thread task into an execution failure state.
7. The computing task management method of claim 1, wherein the receiving task configuration information comprises:
receiving the task configuration information from the server cluster in real time through an MQ or an API (application program interface);
or
And receiving the task configuration information from the server cluster at regular time through a polling interface.
8. A computing task management apparatus, comprising:
the task configuration information receiving module is used for receiving task configuration information and determining a target task cluster corresponding to the task configuration information from a plurality of task clusters through a cluster load balancing strategy;
the thread task generating module is used for sending the task configuration information to task nodes in the target task cluster and generating thread tasks corresponding to the task configuration information through a preset task generating platform; the thread task comprises a task code;
the thread task execution module is used for executing the thread task in a target task node and changing the execution state of the thread task into an execution state; the target task node is a task node which receives the task configuration information in the target task cluster;
the thread task query module is used for querying whether the thread task exists in the interrupt cache region according to the task code when any one task node in all the task clusters receives a task interrupt instruction; the task interrupt instruction is an instruction for performing interrupt processing on the thread task; the interrupt cache region is a shared cache region of a task node receiving a task interrupt instruction;
and the thread task interruption module is used for interrupting the thread task and changing the execution state of the thread task into an execution cancellation state when the thread task exists in the interruption cache region.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the computing task management method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the computing task management method according to any one of claims 1 to 7.
CN202110838481.3A 2021-07-23 2021-07-23 Computing task management method and device, computer equipment and storage medium Pending CN113485811A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110838481.3A CN113485811A (en) 2021-07-23 2021-07-23 Computing task management method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110838481.3A CN113485811A (en) 2021-07-23 2021-07-23 Computing task management method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113485811A true CN113485811A (en) 2021-10-08

Family

ID=77942343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110838481.3A Pending CN113485811A (en) 2021-07-23 2021-07-23 Computing task management method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113485811A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050223199A1 (en) * 2004-03-31 2005-10-06 Grochowski Edward T Method and system to provide user-level multithreading
CN102360310A (en) * 2011-09-28 2012-02-22 中国电子科技集团公司第二十八研究所 Multitask process monitoring method and system in distributed system environment
CN110069335A (en) * 2019-05-07 2019-07-30 江苏满运软件科技有限公司 Task processing system, method, computer equipment and storage medium
CN111930523A (en) * 2020-09-28 2020-11-13 支付宝(杭州)信息技术有限公司 Load balancing method and system for service cluster

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050223199A1 (en) * 2004-03-31 2005-10-06 Grochowski Edward T Method and system to provide user-level multithreading
CN102360310A (en) * 2011-09-28 2012-02-22 中国电子科技集团公司第二十八研究所 Multitask process monitoring method and system in distributed system environment
CN110069335A (en) * 2019-05-07 2019-07-30 江苏满运软件科技有限公司 Task processing system, method, computer equipment and storage medium
CN111930523A (en) * 2020-09-28 2020-11-13 支付宝(杭州)信息技术有限公司 Load balancing method and system for service cluster

Similar Documents

Publication Publication Date Title
CN115328663B (en) Method, device, equipment and storage medium for scheduling resources based on PaaS platform
US9705752B2 (en) Reliably updating a messaging system
CN111913818B (en) Method for determining dependency relationship between services and related device
CN110352401B (en) Local device coordinator with on-demand code execution capability
CN110708247B (en) Message routing method, message routing device, computer equipment and storage medium
CN110636124B (en) VPP cluster management method and device, electronic equipment and storage medium
CN110781015A (en) Message queue distribution method, device, equipment and computer readable storage medium
CN111770029B (en) Dynamic queue forwarding method, system and storage medium based on RabbitMQ and ActiveMQ
CN108984290B (en) Task scheduling method and system
US8751560B2 (en) Method and device arrangement for managing a client/server environment
CN115757611A (en) Big data cluster switching method and device, electronic equipment and storage medium
CN113971098A (en) RabbitMQ consumption management method and system
US8316083B2 (en) System and method for client interoperability
CN111240998B (en) Test case processing method and device
EP3687133B1 (en) System and method for synchronization of media objects between devices operating in a multiroom system
CN113485811A (en) Computing task management method and device, computer equipment and storage medium
CN112685157B (en) Task processing method, device, computer equipment and storage medium
US11637737B2 (en) Network data management framework
CN114020453A (en) Service bus message processing method, service bus system, electronic device, and medium
CN114462388A (en) Handle management or communication method, electronic device, storage medium, and program product
CN113886032A (en) Event scheduling method and device, electronic equipment and storage medium
US10990385B1 (en) Streaming configuration management
CN113726885A (en) Method and device for adjusting flow quota
CN112416980A (en) Data service processing method, device and equipment
CN114253747B (en) Distributed message management system and method

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