CN116841734A - Integrated task execution management method, device, storage medium and system - Google Patents

Integrated task execution management method, device, storage medium and system Download PDF

Info

Publication number
CN116841734A
CN116841734A CN202310689537.2A CN202310689537A CN116841734A CN 116841734 A CN116841734 A CN 116841734A CN 202310689537 A CN202310689537 A CN 202310689537A CN 116841734 A CN116841734 A CN 116841734A
Authority
CN
China
Prior art keywords
task
lock
executed
server
execution management
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
CN202310689537.2A
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.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China 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 Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN202310689537.2A priority Critical patent/CN116841734A/en
Publication of CN116841734A publication Critical patent/CN116841734A/en
Pending legal-status Critical Current

Links

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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Abstract

The invention discloses an integrated task execution management method, a device, a storage medium and a system, which are used for improving the utilization efficiency and stability of computing resources by defining global locks or local locks for different task types and executing only the tasks of a server with the maximum number of threads for processing and obtaining the task locks at the same time after receiving an integrated task to be executed; furthermore, the integrated task execution management method, the integrated task execution management device, the integrated task execution management storage medium and the integrated task execution management system can be rapidly deployed from the environment to be migrated to the migration environment through the export and import of the support configuration, and therefore efficiency and convenience in construction of the execution management environment are improved.

Description

