Nothing Special   »   [go: up one dir, main page]

CN106855824B - Task stopping method and device and electronic equipment - Google Patents

Task stopping method and device and electronic equipment Download PDF

Info

Publication number
CN106855824B
CN106855824B CN201510902549.4A CN201510902549A CN106855824B CN 106855824 B CN106855824 B CN 106855824B CN 201510902549 A CN201510902549 A CN 201510902549A CN 106855824 B CN106855824 B CN 106855824B
Authority
CN
China
Prior art keywords
task
cluster
time
preset
cluster task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510902549.4A
Other languages
Chinese (zh)
Other versions
CN106855824A (en
Inventor
沈巧志
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201510902549.4A priority Critical patent/CN106855824B/en
Publication of CN106855824A publication Critical patent/CN106855824A/en
Application granted granted Critical
Publication of CN106855824B publication Critical patent/CN106855824B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4831Task transfer initiation or dispatching by interrupt, e.g. masked with variable priority
    • G06F9/4837Task transfer initiation or dispatching by interrupt, e.g. masked with variable priority time dependent
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a task stopping method, a task stopping device and electronic equipment, wherein the method comprises the following steps: acquiring a cluster task directory; analyzing the obtained cluster task directory to obtain the information of each cluster task, wherein the information at least comprises the following components: the task starting time and the task owner; for each cluster task, judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by a permission configuration file; if the time is out, alarm information is sent to the belonged person of the cluster task; when the running time of the cluster task reaches a second preset task executing time, judging whether the authority of the owner of the cluster task meets a preset condition; if so, the clustering task is stopped. By applying the embodiment of the invention, the tasks with longer running time are stopped, and then the cluster resources are released, so that the tasks with high priority can obtain the cluster resources in time.

Description

Task stopping method and device and electronic equipment
Technical Field
The invention relates to the technical field of computer clusters, in particular to a task stopping method and device and electronic equipment.
Background
A computer cluster is a server architecture formed by the interconnection of multiple server hosts.
However, because cluster resources are limited, in general, a task with a high priority can obtain the cluster resources preferentially over a task with a low priority, which are initiated at the same time; however, if the low-priority task has an initiation time earlier than the high-priority task, the high-priority task cannot obtain the cluster resources in time.
Disclosure of Invention
The embodiment of the invention aims to provide a task stopping method, a task stopping device and electronic equipment, so that a task with high priority can obtain cluster resources in time.
In order to achieve the above object, an embodiment of the present invention discloses a task stopping method, applied to an electronic device, including:
acquiring a cluster task directory;
analyzing the obtained cluster task directory to obtain the information of each cluster task, wherein the information at least comprises the following components: the task starting time and the task owner;
for each cluster task, judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by a permission configuration file;
if the time is out, alarm information is sent to the belonged person of the cluster task;
when the running time of the cluster task reaches a second preset task execution time, judging whether the authority of the owner of the cluster task meets a preset condition, wherein the second preset task execution time is larger than the first preset task execution time;
if so, the cluster task is stopped to release the cluster resources.
Optionally, the obtaining the cluster task directory includes:
and acquiring a cluster task directory every preset time or every time a preset time point is reached.
Optionally, the first preset task execution time includes:
alarm time corresponding to the cluster task; or
And alarm time corresponding to the authority owned by the owner corresponding to the cluster task.
Optionally, the determining whether the authority of the owner of the cluster task meets a preset condition includes:
and judging whether the authority of the belonger of the cluster task is low, if so, indicating that the authority of the belonger of the cluster task meets a preset condition.
Optionally, the determining whether the authority of the owner of the cluster task meets a preset condition includes:
and judging whether the authority of the belonger of the cluster task is lower than a preset authority, if so, indicating that the authority of the belonger of the cluster task meets a preset condition.
In order to achieve the above object, an embodiment of the present invention discloses a task stopping device, applied to an electronic device, including: an obtaining module, an analyzing module, a first judging module, a sending module, a second judging module and a stopping module, wherein,
the obtaining module is used for obtaining a cluster task directory;
the analysis module is configured to analyze the cluster task directory obtained by the obtaining module to obtain information of each cluster task, where the information at least includes: the task starting time and the task owner;
the first judging module is used for judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by the permission configuration file, aiming at each cluster task;
the sending module is used for sending alarm information to the belonger of the cluster task under the condition that the judgment result of the first judging module is yes;
the second judging module is used for judging whether the authority of the owner of the cluster task meets a preset condition or not when the running time of the cluster task reaches a second preset task execution time, wherein the second preset task execution time is larger than the first preset task execution time;
and the stopping module is used for stopping the cluster task to release the cluster resources under the condition that the judgment result of the second judging module is yes.
Optionally, the obtaining module is specifically configured to:
and acquiring a cluster task directory every preset time or every time a preset time point is reached.
Optionally, the first preset task execution time includes:
alarm time corresponding to the cluster task; or
And alarm time corresponding to the authority owned by the owner corresponding to the cluster task.
Optionally, the second determining module is specifically configured to:
and when the running time of the cluster task reaches the second preset task executing time, judging whether the authority of the belonger of the cluster task is low, if so, indicating that the authority of the belonger of the cluster task meets the preset condition.
Optionally, the second determining module is specifically configured to:
when the running time of the cluster task reaches the second preset task executing time, whether the authority of the owner of the cluster task is lower than the preset authority is judged, and if yes, the authority of the owner of the cluster task meets the preset condition is shown.
In order to achieve the above object, an embodiment of the present invention discloses an electronic device, including: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of:
acquiring a cluster task directory;
analyzing the obtained cluster task directory to obtain the information of each cluster task, wherein the information at least comprises the following components: the task starting time and the task owner;
for each cluster task, judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by a permission configuration file;
if the time is out, alarm information is sent to the belonged person of the cluster task;
when the running time of the cluster task reaches a second preset task execution time, judging whether the authority of the owner of the cluster task meets a preset condition, wherein the second preset task execution time is larger than the first preset task execution time;
if so, the cluster task is stopped to release the cluster resources.
The technical scheme shows that the embodiment of the invention discloses a task stopping method, a task stopping device and electronic equipment, wherein the method comprises the following steps: acquiring a cluster task directory; analyzing the obtained cluster task directory to obtain the information of each cluster task, wherein the information at least comprises the following components: the task starting time and the task owner; for each cluster task, judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by a permission configuration file; if the time is out, alarm information is sent to the belonged person of the cluster task; when the running time of the cluster task reaches a second preset task execution time, judging whether the authority of the owner of the cluster task meets a preset condition, wherein the second preset task execution time is larger than the first preset task execution time; if so, the cluster task is stopped to release the cluster resources.
By applying the technical method provided by the embodiment of the invention, the tasks with longer running time (the tasks with low efficiency) are stopped, and then the cluster resources are released, so that the tasks with high priority can obtain the cluster resources in time. And the tasks can be transparently managed by configuring the execution time of each task or the execution time of the tasks with the same priority level, the authority of the task owner and the like in the authority configuration file.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a task stopping method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a task stopping device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present 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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem of the prior art, embodiments of the present invention provide a task stopping method and apparatus, and an electronic device. First, a task stopping method provided in an embodiment of the present invention is described below.
It should be noted that the embodiment of the present invention is preferably applied to an electronic device, and in practical applications, the electronic device may be a server, which is not limited in this respect.
Fig. 1 is a schematic flowchart of a task stopping method according to an embodiment of the present invention, which may include:
s101: acquiring a cluster task directory;
s102: analyzing the obtained cluster task directory to obtain the information of each cluster task;
wherein the information at least comprises: the task starting time and the task owner;
s103: for each cluster task, judging whether the cluster task is overtime or not according to the first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by the permission configuration file, and if yes, executing S104;
s104: sending alarm information to the belonged person of the cluster task;
s105: when the running time of the cluster task reaches the second preset task execution time, judging whether the authority of the owner of the cluster task meets the preset condition, if so, executing S106;
the second preset task execution time is greater than the first preset task execution time;
in general, the second preset task execution time of a certain cluster task is N times of the alarm time corresponding to the cluster task, where N is greater than 1, and it is assumed that N is 1.3.
S106: the cluster task is stopped to release cluster resources.
Specifically, in practical application, information such as an identifier of each cluster task, task start time, task owner, and task state is recorded in the cluster task directory. Therefore, a cluster task directory can be obtained and analyzed to obtain information of each cluster task, the task identifier can be a task name or a task number (ID), and the cluster resource can be a CPU, a memory, a bandwidth, a traffic, and the like.
In practical applications, the cluster task directory may be obtained at preset time intervals, for example: acquiring a cluster task directory every 1 hour; the cluster task directory may also be obtained every time a preset time point is reached, for example: the preset time points are 8:00, 11:00, 13:00 and 17:00 every day, and the cluster task directory is obtained when the time points are reached.
Assuming that the cluster task directory is as shown in table 1,
TABLE 1
Task numbering Task start time Task owner Task owner level Task state
1 2015, 10 months, 18 days, 9:35 A Height of Is running
2 2015, 10 months, 18 days, 9:40 B Is low in Pausing
3 2015, 10 months, 18 days, 9:42 C General purpose Is running
4 2015, 10 months, 18 days, 9:45 D Is low in Is running
The sequence of the task belonged levels from high to low is as follows: high, normal, low, in practical application, the task owner level is not limited to the above three, but there may be other types, for example: generally, higher, lower, etc., and may be set according to actual conditions.
After the cluster task directory is obtained, analyzing the cluster task directory to sequentially obtain the information of each cluster task, namely the cluster task with the task number of 1 has the task number of 1, the starting time of 2015 is 10 months, 18 days, 9:35, the task belongs to A, the task belongs to high level and the task is currently in a running state;
the cluster task with the task number of 2 has the task number of 2, the starting time of 2015, 10 months, 18 days, 9:40, the task belongs to B, the task belongs to low level and the task is in a pause state at present;
the cluster task with the task number of 3 has the task number of 3, the starting time of 2015, 10 months, 18 days, 9:42, the task belongs to C, the task belongs to ordinary grade, and the task is currently in a running state;
the cluster task with the task number of 4 has the task number of 4, the starting time of 2015, 10 months, 18 days, 9:45, the task belongs to D, the task belongs to low level and the task is currently in a running state;
for each cluster task, judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by a permission configuration file;
specifically, the first preset task execution time may be an alarm time corresponding to the trunking task, or an alarm time corresponding to a right owned by a person to which the trunking task corresponds. Specifically, in the permission configuration file, the warning time corresponding to each cluster task may be recorded in the permission configuration file, and the warning time corresponding to the permission owned by the owner corresponding to each cluster task may also be recorded, that is, a plurality of cluster tasks may correspond to the same warning time.
Taking the same alarm time corresponding to a plurality of cluster tasks as an example, it is assumed that the alarm time corresponding to the task belonging level being high is 60 minutes, the alarm time corresponding to the task belonging level being normal is 40 minutes, and the alarm time corresponding to the task belonging level being low is 20 minutes.
Assume that the current time is 2015, 10, 18, day 10: 30.
And for the cluster task with the task number of 1, determining that the current running time of the cluster task with the task number of 1 is 55 minutes, and if the current running time does not exceed 60 minutes, not processing the cluster task.
Aiming at a cluster task with a task number of 2, determining that the cluster task with the task number of 2 is in a pause state currently, wherein the duration of the cluster task is 50 minutes, assuming that the cluster task is paused for 25 minutes after running for 25 minutes, and the running time is longer than the alarm time corresponding to the task owner level of the cluster task for 20 minutes, sending alarm information to the task owner, and determining whether to stop the cluster task or start the cluster task to continue to execute by the task owner so as to complete the cluster task. Under the condition that the cluster task is continuously executed, when the cluster task runs for 1 minute again, the total running time of the cluster task reaches 26 minutes, whether the authority of the owner of the cluster task meets the preset condition is judged, and if yes, the cluster task is stopped to release cluster resources.
Specifically, two ways are available for determining whether the authority of the owner of the cluster task meets a preset condition:
in the first way, it may be determined whether the authority of the owner of the cluster task is low, and if so, it indicates that the authority of the owner of the cluster task meets a preset condition.
In a second manner, it may be determined whether the authority of the owner of the cluster task is lower than the preset authority, and if so, the authority of the owner of the cluster task satisfies a preset condition, and in practical application, the preset authority may be high.
When the first manner is adopted for judgment, the authority of the owner of the cluster task with the task number 2 is low, and the authority of the owner of the cluster task with the task number 2 is judged to be low, the cluster task with the task number 2 is stopped, so as to release cluster resources.
When the second manner is adopted for judgment, the authority of the owner of the cluster task with the task number 2 is low, and the authority of the owner of the cluster task with the task number 2 is judged to be lower than the preset authority, the cluster task with the task number 2 is stopped, so as to release cluster resources.
And aiming at the cluster task with the task number of 3, determining that the current running time of the cluster task with the task number of 3 is 48 minutes, and the running time is more than the alarm time corresponding to the task owner level of the cluster task by 40 minutes, sending alarm information to the cluster task owner, and determining whether to stop the cluster task or continue running the cluster task so as to complete the cluster task. In the case where the cluster task continues to operate, when the cluster task operates for another 4 minutes, the total operating time of the cluster task reaches 52 minutes.
When the first manner is adopted for the determination, the authority of the belonging of the cluster task with the task number 3 is normal, and if the authority of the belonging of the cluster task with the task number 3 is determined not to be low, the cluster task with the task number 3 is not stopped.
When the second method is adopted for judgment, the authority of the owner of the cluster task with the task number of 3 is normal, and the authority of the owner of the cluster task with the task number of 3 is judged to be lower than the preset authority, the cluster task with the task number of 3 is stopped, so as to release cluster resources.
And aiming at the cluster task with the task number of 4, determining that the current running time of the cluster task with the task number of 4 is 45 minutes, and the running time is 20 minutes longer than the alarm time corresponding to the task owner level of the cluster task, sending alarm information to the cluster task owner, and determining whether to stop the cluster task or continue running the cluster task so as to complete the cluster task. In the case where the cluster task continues to operate, when the cluster task operates for another 7 minutes, the total operation time of the cluster task reaches 52 minutes.
When the first manner is adopted for determination, if the authority of the belonging of the cluster task with the task number 4 is low, and if the authority of the belonging of the cluster task with the task number 3 is low, the cluster task with the task number 3 is stopped, so as to release the cluster resources.
When the second manner is adopted for judgment, the authority of the owner of the cluster task with the task number 4 is low, and the authority of the owner of the cluster task with the task number 4 is judged to be lower than the preset authority, the cluster task with the task number 4 is stopped, so as to release cluster resources.
In practical application, when a cluster task directory is obtained, the execution time of some cluster tasks exceeds N times of the alarm time corresponding to the cluster tasks. At this time, for the cluster tasks, alarm information can be directly sent to the belongers of the cluster tasks, whether the permissions of the belongers of the cluster tasks meet preset conditions or not is immediately judged, and if the permissions of the belongers of part of the cluster tasks meet the preset conditions, the part of the cluster tasks meeting the preset conditions is stopped, so that cluster resources are released.
When the cluster task is stopped and the occupied cluster resource is released, the task with high priority can obtain the cluster resource in time.
Specifically, in practical applications, the execution time of each task or the execution time of a task with the same priority in the permission configuration file, the permission of the task owner, and the like may be configured, so as to transparently manage the task.
It should be noted that, the above description is given by taking four cluster tasks as an example, which is only a specific example of the present invention and is not intended to limit the present invention.
By applying the embodiment shown in fig. 1 of the present invention, the task with longer running time (the task with low efficiency) is stopped, and then the cluster resource is released, so that the task with high priority can obtain the cluster resource in time. And the tasks can be transparently managed by configuring the execution time of each task or the execution time of the tasks with the same priority level, the authority of the task owner and the like in the authority configuration file.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a task stopping device.
Fig. 2 is a schematic structural diagram of a task stopping device according to an embodiment of the present invention, which may include: an obtaining module 201, a parsing module 202, a first judging module 203, a sending module 204, a second judging module 205 and a stopping module 206, wherein,
an obtaining module 201, configured to obtain a cluster task directory;
in practical applications, the obtaining module 201 shown in the embodiment of the present invention may be specifically configured to:
and acquiring a cluster task directory every preset time or every time a preset time point is reached.
An analyzing module 202, configured to analyze the cluster task directory obtained by the obtaining module 201 to obtain information of each cluster task, where the information at least includes: the task starting time and the task owner;
the first judging module 203 is configured to, for each cluster task, judge whether the cluster task is overtime according to a first preset task execution time corresponding to the cluster task and start time of the cluster task, which are recorded in the permission configuration file;
in practical application, the first preset task execution time may be an alarm time corresponding to a cluster task; and the alarm time corresponding to the authority owned by the owner corresponding to the cluster task can be also taken.
A sending module 204, configured to send alarm information to the owner of the trunking task when the first determining module 203 determines that the result is yes;
a second determining module 205, configured to determine whether the permission of the owner of the cluster task meets a preset condition when the running time of the cluster task reaches a second preset task execution time, where the second preset task execution time is greater than the first preset task execution time;
in practical applications, the second determining module 205 shown in the embodiment of the present invention may be specifically configured to:
and when the running time of the cluster task reaches the second preset task executing time, judging whether the authority of the belonger of the cluster task is low, if so, indicating that the authority of the belonger of the cluster task meets the preset condition.
In practical applications, the second determining module 205 shown in the embodiment of the present invention may be specifically configured to:
when the running time of the cluster task reaches the second preset task executing time, whether the authority of the owner of the cluster task is lower than the preset authority is judged, and if yes, the authority of the owner of the cluster task meets the preset condition is shown.
A stopping module 206, configured to stop the cluster task to release the cluster resource if the determination result of the second determining module 205 is yes.
By applying the embodiment shown in fig. 2 of the present invention, the task with longer running time (the task with low efficiency) is stopped, and then the cluster resource is released, so that the task with high priority can obtain the cluster resource in time. And the tasks can be transparently managed by configuring the execution time of each task or the execution time of the tasks with the same priority level, the authority of the task owner and the like in the authority configuration file.
Corresponding to the method embodiment and the device embodiment, the embodiment of the invention also provides electronic equipment.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device includes: the device comprises a shell 301, a processor 302, a memory 303, a circuit board 304 and a power circuit 305, wherein the circuit board 304 is arranged inside a space enclosed by the shell 301, and the processor 302 and the memory 303 are arranged on the circuit board 304; a power supply circuit 305 for supplying power to each circuit or device of the electronic apparatus; memory 303 is used to store executable program code; the processor 302 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 303 for performing the steps of:
acquiring a cluster task directory;
analyzing the obtained cluster task directory to obtain the information of each cluster task, wherein the information at least comprises the following components: the task starting time and the task owner;
for each cluster task, judging whether the cluster task is overtime or not according to the first preset task execution time corresponding to the task and the starting time of the task, which are recorded by the permission configuration file;
if the time is out, alarm information is sent to the belonged person of the cluster task;
when the running time of the cluster task reaches a second preset task execution time, judging whether the authority of the owner of the cluster task meets a preset condition, wherein the second preset task execution time is larger than the first preset task execution time;
if so, the cluster task is stopped to release the cluster resources.
The electronic device exists in a variety of forms, including but not limited to:
(1) ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such electronic devices include: PDA, MID, and UMPC devices, etc., such as ipads.
(2) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(3) Other mobile electronic devices with data interaction functions.
By applying the embodiment shown in fig. 3 of the present invention, the task with longer running time (the task with low efficiency) is stopped, and then the cluster resource is released, so that the task with high priority can obtain the cluster resource in time. And the tasks can be transparently managed by configuring the execution time of each task or the execution time of the tasks with the same priority level, the authority of the task owner and the like in the authority configuration file.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Those skilled in the art will appreciate that all or part of the steps in the above method embodiments may be implemented by a program to instruct relevant hardware to perform the steps, and the program may be stored in a computer-readable storage medium, which is referred to herein as a storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (11)

1. A task stopping method is applied to an electronic device and comprises the following steps:
acquiring a cluster task directory;
analyzing the obtained cluster task directory to obtain the information of each cluster task, wherein the information at least comprises the following components: the task starting time and the task owner;
for each cluster task, judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by a permission configuration file;
if the time is out, alarm information is sent to the belonged person of the cluster task;
when the running time of the cluster task reaches a second preset task execution time, judging whether the authority of the owner of the cluster task meets a preset condition, wherein the second preset task execution time is larger than the first preset task execution time;
if so, the cluster task is stopped to release the cluster resources.
2. The method of claim 1, wherein obtaining the cluster task directory comprises:
and acquiring a cluster task directory every preset time or every time a preset time point is reached.
3. The method of claim 1, wherein the first predetermined task execution time comprises:
alarm time corresponding to the cluster task; or
And alarm time corresponding to the authority owned by the owner corresponding to the cluster task.
4. The method according to claim 1, wherein the determining whether the authority of the owner of the cluster task satisfies a preset condition comprises:
and judging whether the authority of the belonger of the cluster task is low, if so, indicating that the authority of the belonger of the cluster task meets a preset condition.
5. The method according to claim 1, wherein the determining whether the authority of the owner of the cluster task satisfies a preset condition comprises:
and judging whether the authority of the belonger of the cluster task is lower than a preset authority, if so, indicating that the authority of the belonger of the cluster task meets a preset condition.
6. A task stop device applied to an electronic device includes: an obtaining module, an analyzing module, a first judging module, a sending module, a second judging module and a stopping module, wherein,
the obtaining module is used for obtaining a cluster task directory;
the analysis module is configured to analyze the cluster task directory obtained by the obtaining module to obtain information of each cluster task, where the information at least includes: the task starting time and the task owner;
the first judging module is used for judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by the permission configuration file, aiming at each cluster task;
the sending module is used for sending alarm information to the belonger of the cluster task under the condition that the judgment result of the first judging module is yes;
the second judging module is used for judging whether the authority of the owner of the cluster task meets a preset condition or not when the running time of the cluster task reaches a second preset task execution time, wherein the second preset task execution time is larger than the first preset task execution time;
and the stopping module is used for stopping the cluster task to release the cluster resources under the condition that the judgment result of the second judging module is yes.
7. The apparatus according to claim 6, wherein the obtaining module is specifically configured to:
and acquiring a cluster task directory every preset time or every time a preset time point is reached.
8. The apparatus of claim 6, wherein the first predetermined task execution time comprises:
alarm time corresponding to the cluster task; or
And alarm time corresponding to the authority owned by the owner corresponding to the cluster task.
9. The apparatus of claim 6, wherein the second determining module is specifically configured to:
and when the running time of the cluster task reaches the second preset task executing time, judging whether the authority of the belonger of the cluster task is low, if so, indicating that the authority of the belonger of the cluster task meets the preset condition.
10. The apparatus of claim 6, wherein the second determining module is specifically configured to:
when the running time of the cluster task reaches the second preset task executing time, whether the authority of the owner of the cluster task is lower than the preset authority is judged, and if yes, the authority of the owner of the cluster task meets the preset condition is shown.
11. An electronic device, characterized in that the electronic device comprises: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the steps of:
acquiring a cluster task directory;
analyzing the obtained cluster task directory to obtain the information of each cluster task, wherein the information at least comprises the following components: the task starting time and the task owner;
for each cluster task, judging whether the cluster task is overtime or not according to a first preset task execution time corresponding to the cluster task and the starting time of the cluster task, which are recorded by a permission configuration file;
if the time is out, alarm information is sent to the belonged person of the cluster task;
when the running time of the cluster task reaches a second preset task execution time, judging whether the authority of the owner of the cluster task meets a preset condition, wherein the second preset task execution time is larger than the first preset task execution time;
if so, the cluster task is stopped to release the cluster resources.
CN201510902549.4A 2015-12-09 2015-12-09 Task stopping method and device and electronic equipment Active CN106855824B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510902549.4A CN106855824B (en) 2015-12-09 2015-12-09 Task stopping method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510902549.4A CN106855824B (en) 2015-12-09 2015-12-09 Task stopping method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN106855824A CN106855824A (en) 2017-06-16
CN106855824B true CN106855824B (en) 2020-02-28

Family

ID=59131924

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510902549.4A Active CN106855824B (en) 2015-12-09 2015-12-09 Task stopping method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN106855824B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111880915B (en) * 2020-07-24 2023-07-21 北京浪潮数据技术有限公司 Processing method, device, equipment and storage medium for thread task
CN112612616B (en) * 2020-12-28 2024-02-23 中国农业银行股份有限公司 Task processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880503A (en) * 2012-08-24 2013-01-16 新浪网技术(中国)有限公司 Data analysis system and data analysis method
JP2013088937A (en) * 2011-10-14 2013-05-13 Toyota Motor Corp Information processing device
CN103780655A (en) * 2012-10-24 2014-05-07 阿里巴巴集团控股有限公司 Message transmission interface task and resource scheduling system and method
CN104239154A (en) * 2014-10-09 2014-12-24 浪潮(北京)电子信息产业有限公司 Job scheduling method in Hadoop cluster and job scheduler
CN104317650A (en) * 2014-10-10 2015-01-28 北京工业大学 Map/Reduce type mass data processing platform-orientated job scheduling method
CN104750549A (en) * 2015-04-13 2015-07-01 飞狐信息技术(天津)有限公司 Computational task processing device, method and system
CN105022668A (en) * 2015-04-29 2015-11-04 腾讯科技(深圳)有限公司 Job scheduling method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013088937A (en) * 2011-10-14 2013-05-13 Toyota Motor Corp Information processing device
CN102880503A (en) * 2012-08-24 2013-01-16 新浪网技术(中国)有限公司 Data analysis system and data analysis method
CN103780655A (en) * 2012-10-24 2014-05-07 阿里巴巴集团控股有限公司 Message transmission interface task and resource scheduling system and method
CN104239154A (en) * 2014-10-09 2014-12-24 浪潮(北京)电子信息产业有限公司 Job scheduling method in Hadoop cluster and job scheduler
CN104317650A (en) * 2014-10-10 2015-01-28 北京工业大学 Map/Reduce type mass data processing platform-orientated job scheduling method
CN104750549A (en) * 2015-04-13 2015-07-01 飞狐信息技术(天津)有限公司 Computational task processing device, method and system
CN105022668A (en) * 2015-04-29 2015-11-04 腾讯科技(深圳)有限公司 Job scheduling method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Hadoop作业优先级控制;caiandyong;《https://blog.csdn.net/caiandyong/article/details/44340307》;20150317;第1-2页 *
Hadoop管理;admin;《https://www.askmaclean.com/archives/hadoop-administration.html》;20151017;第1-17页 *
MOMC: Multi-Objective and Multi-Constrained Scheduling Algorithm of Many Tasks in Hadoop;Cristiana Voicu等;《2014 Ninth International Conference on P2P, Parallel, Grid, Cloud and Internet Computing》;20141110;第89-96页 *

Also Published As

Publication number Publication date
CN106855824A (en) 2017-06-16

Similar Documents

Publication Publication Date Title
CN108845910B (en) Monitoring method, device and storage medium of large-scale micro-service system
CN107844634B (en) Modeling method of multivariate general model platform, electronic equipment and computer readable storage medium
US10523580B2 (en) Automatic cloud provisioning based on related internet news and social network trends
CN105446776A (en) Application program closing method and device and electronic equipment
CN110674440A (en) Buried point data processing method, system, computer device and readable storage medium
CN107577527B (en) Task generation and scheduling method and device
US20180157557A1 (en) Determining reboot time after system update
CN110677453A (en) ZooKeeper-based distributed lock service implementation method, device, equipment and storage medium
WO2016183918A1 (en) Method and device for processing storage space
US9832281B2 (en) Method, device and system for carrying out telecommunication capability group sending
CN104572448A (en) Method and device for realizing use condition of thread stack
CN112306802A (en) Data acquisition method, device, medium and electronic equipment of system
CN109298937A (en) Document analysis method and the network equipment
CN104462940A (en) Monitoring method and device for computer USB interface
CN106855824B (en) Task stopping method and device and electronic equipment
CN109800085B (en) Resource configuration detection method and device, storage medium and electronic equipment
CN106970696B (en) Electronic equipment management method and electronic equipment
CN105426544B (en) Method and device for monitoring database state
CN109284193B (en) Distributed data processing method based on multithreading and server
CN106507300A (en) A kind of method for giving loss terminal for change, device and terminal
CN107633080B (en) User task processing method and device
CN106156210B (en) Method and device for determining application identifier matching list
CN111376255B (en) Robot data acquisition method and device and terminal equipment
CN109040491B (en) Hanging-up behavior processing method and device, computer equipment and storage medium
CN109150792B (en) Method and device for improving data storage security

Legal Events

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