Integrated task execution management method, device, storage medium and system
Technical Field
The present invention relates to the technical field of public cloud integrated task execution management, and in particular, to an integrated task execution management method, an integrated task execution management device, a computer readable storage medium, and a computer readable storage medium and a computer readable system.
Background
Public cloud refers to cloud services provided by third party providers for users through the public Internet, and users can access the cloud and enjoy various services through the Internet, including but not limited to computing, storage, networking, etc. The resident users in public cloud environment are called tenants, and data and business among the tenants are generally isolated. One application service may open multiple instances (nodes), each providing the same service to the outside through load balancing. Large clients have a wide variety of integrated tasks whose execution requires occupation of thread resources. When a certain class of tasks is high in number and is blocked in the execution process, the available threads in the system thread pool are easily consumed, so that other tasks are in a waiting execution state, and even the tasks with higher priorities can not be executed for a long time.
In the prior art, in a single-machine environment, in order to realize the atomicity of a shared resource operation process by multiple processes or threads, a spinLock or Mutex mechanism provided by a kernel can be used for ensuring that only one process or thread operates the shared resource; in a distributed environment, the concurrent operation of nodes on a plurality of machines is controlled through distributed lock control, so that only one task of a certain type is executed at a certain time, and data or state is prevented from being damaged.
However, the prior art still has the following drawbacks: locks realized by means of spinLock or Mutex provided by the kernel are not applicable to a distributed environment, and cannot control concurrent operation of a plurality of machine nodes; the current distributed lock scheme not only can not be suitable for the requirement of on-site control concurrency number and can not uniformly distribute tasks to each node for execution, but also has the problems of complex configuration flow and difficult monitoring analysis.
Accordingly, there is a need for an integrated task execution management method, apparatus, computer-readable storage medium, and system that overcomes the above-described deficiencies in the prior art.
Disclosure of Invention
The embodiment of the invention provides an integrated task execution management method, an integrated task execution management device, a computer readable storage medium and a computer readable storage medium system, so that the utilization efficiency of computing resources is improved.
An embodiment of the present invention provides an integrated task execution management method, including: acquiring configuration information sent by a user, defining and initializing task locks corresponding to different task types according to the configuration information, and acquiring lock information corresponding to the task locks: the lock information comprises a task type, a lock type, a server IP address and a maximum thread number; the lock types include local locks and global locks; when receiving an integrated task to be executed, acquiring lock information of a first task lock corresponding to the management task to be executed and task priority of the management task to be executed, and correspondingly distributing the management task to be executed to a first server IP address corresponding to the first task lock, so that the first server performs execution management on the management task to be executed according to a preset competitive execution method, the task priority of the management task to be executed and the maximum thread number of the first task lock; the management integration tasks to be executed comprise one or more management tasks to be executed.
As an improvement of the above solution, defining and initializing task locks corresponding to different task types according to the configuration information specifically includes: defining task locks corresponding to each task type to be configured according to the configuration information; the configuration information comprises a user expected lock type, a corresponding task type to be configured and an expected maximum thread number; the user desired lock types include local locks and global locks; traversing a second task lock with the user expected lock type being a local lock, initializing the maximum thread number of the second task lock in a current container node to be the expected maximum thread number, and distributing a corresponding second server IP address for the second task lock according to the expected maximum thread number; traversing a third task lock with the user expected lock type being a global lock to obtain the total node number and the active node number of the third task lock, initializing the third task lock according to the expected maximum thread number, the total node number and the active node number, and distributing a corresponding third server IP address for the third task lock according to the expected maximum thread number.
As an improvement of the above solution, the execution management of the management task to be executed by the first server according to a preset contention executing method, a task priority of the management task to be executed, and a maximum thread number of the first task lock specifically includes: the first server competes for the first task lock, and acquires a first task from a to-be-executed list when the competition is successful; the to-be-executed list at least comprises the to-be-executed management task; according to the task priority of the first task, sequencing the first task from high to low according to the task priority to obtain a task execution sequence, sequentially executing the first tasks of which the number is preset before in the task execution sequence, and correspondingly deleting the first tasks from the list to be executed after the first tasks are executed; the preset number is the maximum thread number; repeating the above steps.
As an improvement of the above solution, the first server contends for the first task lock, specifically including: acquiring first lock information of the first task lock, and judging whether a first lock type of the first task lock is a global lock or not; the first lock information comprises a first lock type and a first maximum thread number; when the first lock type is a global lock, traversing an instance list of the first task lock to acquire the number of lock instances occupied by the first server, and judging whether lock competition or lock release should be performed currently according to the number of the lock instances and the first maximum thread number; if the lock competition is supposed to be carried out currently, the first task lock is tried to be acquired by using the first lock information, whether the competition is successful is judged according to the acquisition result, when the competition is successful, the occupied server of the first task lock is modified to be the first server, the lock occupied information of the first server is updated, and if the competition is failed, the step is repeated.
As an improvement of the above solution, after determining whether lock contention or lock release should be performed currently according to the number of lock instances and the first maximum thread number, the execution management method further includes: and if the lock release is currently performed, releasing the first task lock.
As an improvement of the above solution, the execution management method further includes: when an export instruction sent by a user is received, exporting an integration scheme or a process corresponding to a task to be migrated to a first resource file, exporting a first task lock to be migrated corresponding to the task to be migrated to the first resource file, and exporting resources relied by the integration scheme or the process to the first resource file by using topological ordering; the export instruction comprises a task to be migrated; when an environment migration instruction sent by a user is received, a second task lock to be migrated is obtained from the environment migration instruction, the second task lock to be migrated is reconfigured according to migration environment information, and a second resource file is imported into a migration environment; the environment migration instruction comprises a migration environment, migration environment information and a second resource file, and the second resource file comprises a second task lock to be migrated.
As an improvement of the above solution, the execution management method further includes: traversing a server instance table to obtain the latest update time of the current server; judging whether the current server is abnormal or not according to the latest updating time and a preset abnormal threshold value, and releasing a lock instance occupied by the current server and reinitializing lock loading when judging that the current server is abnormal; a broadcast notification reinitializes lock loading for servers other than the current server.
Another embodiment of the present invention correspondingly provides an integrated task execution management device, where the execution management device includes a lock configuration unit and an execution management unit, where the lock configuration unit is configured to obtain configuration information sent by a user, define and initialize task locks corresponding to different task types according to the configuration information, and obtain lock information corresponding to the task locks: the lock information comprises a task type, a lock type, a server IP address and a maximum thread number; the lock types include local locks and global locks; the execution management unit is used for acquiring lock information of a first task lock corresponding to a management task to be executed and task priority of the management task to be executed when receiving the management integrated task to be executed, and correspondingly distributing the management task to be executed to a first server IP address corresponding to the first task lock so that the first server carries out execution management on the management task to be executed according to a preset competitive execution method, the task priority of the management task to be executed and the maximum thread number of the first task lock; the management integration tasks to be executed comprise one or more management tasks to be executed.
As an improvement of the above, the lock configuration unit is configured to: defining task locks corresponding to each task type to be configured according to the configuration information; the configuration information comprises a user expected lock type, a corresponding task type to be configured and an expected maximum thread number; the user desired lock types include local locks and global locks; traversing a second task lock with the user expected lock type being a local lock, initializing the maximum thread number of the second task lock in a current container node to be the expected maximum thread number, and distributing a corresponding second server IP address for the second task lock according to the expected maximum thread number; traversing a third task lock with the user expected lock type being a global lock to obtain the total node number and the active node number of the third task lock, initializing the third task lock according to the expected maximum thread number, the total node number and the active node number, and distributing a corresponding third server IP address for the third task lock according to the expected maximum thread number.
As an improvement of the above solution, the execution management unit is further configured to: the first server competes for the first task lock, and acquires a first task from a to-be-executed list when the competition is successful; the to-be-executed list at least comprises the to-be-executed management task; according to the task priority of the first task, sequencing the first task from high to low according to the task priority to obtain a task execution sequence, sequentially executing the first tasks of which the number is preset before in the task execution sequence, and correspondingly deleting the first tasks from the list to be executed after the first tasks are executed; the preset number is the maximum thread number; repeating the above steps.
As an improvement of the above solution, the execution management unit is further configured to: acquiring first lock information of the first task lock, and judging whether a first lock type of the first task lock is a global lock or not; the first lock information comprises a first lock type and a first maximum thread number; when the first lock type is a global lock, traversing an instance list of the first task lock to acquire the number of lock instances occupied by the first server, and judging whether lock competition or lock release should be performed currently according to the number of the lock instances and the first maximum thread number; if the lock competition is supposed to be carried out currently, the first task lock is tried to be acquired by using the first lock information, whether the competition is successful is judged according to the acquisition result, when the competition is successful, the occupied server of the first task lock is modified to be the first server, the lock occupied information of the first server is updated, and if the competition is failed, the step is repeated.
As an improvement of the above solution, the execution management unit is further configured to: and if the lock release is currently performed, releasing the first task lock.
As an improvement of the above-described aspect, the execution management apparatus further includes an export migration unit configured to: when an export instruction sent by a user is received, exporting an integration scheme or a process corresponding to a task to be migrated to a first resource file, exporting a first task lock to be migrated corresponding to the task to be migrated to the first resource file, and exporting resources relied by the integration scheme or the process to the first resource file by using topological ordering; the export instruction comprises a task to be migrated; when an environment migration instruction sent by a user is received, a second task lock to be migrated is obtained from the environment migration instruction, the second task lock to be migrated is reconfigured according to migration environment information, and a second resource file is imported into a migration environment; the environment migration instruction comprises a migration environment, migration environment information and a second resource file, and the second resource file comprises a second task lock to be migrated.
As an improvement of the above-described aspect, the execution management apparatus further includes an abnormal fault tolerance unit configured to: traversing a server instance table to obtain the latest update time of the current server; judging whether the current server is abnormal or not according to the latest updating time and a preset abnormal threshold value, and releasing a lock instance occupied by the current server and reinitializing lock loading when judging that the current server is abnormal; a broadcast notification reinitializes lock loading for servers other than the current server.
Another embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where when the computer program runs, a device where the computer readable storage medium is controlled to execute the integrated task execution management method as described above.
An embodiment of the invention provides a computer program product which, when run on a computer, causes the computer to perform an integrated task execution management method as described above.
Another embodiment of the present invention provides an integrated task execution management system including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the integrated task execution management method as described above when executing the computer program.
Compared with the prior art, the technical scheme has the following beneficial effects:
the invention provides an integrated task execution management method, an integrated task execution management device, a computer readable storage medium and an integrated task execution management system, wherein global locks or local locks are defined for different task types, and after an integrated task to be executed is received, tasks of a server with the maximum number of threads for obtaining the task locks are executed and processed at the same time.
Furthermore, the integrated task execution management method, the integrated task execution management device, the computer readable storage medium and the integrated task execution management system provided by the invention can be rapidly deployed from the environment to be migrated to the migration environment by supporting the export and import of the configuration, so that the efficiency and convenience of building the execution management environment are improved.
Drawings
FIG. 1 is a flow chart of an integrated task execution management method according to an embodiment of the present invention;
FIG. 2 is a logic flow diagram of a task reassignment process provided by an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an integrated task execution management device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Detailed description of the preferred embodiments
The embodiment of the invention firstly describes an integrated task execution management method. Fig. 1 is a flowchart of an integrated task execution management method according to an embodiment of the present invention.
As shown in fig. 1, the execution management method includes:
s1, acquiring configuration information sent by a user, defining and initializing task locks corresponding to different task types according to the configuration information, and acquiring lock information corresponding to the task locks.
The lock information comprises a task type, a lock type, a server IP address and a maximum thread number; the lock types include local locks and global locks. The local lock is applied to all container nodes and controls the maximum concurrency number of the tasks on each node. The global lock is applied to all container nodes and controls the maximum concurrency of the tasks on the whole nodes. After the task locks are successfully stored, a lock entry is initialized according to the configured thread number, and an execution server IP is randomly allocated to each lock.
In the technical scheme, the custom global lock can limit the task to be executed by a single thread in a single container process; the custom local lock can fully utilize the resources of each container without occupying all task threads of each container, and can control the maximum execution threads of each container aiming at the tasks.
In one embodiment, defining and initializing task locks corresponding to different task types according to the configuration information specifically includes: defining task locks corresponding to each task type to be configured according to the configuration information; the configuration information comprises a user expected lock type, a corresponding task type to be configured and an expected maximum thread number; the user desired lock types include local locks and global locks; traversing a second task lock with the user expected lock type being a local lock, initializing the maximum thread number of the second task lock in a current container node to be the expected maximum thread number, and distributing a corresponding second server IP address for the second task lock according to the expected maximum thread number; traversing a third task lock with the user expected lock type being a global lock to obtain the total node number and the active node number of the third task lock, initializing the third task lock according to the expected maximum thread number, the total node number and the active node number, and distributing a corresponding third server IP address for the third task lock according to the expected maximum thread number.
S2, when receiving an integrated task to be executed, acquiring lock information of a first task lock corresponding to the task to be executed and task priority of the task to be executed, correspondingly distributing the task to be executed to a first server IP address corresponding to the first task lock, so that the first server executes and manages the task to be executed according to a preset competitive executing method, the task priority of the task to be executed and the maximum thread number of the first task lock; the management integration tasks to be executed comprise one or more management tasks to be executed.
In practical application, after the tasks are generated by the integrated process of the background task lock, only the tasks competing for the task lock can be executed, and the other tasks are in a queuing state.
In one embodiment, the first server performs execution management on the management task to be executed according to a preset contention executing method, a task priority of the management task to be executed, and a maximum thread number of the first task lock, and specifically includes: the first server competes for the first task lock, and acquires a first task from a to-be-executed list when the competition is successful; the to-be-executed list at least comprises the to-be-executed management task; according to the task priority of the first task, sequencing the first task from high to low according to the task priority to obtain a task execution sequence, sequentially executing the first tasks of which the number is preset before in the task execution sequence, and correspondingly deleting the first tasks from the list to be executed after the first tasks are executed; the preset number is the maximum thread number; repeating the above steps.
In one embodiment, the first server contends for the first task lock, specifically comprising: acquiring first lock information of the first task lock, and judging whether a first lock type of the first task lock is a global lock or not; when the first lock type is a global lock, traversing an instance list of the first task lock to acquire the number of lock instances occupied by the first server, and judging whether lock competition or lock release should be performed currently according to the number of the lock instances and the first maximum thread number; if the lock competition is supposed to be carried out currently, the first task lock is tried to be acquired by using the first lock information, whether the competition is successful is judged according to the acquisition result, when the competition is successful, the occupied server of the first task lock is modified to be the first server, the lock occupied information of the first server is updated, and if the competition is failed, the step is repeated.
Wherein the first lock information includes a first lock type and a first maximum thread number; the calculation process of the first maximum thread number is as follows: and obtaining the total node number and the active node number of the global lock, and taking an integer value which is closest to the value obtained by dividing the total node number by the active node number as a first maximum thread number.
In one embodiment, determining whether lock contention or lock release should be performed currently according to the number of lock instances and the first maximum thread number specifically includes: when the number of lock instances reaches the first maximum thread number, lock release should be performed; when the number of lock instances does not reach the first maximum thread number, lock contention should occur.
In the lock competition process, attempting to acquire a distributed lock (namely a corresponding task lock) by using lock information, if the acquisition is successful, representing that the competition is successful, at the moment, modifying an occupied server of the lock into a current server, and updating the lock occupation condition of a current server node; if the acquisition is unsuccessful, the contention is failed, which indicates that the lock may have been occupied by another server, the lock contention is exited, and the next piece of data is iterated.
In one embodiment, after determining whether lock contention or lock release should be performed currently according to the number of lock instances and the first maximum thread number, the execution management method further includes: and if the lock release is currently carried out, releasing the first task lock, and repeating the traversing judgment process. The traversing judging process comprises the following steps: and traversing the instance list of the first task lock to obtain the number of lock instances occupied by the first server, and judging whether lock competition or lock release is carried out currently according to the number of the lock instances and the first maximum thread number.
In order to facilitate and efficiently achieve the effect of improving the utilization efficiency and stability of computing resources in a new environment, topology ordering is used to export dependent resources into resource files when the integration scheme or flow is exported, and global locks associated with tasks are imported into the environment when the new environment (described as a "migration environment") is imported, and at the same time, execution servers for distributing the locks are reinitialized according to a new environment server cluster.
In one embodiment, the execution management method further includes: when an export instruction sent by a user is received, exporting an integration scheme or a process corresponding to a task to be migrated to a first resource file, exporting a first task lock to be migrated corresponding to the task to be migrated to the first resource file, and exporting resources relied by the integration scheme or the process to the first resource file by using topological ordering; the export instruction comprises a task to be migrated; when an environment migration instruction sent by a user is received, a second task lock to be migrated is obtained from the environment migration instruction, the second task lock to be migrated is reconfigured according to migration environment information, and a second resource file is imported into a migration environment; the environment migration instruction comprises a migration environment, migration environment information and a second resource file, and the second resource file comprises a second task lock to be migrated. In one embodiment, the first resource file and the second resource file refer to the same file.
In practical application, in order to improve the fault tolerance of execution management, when a container node has a single point of failure, the task ownership weight of the container node can be redistributed to other nodes for execution, a timing monitoring task needs to be executed at a preset time interval (for example, 20 minutes), and when the container is monitored to be abnormal, the task redistribution of the failed node is performed. FIG. 2 is a logic flow diagram of a task reassignment process according to an embodiment of the present invention, which is specifically described as follows: 1) Traversing the server instance table, for example, if the update time of the server is 40 minutes ago, then deeming that the server has been abnormally shut down; 2) Releasing a lock instance occupied by the offline server; 3) The current server reinitializes the lock loading; 4) With the MQ broadcast mechanism, the broadcast informs other servers to reinitialize the lock loading.
In one embodiment, the execution management method further includes: traversing a server instance table to obtain the latest update time of the current server; judging whether the current server is abnormal or not according to the latest updating time and a preset abnormal threshold value, and releasing a lock instance occupied by the current server and reinitializing lock loading when judging that the current server is abnormal; a broadcast notification reinitializes lock loading for servers other than the current server.
Through the above-mentioned process, make this scheme compare with prior art can realize: 1) Resources of each container node in the cluster can be fully and flexibly utilized; 2) The method can control the global maximum concurrency number and the maximum concurrency number of each node; 3) The defined task lock can be multiplexed to the integration related task; 4) The task lock supports visual configuration and can be quickly migrated to formal environment use through export import.
The embodiment of the invention describes an integrated task execution management method system, which is characterized in that global locks or local locks are defined for different task types, and after an integrated task to be executed is received, tasks of servers with the maximum number of threads for acquiring the task locks are only executed and processed at the same time; furthermore, the integrated task execution management method described in the embodiment of the invention can be rapidly deployed from the environment to be migrated to the migration environment by supporting the export and import of the configuration, thereby improving the efficiency and convenience of constructing the execution management environment.
Second embodiment
In addition to the method, the embodiment of the invention also discloses an integrated task execution management device. Fig. 3 is a schematic structural diagram of an integrated task execution management device according to an embodiment of the present invention.
As shown in fig. 3, the execution management device includes a lock configuration unit and an execution management unit, where the lock configuration unit is configured to obtain configuration information sent by a user, define and initialize task locks corresponding to different task types according to the configuration information, and obtain lock information corresponding to the task locks: the lock information comprises a task type, a lock type, a server IP address and a maximum thread number; the lock types include local locks and global locks; the execution management unit is used for acquiring lock information of a first task lock corresponding to a management task to be executed and task priority of the management task to be executed when receiving the management integrated task to be executed, and correspondingly distributing the management task to be executed to a first server IP address corresponding to the first task lock so that the first server carries out execution management on the management task to be executed according to a preset competitive execution method, the task priority of the management task to be executed and the maximum thread number of the first task lock; the management integration tasks to be executed comprise one or more management tasks to be executed.
In one embodiment, the lock configuration unit is for: defining task locks corresponding to each task type to be configured according to the configuration information; the configuration information comprises a user expected lock type, a corresponding task type to be configured and an expected maximum thread number; the user desired lock types include local locks and global locks; traversing a second task lock with the user expected lock type being a local lock, initializing the maximum thread number of the second task lock in a current container node to be the expected maximum thread number, and distributing a corresponding second server IP address for the second task lock according to the expected maximum thread number; traversing a third task lock with the user expected lock type being a global lock to obtain the total node number and the active node number of the third task lock, initializing the third task lock according to the expected maximum thread number, the total node number and the active node number, and distributing a corresponding third server IP address for the third task lock according to the expected maximum thread number.
In an embodiment, the execution management unit is further configured to: the first server competes for the first task lock, and acquires a first task from a to-be-executed list when the competition is successful; the to-be-executed list at least comprises the to-be-executed management task; according to the task priority of the first task, sequencing the first task from high to low according to the task priority to obtain a task execution sequence, sequentially executing the first tasks of which the number is preset before in the task execution sequence, and correspondingly deleting the first tasks from the list to be executed after the first tasks are executed; the preset number is the maximum thread number; repeating the above steps.
In an embodiment, the execution management unit is further configured to: acquiring first lock information of the first task lock, and judging whether a first lock type of the first task lock is a global lock or not; the first lock information comprises a first lock type and a first maximum thread number; when the first lock type is a global lock, traversing an instance list of the first task lock to acquire the number of lock instances occupied by the first server, and judging whether lock competition or lock release should be performed currently according to the number of the lock instances and the first maximum thread number; if the lock competition is supposed to be carried out currently, the first task lock is tried to be acquired by using the first lock information, whether the competition is successful is judged according to the acquisition result, when the competition is successful, the occupied server of the first task lock is modified to be the first server, the lock occupied information of the first server is updated, and if the competition is failed, the step is repeated.
In an embodiment, the execution management unit is further configured to: and if the lock release is currently performed, releasing the first task lock.
In one embodiment, the execution management device further comprises an export migration unit for: when an export instruction sent by a user is received, exporting an integration scheme or a process corresponding to a task to be migrated to a first resource file, exporting a first task lock to be migrated corresponding to the task to be migrated to the first resource file, and exporting resources relied by the integration scheme or the process to the first resource file by using topological ordering; the export instruction comprises a task to be migrated; when an environment migration instruction sent by a user is received, a second task lock to be migrated is obtained from the environment migration instruction, the second task lock to be migrated is reconfigured according to migration environment information, and a second resource file is imported into a migration environment; the environment migration instruction comprises a migration environment, migration environment information and a second resource file, and the second resource file comprises a second task lock to be migrated.
In one embodiment, the execution management device further includes an exception fault tolerance unit for: traversing a server instance table to obtain the latest update time of the current server; judging whether the current server is abnormal or not according to the latest updating time and a preset abnormal threshold value, and releasing a lock instance occupied by the current server and reinitializing lock loading when judging that the current server is abnormal; a broadcast notification reinitializes lock loading for servers other than the current server.
Wherein the integrated units of the execution management device may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by instructing related hardware by a computer program, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of each of the method embodiments described above when executed by a processor. Another embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where when the computer program runs, a device where the computer readable storage medium is controlled to execute the integrated task execution management method as described above.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
An embodiment of the present invention provides a computer program product, which when run on a computer, causes the computer to execute the integrated task execution management method as described above, and can achieve all technical effects corresponding to the foregoing method.
It should be noted that the above-described apparatus embodiments are merely illustrative, and the units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the invention, the connection relation between the units indicates that the units have communication connection, and the connection relation can be specifically realized as one or more communication buses or signal lines. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The embodiment of the invention describes an integrated task execution management device and a computer readable storage medium, which are used for improving the utilization efficiency and stability of computing resources by defining global locks or local locks for different task types and executing only the tasks of servers with the maximum number of threads for processing and obtaining the task locks at the same moment after receiving the integrated task to be executed and managing the integrated task; furthermore, the integrated task execution management device and the computer readable storage medium described in the embodiments of the present invention further support the export and import of the configuration, so that the configuration can be rapidly deployed from the environment to be migrated to the migration environment, and further the efficiency and convenience of setting up the execution management environment are improved.
Detailed description of the preferred embodiments
In addition to the method and the device, the embodiment of the invention also describes an integrated task execution management system.
The execution management system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, which when executed implements the integrated task execution management method as described above.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is the control center of the device, connecting the various parts of the overall device using various interfaces and lines.
The memory may be used to store the computer program and/or modules, and the processor may implement various functions of the apparatus by running or executing the computer program and/or modules stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
The embodiment of the invention describes an integrated task execution management system, which is used for improving the utilization efficiency and stability of computing resources by defining global locks or local locks for different task types and executing the tasks of a server which only processes the maximum number of threads for obtaining the task locks at the same time after receiving the integrated task to be executed and managing the integrated task; furthermore, the integrated task execution management system described in the embodiment of the invention can be rapidly deployed from the environment to be migrated to the migration environment by supporting the export and import of the configuration, thereby improving the efficiency and convenience of the construction of the execution management environment.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (10)

1. An integrated task execution management method, characterized in that the execution management method comprises:
acquiring configuration information sent by a user, defining and initializing task locks corresponding to different task types according to the configuration information, and acquiring lock information corresponding to the task locks: the lock information comprises a task type, a lock type, a server IP address and a maximum thread number;
When receiving an integrated task to be executed, acquiring lock information of a first task lock corresponding to the management task to be executed and task priority of the management task to be executed, and correspondingly distributing the management task to be executed to a first server IP address corresponding to the first task lock, so that the first server performs execution management on the management task to be executed according to a preset competitive execution method, the task priority of the management task to be executed and the maximum thread number of the first task lock; the management integration tasks to be executed comprise one or more management tasks to be executed.
2. The integrated task execution management method according to claim 1, wherein task locks corresponding to different task types are defined and initialized according to the configuration information, and specifically comprising:
defining task locks corresponding to each task type to be configured according to the configuration information; the configuration information comprises a user expected lock type, a corresponding task type to be configured and an expected maximum thread number; the user desired lock types include local locks and global locks;
traversing a second task lock with the user expected lock type being a local lock, initializing the maximum thread number of the second task lock in a current container node to be the expected maximum thread number, and distributing a corresponding second server IP address for the second task lock according to the expected maximum thread number;
Traversing a third task lock with the user expected lock type being a global lock to obtain the total node number and the active node number of the third task lock, initializing the third task lock according to the expected maximum thread number, the total node number and the active node number, and distributing a corresponding third server IP address for the third task lock according to the expected maximum thread number.
3. The integrated task execution management method according to claim 1, wherein the first server performs execution management on the management task to be executed according to a preset contention execution method, a task priority of the management task to be executed, and a maximum thread number of the first task lock, and specifically includes:
the first server competes for the first task lock, and acquires a first task from a to-be-executed list when the competition is successful; the to-be-executed list at least comprises the to-be-executed management task;
according to the task priority of the first task, sequencing the first task from high to low according to the task priority to obtain a task execution sequence, sequentially executing the first tasks of which the number is preset before in the task execution sequence, and correspondingly deleting the first tasks from the list to be executed after the first tasks are executed; the preset number is the maximum thread number;
Repeating the above steps.
4. The integrated task execution management method of claim 3, wherein the first server contends for the first task lock, specifically comprising:
acquiring first lock information of the first task lock, and judging whether a first lock type of the first task lock is a global lock or not; the first lock information comprises a first lock type and a first maximum thread number;
when the first lock type is a global lock, traversing an instance list of the first task lock to acquire the number of lock instances occupied by the first server, and judging whether lock competition or lock release should be performed currently according to the number of the lock instances and the first maximum thread number;
if the lock competition is supposed to be carried out currently, the first task lock is tried to be acquired by using the first lock information, whether the competition is successful is judged according to the acquisition result, when the competition is successful, the occupied server of the first task lock is modified to be the first server, the lock occupied information of the first server is updated, and if the competition is failed, the step is repeated.
5. The integrated task execution management method of claim 4, wherein after determining whether lock contention or lock release should currently occur based on the number of lock instances and the first maximum number of threads, the execution management method further comprises:
And if the lock release is currently performed, releasing the first task lock.
6. The integrated task execution management method according to claim 1, characterized in that the execution management method further comprises:
when an export instruction sent by a user is received, exporting an integration scheme or a process corresponding to a task to be migrated to a first resource file, exporting a first task lock to be migrated corresponding to the task to be migrated to the first resource file, and exporting resources relied by the integration scheme or the process to the first resource file by using topological ordering; the export instruction comprises a task to be migrated;
when an environment migration instruction sent by a user is received, a second task lock to be migrated is obtained from the environment migration instruction, the second task lock to be migrated is reconfigured according to migration environment information, and a second resource file is imported into a migration environment; the environment migration instruction comprises a migration environment, migration environment information and a second resource file, and the second resource file comprises a second task lock to be migrated.
7. The integrated task execution management method according to any one of claims 1 to 6, characterized in that the execution management method further comprises:
Traversing a server instance table to obtain the latest update time of the current server;
judging whether the current server is abnormal or not according to the latest updating time and a preset abnormal threshold value, and releasing a lock instance occupied by the current server and reinitializing lock loading when judging that the current server is abnormal;
a broadcast notification reinitializes lock loading for servers other than the current server.
8. An integrated task execution management device, characterized in that the execution management device comprises a lock configuration unit and an execution management unit, wherein,
the lock configuration unit is used for acquiring configuration information sent by a user, defining and initializing task locks corresponding to different task types according to the configuration information, and acquiring lock information corresponding to the task locks: the lock information comprises a task type, a lock type, a server IP address and a maximum thread number; the lock types include local locks and global locks;
the execution management unit is used for acquiring lock information of a first task lock corresponding to a management task to be executed and task priority of the management task to be executed when receiving the management integrated task to be executed, and correspondingly distributing the management task to be executed to a first server IP address corresponding to the first task lock so that the first server carries out execution management on the management task to be executed according to a preset competitive execution method, the task priority of the management task to be executed and the maximum thread number of the first task lock; the management integration tasks to be executed comprise one or more management tasks to be executed.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the integrated task execution management method according to any one of claims 1 to 7.
10. An integrated task execution management system, characterized in that it comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the integrated task execution management method according to any one of claims 1 to 7 when executing the computer program.
CN202310689537.2A 2023-06-12 2023-06-12 Integrated task execution management method, device, storage medium and system Pending CN116841734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310689537.2A CN116841734A (en) 2023-06-12 2023-06-12 Integrated task execution management method, device, storage medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310689537.2A CN116841734A (en) 2023-06-12 2023-06-12 Integrated task execution management method, device, storage medium and system

Publications (1)

Publication Number Publication Date
CN116841734A true CN116841734A (en) 2023-10-03

Family

ID=88168051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310689537.2A Pending CN116841734A (en) 2023-06-12 2023-06-12 Integrated task execution management method, device, storage medium and system

Country Status (1)

Country Link
CN (1) CN116841734A (en)

Similar Documents

Publication Publication Date Title
CN108737270B (en) Resource management method and device for server cluster
US7360208B2 (en) Rolling upgrade of distributed software with automatic completion
CN107291750B (en) Data migration method and device
CN109375933B (en) Method and equipment for upgrading client
CN109173270B (en) Game service system and implementation method
CN115328663A (en) Method, device, equipment and storage medium for scheduling resources based on PaaS platform
CN110377431B (en) Service calling method and device under multi-registry scene
CN111181765A (en) Task processing method and device
US10498617B1 (en) System, method, and computer program for highly available and scalable application monitoring
CN108111630B (en) Zookeeper cluster system and connection method and system thereof
CN113079098B (en) Method, device, equipment and computer readable medium for updating route
CN111756800A (en) Method and system for processing burst flow
CN111522664A (en) Service resource management and control method and device based on distributed service
CN116841734A (en) Integrated task execution management method, device, storage medium and system
US9973569B2 (en) System, method and computing apparatus to manage process in cloud infrastructure
CN110851166A (en) User-unaware application program updating method and device and computer equipment
US20240012632A1 (en) Coordinating updates to an agent platform appliance in which agents of cloud services are deployed
CN114124901B (en) Pod structure modification method, device, computer equipment and storage medium
CN111767122A (en) Distributed task scheduling management method and device
CN106936643B (en) Equipment linkage method and terminal equipment
CN110493327B (en) Data transmission method and device
CN114756527A (en) Method and device for expanding Redis cluster, electronic equipment and storage medium
CN116155911A (en) Version upgrading method and device
CN114564530A (en) Database access method, device, equipment and storage medium
CN107317880B (en) Method and device for realizing load balance

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