CN116431318A - Timing task processing method and device, electronic equipment and storage medium - Google Patents

Timing task processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116431318A
CN116431318A CN202310693493.0A CN202310693493A CN116431318A CN 116431318 A CN116431318 A CN 116431318A CN 202310693493 A CN202310693493 A CN 202310693493A CN 116431318 A CN116431318 A CN 116431318A
Authority
CN
China
Prior art keywords
task
timing task
execution
timing
information
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
CN202310693493.0A
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.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin 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 Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202310693493.0A priority Critical patent/CN116431318A/en
Publication of CN116431318A publication Critical patent/CN116431318A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention provides a timing task processing method, a timing task processing device, electronic equipment and a storage medium, and relates to the technical field of data processing, wherein the method comprises the following steps: acquiring configuration information of each timing task in a plurality of timing tasks, wherein the configuration information comprises execution times, starting time, ending time and an execution interval threshold; adding a plurality of timed tasks to the task queue based on a start time of each timed task; when the number of times of execution of the first timing task is multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold of the first timing task in the two adjacent executions of the first timing task, the first timing task is deleted from the task queue, and the first timing task is one timing task of the plurality of timing tasks. The invention can reduce the load of the server equipment.

Description

Timing task processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for processing a timing task, an electronic device, and a storage medium.
Background
For tasks that need to be periodically executed, the tasks are generally repeatedly executed according to a set time by setting a timing task. In the related art, tasks to be executed are added in a timing task queue, and the time for the tasks to be executed is configured, but in the process of executing the timing tasks, the execution interval of part of the timing tasks is shorter, the part of the timing tasks need to be manually checked and processed after being added to the timing task queue, and the load of a server device for executing the part of the timing tasks is higher when the part of the timing tasks are not processed.
As can be seen, there is a problem in the related art that the server device is highly loaded when executing a timed task.
Disclosure of Invention
The embodiment of the invention provides a timing task processing method, a timing task processing device, electronic equipment and a readable storage medium, which are used for solving the problem that in the prior art, the load of server equipment is higher when timing tasks are executed.
To solve the above problems, the present invention is achieved as follows:
in a first aspect, an embodiment of the present invention provides a method for processing a timing task, including:
acquiring configuration information of each timing task in a plurality of timing tasks, wherein the configuration information comprises execution times, starting time, ending time and an execution interval threshold;
adding the plurality of timed tasks to a task queue based on the start time of each timed task;
and deleting the first timing task from the task queue when the execution times of the first timing task are multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold of the first timing task in the two adjacent executions of the first timing task, wherein the first timing task is one timing task in the plurality of timing tasks.
In a second aspect, an embodiment of the present invention further provides a timed task processing device, including:
the first acquisition module is used for acquiring configuration information of each timing task in the plurality of timing tasks, wherein the configuration information comprises execution times, starting time, ending time and an execution interval threshold;
a first processing module configured to add the plurality of timed tasks to a task queue based on a start time of each timed task;
and the second processing module is used for deleting the first timing task from the task queue when the execution times of the first timing task are multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold value of the first timing task in the two adjacent executions of the first timing task, wherein the first timing task is one timing task of the plurality of timing tasks.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program when executed by the processor implements the steps in the timed task processing method according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a readable storage medium storing a program, where the program when executed by a processor implements the steps in the timed task processing method described in the first aspect above.
In the embodiment of the invention, the configuration information of each timing task in the plurality of timing tasks is obtained, the configuration information comprises the execution times, the starting time, the ending time and the execution interval threshold value, the plurality of timing tasks are added to the task queue based on the starting time of each timing task, and when the execution times of the first timing task are multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold value of the first timing task in the adjacent two executions of the first timing task, the first timing task is deleted from the task queue, and the server equipment does not execute the first timing task any more, so that the load of the server equipment is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort to a person of ordinary skill in the art.
FIG. 1 is a flow chart of a method for processing a timing task according to an embodiment of the present invention;
FIG. 2 is a flowchart for acquiring execution information of a timing task according to an embodiment of the present invention;
FIG. 3 is a block diagram of a timing task processing device according to an embodiment of the present invention;
fig. 4 is a block diagram of an electronic 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 fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. 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.
Referring to fig. 1, fig. 1 is a flowchart of a timing task processing method according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
step 101, obtaining configuration information of each timing task in a plurality of timing tasks, wherein the configuration information comprises execution times, starting time, ending time and an execution interval threshold.
The configuration information is information written when each timing task is registered, and includes, for example, information such as a name of the timing task, an execution switch, an execution task grammar, function execution logic, the task queue, etc., where the execution times, the start time, the end time, and the execution interval threshold may be written in the execution task grammar. After the timing tasks are registered, the server device loading the timing tasks analyzes the grammar of the execution tasks, and then the execution times, the starting time, the ending time and the execution interval threshold of each timing task can be determined.
The execution times can be set to be single or multiple times, and in the case of setting to be single, the execution interval threshold value can not be written in the configuration information; in the case of setting to a plurality of times, a start time and an end time are set for each execution so that the server device loading the timed task executes the timed task at the start time corresponding to the timed task.
Step 102, adding the plurality of timed tasks to a task queue based on the starting time of each timed task.
After adding the timing task, the task queues are sequentially executed according to the starting time of the timing task in the task queues. The timing task loading method comprises the steps that a plurality of task queues exist in a timing task loading server device, different timing tasks are added to each task queue, and the timing tasks in the plurality of task queues can be executed simultaneously by the timing task loading server device.
It should be understood that, in the case where the timed task is set to be multiple times, multiple times may be added to the task queue according to the start time of each execution of the timed task, where each executed timed task in the task queue corresponds to one start time and one end time, so that the server device loading the timed task executes the timed task at the start time corresponding to the timed task.
Step 103, deleting the first timing task from the task queue when the number of times of execution of the first timing task is multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold of the first timing task in the two adjacent executions of the first timing task, wherein the first timing task is one timing task of the plurality of timing tasks.
The execution time interval is an interval set according to the actual requirement of the timing task. It should be understood that the first timing task is a timing task that is performed multiple times, and that the first timing task need not be performed frequently in a real scenario. When the time interval between two executions of the first timing task is short, the load of the server device executing the first timing task is large, and in this case, the first timing task in the task queue cannot be automatically deleted, and the load of the server device can be reduced only by manually deleting the first timing task. In the method, the execution interval threshold is added in the configuration information, so that the timing tasks which do not meet the execution interval threshold are deleted, and the load of the server equipment is reduced.
The start time and the end time are set times, wherein the start time is the same as the actual execution start time, the end time is different from the actual execution end time, and the set time is used for determining the time interval when the time interval between the two execution of the first timing task needs to be determined.
For example, the execution interval threshold is set to 10 minutes, the ending time of the previous execution of the first timing task is 14:00, the starting time of the next execution of the first timing task is 14:05, the time interval of the first timing task in the two executions is 5 minutes, and the execution interval threshold is smaller than the execution interval threshold, at this time, the first timing task is deleted, and the load of the server device is reduced.
When the first timing task is executed a plurality of times, there is a case where the time interval between two adjacent executions is smaller than the execution interval threshold, and even if the time interval between two other adjacent executions is larger than the execution interval threshold, the first timing task needs to be deleted from the task queue. For example, the execution interval threshold is set to 10 minutes, the end time of the first execution of the first timing task is 14:00, the start time of the second execution of the first timing task is 14:05, the end time of the second execution of the first timing task is 14:10, the start time of the third execution of the first timing task is 15:00, that is, the time interval between the first execution and the second execution of the first timing task is 5 minutes, which is smaller than the execution interval threshold; the time interval between the second execution and the third execution is 50 minutes, which is greater than the execution interval threshold, in which case the first timing task still needs to be deleted.
In the embodiment of the invention, the configuration information of each timing task in the plurality of timing tasks is obtained, the configuration information comprises the execution times, the starting time, the ending time and the execution interval threshold value, the plurality of timing tasks are added to the task queue based on the starting time of each timing task, and when the execution times of the first timing task are multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold value of the first timing task in the adjacent two executions of the first timing task, the first timing task is deleted from the task queue, and the server equipment does not execute the first timing task any more, so that the load of the server equipment is reduced.
In one embodiment, the configuration information further includes preset execution requirement information, where the preset execution requirement information includes a setting condition of an execution condition in a process of executing the timing task;
the method further comprises the steps of:
executing a second timing task, wherein the second timing task is one timing task in the task queue after deleting the first timing task;
after a second timing task is executed, acquiring execution information of the second timing task, wherein the execution information is used for representing the execution condition in the process of executing the second timing task;
and deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task.
It should be appreciated that multiple task queues are configured in the server device, and that timed tasks in each task queue may be performed simultaneously. Under the condition of executing the timing tasks in each task queue, the requirement on hardware resources of the server equipment is large, each timing task needs to be limited, and the situation that the server equipment cannot process the timing tasks simultaneously is avoided.
The preset execution requirement information is a set condition in the execution process corresponding to each timing task, and the preset execution requirement information configures a limiting parameter in the execution process of the timing task, for example, the execution time of the timing task, or the maximum hardware resource value occupied in the execution process of the timing task, and the like. The preset execution requirement information can determine whether the situation that the server equipment cannot process the second timing task occurs in the actual execution process.
The execution information is information corresponding to preset execution requirement information in the execution process of each timing task, specifically, an actual parameter corresponding to a limiting parameter configured by the preset execution requirement information, for example, when the limiting parameter is an execution duration, the execution information is an actual duration of executing the timing task. And acquiring the execution information, determining whether the execution information is matched with the preset execution requirement information, and deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task, so that the situation that the second timing task cannot be processed due to insufficient server resources is avoided.
In the embodiment of the invention, the preset execution requirement information is added in the configuration information, the execution information is acquired after the second timing task is executed, whether the execution information is matched with the preset execution requirement information is determined, and the second timing task is deleted from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task, so that the condition that the second timing task cannot be processed due to insufficient server resources is avoided.
In one embodiment, the preset execution requirement information includes a duration threshold;
the obtaining the execution information of the second timing task includes:
acquiring the execution time length of the second timing task, wherein the execution time length is the time length of the last time the second timing task is executed;
and deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task, including:
and deleting the second timing task from the task queue under the condition that the execution duration of the second timing task is greater than the duration threshold of the second timing task.
The time length threshold is the maximum execution time length for executing the second timing task. It should be understood that, in the process of actually executing the second timing task, the actual end time of executing the second timing task is different from the end time set in the configuration information due to the influence of the hardware resources of the server device (the hardware resources are allocated partial resources instead of all the hardware resources), and if the time execution duration is long, the hardware resources of the server device are continuously occupied, and the actual execution duration needs to be limited.
After the execution of each timing task is finished, the execution information in the execution process is recorded into a result snapshot and stored, and under the condition that whether the execution time length is greater than a time length threshold value or not is required to be determined, the execution time length is acquired from the stored result snapshot.
It should be appreciated that in the event that the execution duration is less than the duration threshold, the second timed task need not be deleted from the task queue. In the case where the second timed task is executed a plurality of times, there is a time of execution longer than the time length threshold among the plurality of times, the second timed task still needs to be deleted.
For example, the second timed task is performed twice, with the time period of the two times being 5 minutes and 7 minutes, respectively, and the time period threshold being 6 minutes, and the time period of the second timed task being 7 minutes longer than the time period threshold, in which case the second timed task still needs to be deleted.
In the embodiment of the invention, the second timing task is deleted from the task queue under the condition that the execution time length of the second timing task is larger than the time length threshold value of the second timing task, so that the condition that the second timing task occupies hardware resources for a long time is avoided, and the load of the server equipment is further reduced.
In one embodiment, the preset execution requirement information includes a hardware resource occupancy threshold;
the obtaining the execution information of the second timing task includes:
acquiring a target occupation value of the second timing task, wherein the target occupation value is the maximum value of hardware resources occupied by the second timing task in the process of executing the second timing task;
and deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task, including:
and deleting the second timing task from the task queue under the condition that the target occupation value of the second timing task is larger than the hardware resource occupation threshold value of the second timing task.
The hardware resource occupation threshold is the maximum hardware resource occupation value for executing the second timing task. It should be understood that the hardware resources of the server device are occupied during the actual execution of the second timing task, and the hardware resources occupied during the execution of the second timing task are a variable value, and if the maximum value of the occupied hardware resources is large, the server device cannot meet the requirement of the hardware resources, which may cause abnormal execution of the task, and in this case, the hardware resources that can be occupied by the second timing task need to be limited.
After the execution of each timing task is finished, the execution information in the execution process is recorded into a result snapshot and stored, and the target occupation value is acquired from the stored result snapshot under the condition that whether the target occupation value is larger than a hardware resource occupation threshold value or not is required to be determined.
The hardware resource corresponding to the target occupation value may be an occupation resource of one hardware, or may be an average value or a maximum value of occupation resources of a plurality of hardware. For example, the target occupation value may be a resource value of the CPU occupied by the second timing task, or may be an average value or a maximum value of resource values of the occupied CPU or GPU. Under the condition of a plurality of hardware resources, the average value occupying different hardware resources does not exceed the hardware resource occupying threshold value, and the threshold value condition is considered to be met; the hardware resource occupation threshold may also include a threshold corresponding to each hardware resource, where in executing the second timing task, the hardware resource occupation threshold is considered to be satisfied when each hardware resource occupation value corresponding to the second timing task satisfies the threshold.
The threshold value occupied by the hardware resources is 10% occupied by the CPU, 5% occupied by the GPU, and the target occupied value of the CPU is 8% and the target occupied value of the GPU is 6% in the process of executing the second timing task under the condition that the threshold value of each hardware resource is satisfied, so that the threshold value occupied by the hardware resources is not satisfied, and the second timing task needs to be deleted.
It should be appreciated that in the event that the target occupancy value is less than the hardware resource occupancy threshold, the second timed task need not be deleted from the task queue. In the case where the second timing task is executed a plurality of times, and there is a target occupation value of one execution among the plurality of times that is greater than the hardware resource occupation threshold value, the second timing task still needs to be deleted.
Further, the preset execution requirement information may include a time length threshold and a hardware resource occupation threshold, as shown in fig. 2, when the execution time length of the second timing task is greater than the time length threshold, or the target occupation value of the second timing task is greater than the hardware resource occupation threshold, the second timing task is deleted, so that the timing task is adjusted from the two aspects of the execution time length and the hardware resource occupation in the execution process, and the load of the server device is further reduced.
In the embodiment of the invention, the second timing task is deleted from the task queue under the condition that the target occupation value of the second timing task is larger than the hardware resource occupation threshold value, so that the second timing task is prevented from occupying the hardware resource for a long time, and the load of the server equipment is further reduced.
In one embodiment, after said deleting said first timed task from said task queue, said method further comprises:
and sending first alarm information, wherein the first alarm information is used for indicating that the execution time of the first timing task is not matched with the execution interval threshold.
It should be appreciated that after the first timed task is deleted from the task queue, the first timed task is no longer present in the task queue, requiring maintenance personnel to determine whether the first timed task needs to be registered again. In the case where the first timing task needs to be registered again, it is necessary to newly set the start time of execution of the first timing task so that the first timing task satisfies the condition of the execution interval threshold at the time interval of the adjacent two executions.
In one embodiment, after said deleting said second timed task from said task queue, said method further comprises:
and sending second alarm information, wherein the second alarm information is used for indicating that the execution information of the second timing task is not matched with the preset requirement information.
It should be appreciated that after the second timed task is deleted from the task queue, the second timed task is no longer present in the task queue, requiring maintenance personnel to determine whether the second timed task needs to be registered again. If the second timing task needs to be registered again, certain adjustment needs to be performed on the operation logic of the second timing task, so that the execution duration of the server in the process of operating the second timing task is shorter, or occupied hardware resources are fewer, so that a duration threshold or a hardware resource occupation threshold is met.
The second alarm information can be added with an indication mark for indicating the reason of deleting the second timing task, so that maintenance personnel can adjust the execution time of the second timing task or occupy hardware resources according to the indication mark.
In one embodiment, the method further comprises:
executing a current timing task to obtain result data, wherein the current timing task is one timing task in the task queue after deleting the first timing task;
caching the result data;
and under the condition of executing a third timing task, reading the result data from the cache, wherein the third timing task is the associated task of the current timing task.
It should be appreciated that the timed tasks may be independent tasks or may be associated tasks. Under the condition that the current timing task is an independent task, the expected set requirement is completed after the current timing task is executed; under the condition that the current timing task is the related task, the result data of completion of execution of other tasks needs to be acquired before the current timing task is executed, and then the result data is used as input to execute the current timing task. In the related technology, related tasks need to be executed successively, and when the related tasks are added to a task queue, the related tasks need to be added in sequence, so that the related tasks are not flexible enough when being registered.
In the embodiment of the invention, the result data is cached, and the result data is read from the cache under the condition of executing the related task, so that the execution speed can be improved, and the load of the server equipment is further reduced without executing the pre-set timing task.
Referring to fig. 3, fig. 3 is a block diagram of a timed task processing device according to an embodiment of the present invention, and as shown in fig. 3, a timed task processing device 300 includes:
a first obtaining module 301, configured to obtain configuration information of each of a plurality of timing tasks, where the configuration information includes a number of executions, a start time, an end time, and an execution interval threshold;
a first processing module 302, configured to add the plurality of timed tasks to a task queue based on a start time of each timed task;
and the second processing module 303 is configured to delete the first timing task from the task queue when the number of times of execution of the first timing task is multiple, and in the two adjacent times of execution of the first timing task, an interval between an end time of the previous execution and a start time of the next execution is smaller than an execution interval threshold of the first timing task, where the first timing task is one timing task of the plurality of timing tasks.
Optionally, the configuration information further includes preset execution requirement information, where the preset execution requirement information includes a setting condition of an execution condition in a process of executing the timing task;
the timed task processing device 300 further includes:
the third processing module is used for executing a second timing task, wherein the second timing task is one timing task in the task queue after deleting the first timing task;
the second acquisition module is used for acquiring the execution information of the second timing task after the second timing task is executed, wherein the execution information is used for representing the execution condition in the process of executing the second timing task;
and the fourth processing module is used for deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task.
Optionally, the preset execution requirement information includes a duration threshold;
the second acquisition module includes:
the first acquisition unit is used for acquiring the execution time length of the second timing task, wherein the execution time length is the time length of the last time the second timing task is executed;
the fourth processing module includes:
and the first processing unit is used for deleting the second timing task from the task queue under the condition that the execution duration of the second timing task is greater than the duration threshold value of the second timing task.
Optionally, the preset execution requirement information includes a hardware resource occupation threshold;
the second acquisition module includes:
the second acquisition unit is used for acquiring a target occupation value of the second timing task, wherein the target occupation value is the maximum value of hardware resources occupied by the second timing task in the process of executing the second timing task;
the fourth processing module includes:
and the second processing unit is used for deleting the second timing task from the task queue under the condition that the target occupation value of the second timing task is larger than the hardware resource occupation threshold value of the second timing task.
Optionally, after the second processing module, the timed task processing device 300 further includes:
the first sending module is used for sending first alarm information, and the first alarm information is used for indicating that the execution time of the first timing task is not matched with the execution interval threshold value.
Optionally, after the fourth processing module, the timed task processing device 300 further includes:
the second sending module is used for sending second alarm information, and the second alarm information is used for indicating that the execution information of the second timing task is not matched with the preset requirement information.
Optionally, the timed task processing device 300 further includes:
the fifth processing module is used for executing a current timing task to obtain result data, wherein the current timing task is one timing task in the task queue after deleting the first timing task;
a sixth processing module, configured to cache the result data;
and the seventh processing module is used for reading the result data from the cache under the condition of executing a third timing task, wherein the third timing task is an associated task of the current timing task.
The 3 device provided in the embodiment of the present invention is capable of implementing each process of each embodiment of the 3 method, technical features are in one-to-one correspondence, and the same technical effects can be achieved, so that repetition is avoided, and no redundant description is provided herein.
It should be noted that, the 3 devices in the embodiments of the present invention may be devices, or may be components, integrated circuits, or chips in electronic devices.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device includes a memory 401, a processor 402, and a program or an instruction stored in the memory 401, and the program or the instruction may implement any step in the method embodiment corresponding to fig. 1 and achieve the same beneficial effect when executed by the processor 402, which is not described herein again.
Wherein the processor 402 may be CPU, ASIC, FPGA or a GPU.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of implementing the methods of the embodiments described above may be implemented by hardware associated with program instructions, where the program may be stored on a readable medium.
The embodiment of the present invention further provides a readable storage medium, where a computer program is stored, where the computer program when executed by a processor can implement any step in the method embodiment corresponding to fig. 1, and achieve the same technical effects, and in order to avoid repetition, no further description is given here. Such as Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic or optical disk, etc.
The terms "first," "second," and the like in embodiments of the present invention are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Furthermore, the use of "and/or" in this application means at least one of the connected objects, such as a and/or B and/or C, is meant to encompass the 7 cases of a alone, B alone, C alone, and both a and B, both B and C, both a and C, and both A, B and C.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described example method may be implemented by means of software plus a necessary general hardware platform, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a second terminal device, etc.) to perform the method of the embodiments of the present application.
The embodiments of the present application have been described in connection with the accompanying drawings, but the present application is not limited to the above-described embodiments, which are intended to be illustrative only and not limiting, and many forms can be made by one of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (10)

1. A method for timing task processing, comprising:
acquiring configuration information of each timing task in a plurality of timing tasks, wherein the configuration information comprises execution times, starting time, ending time and an execution interval threshold;
adding the plurality of timed tasks to a task queue based on the start time of each timed task;
and deleting the first timing task from the task queue when the execution times of the first timing task are multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold of the first timing task in the two adjacent executions of the first timing task, wherein the first timing task is one timing task in the plurality of timing tasks.
2. The method according to claim 1, wherein the configuration information further includes preset execution requirement information including a setting condition of an execution condition during execution of the timed task;
the method further comprises the steps of:
executing a second timing task, wherein the second timing task is one timing task in the task queue after deleting the first timing task;
after a second timing task is executed, acquiring execution information of the second timing task, wherein the execution information is used for representing the execution condition in the process of executing the second timing task;
and deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task.
3. The method of claim 2, wherein the preset execution requirement information includes a duration threshold;
the obtaining the execution information of the second timing task includes:
acquiring the execution time length of the second timing task, wherein the execution time length is the time length of the last time the second timing task is executed;
and deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task, including:
and deleting the second timing task from the task queue under the condition that the execution duration of the second timing task is greater than the duration threshold of the second timing task.
4. The method of claim 2, wherein the preset execution requirement information includes a hardware resource occupancy threshold;
the obtaining the execution information of the second timing task includes:
acquiring a target occupation value of the second timing task, wherein the target occupation value is the maximum value of hardware resources occupied by the second timing task in the process of executing the second timing task;
and deleting the second timing task from the task queue under the condition that the execution information of the second timing task is not matched with the preset execution requirement information of the second timing task, including:
and deleting the second timing task from the task queue under the condition that the target occupation value of the second timing task is larger than the hardware resource occupation threshold value of the second timing task.
5. The method of claim 1, wherein after said deleting said first timed task from said task queue, said method further comprises:
and sending first alarm information, wherein the first alarm information is used for indicating that the execution time of the first timing task is not matched with the execution interval threshold.
6. The method of claim 2, wherein after said deleting said second timed task from said task queue, said method further comprises:
and sending second alarm information, wherein the second alarm information is used for indicating that the execution information of the second timing task is not matched with the preset requirement information.
7. The method according to claim 1, wherein the method further comprises:
executing a current timing task to obtain result data, wherein the current timing task is one timing task in the task queue after deleting the first timing task;
caching the result data;
and under the condition of executing a third timing task, reading the result data from the cache, wherein the third timing task is the associated task of the current timing task.
8. A timed task processing device, comprising:
the first acquisition module is used for acquiring configuration information of each timing task in the plurality of timing tasks, wherein the configuration information comprises execution times, starting time, ending time and an execution interval threshold;
a first processing module configured to add the plurality of timed tasks to a task queue based on a start time of each timed task;
and the second processing module is used for deleting the first timing task from the task queue when the execution times of the first timing task are multiple and the interval between the ending time of the previous execution and the starting time of the next execution is smaller than the execution interval threshold value of the first timing task in the two adjacent executions of the first timing task, wherein the first timing task is one timing task of the plurality of timing tasks.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor performs the steps in the timed task processing method according to any one of claims 1 to 7.
10. A readable storage medium storing a program, wherein the program when executed by a processor implements the steps of the timed task processing method according to any one of claims 1 to 7.
CN202310693493.0A 2023-06-13 2023-06-13 Timing task processing method and device, electronic equipment and storage medium Pending CN116431318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310693493.0A CN116431318A (en) 2023-06-13 2023-06-13 Timing task processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310693493.0A CN116431318A (en) 2023-06-13 2023-06-13 Timing task processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116431318A true CN116431318A (en) 2023-07-14

Family

ID=87083630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310693493.0A Pending CN116431318A (en) 2023-06-13 2023-06-13 Timing task processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116431318A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1862575A (en) * 2005-08-19 2006-11-15 华为技术有限公司 Method for planing dispatching timing task
CN103645909A (en) * 2013-12-30 2014-03-19 中国烟草总公司湖南省公司 Handling method and device for timed task
CN104268015A (en) * 2014-09-05 2015-01-07 烽火通信科技股份有限公司 Implementation method of high-availability timer of embedded equipment and timer
CN109976883A (en) * 2017-12-27 2019-07-05 深圳市优必选科技有限公司 A kind of processing method and its system of task
CN109992390A (en) * 2019-04-23 2019-07-09 广州裕睿信息科技有限公司 Timed task dispatching method and timed task processing method
CN111782365A (en) * 2020-06-30 2020-10-16 北京百度网讯科技有限公司 Timed task processing method, device, equipment and storage medium
CN112685160A (en) * 2020-12-30 2021-04-20 深圳前海微众银行股份有限公司 Scheduling method and device of timing task, terminal equipment and computer storage medium
CN113127185A (en) * 2019-12-31 2021-07-16 北京懿医云科技有限公司 Task execution queue processing method and device, storage medium and electronic equipment
CN113760522A (en) * 2020-09-25 2021-12-07 北京沃东天骏信息技术有限公司 Task processing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1862575A (en) * 2005-08-19 2006-11-15 华为技术有限公司 Method for planing dispatching timing task
CN103645909A (en) * 2013-12-30 2014-03-19 中国烟草总公司湖南省公司 Handling method and device for timed task
CN104268015A (en) * 2014-09-05 2015-01-07 烽火通信科技股份有限公司 Implementation method of high-availability timer of embedded equipment and timer
CN109976883A (en) * 2017-12-27 2019-07-05 深圳市优必选科技有限公司 A kind of processing method and its system of task
CN109992390A (en) * 2019-04-23 2019-07-09 广州裕睿信息科技有限公司 Timed task dispatching method and timed task processing method
CN113127185A (en) * 2019-12-31 2021-07-16 北京懿医云科技有限公司 Task execution queue processing method and device, storage medium and electronic equipment
CN111782365A (en) * 2020-06-30 2020-10-16 北京百度网讯科技有限公司 Timed task processing method, device, equipment and storage medium
CN113760522A (en) * 2020-09-25 2021-12-07 北京沃东天骏信息技术有限公司 Task processing method and device
CN112685160A (en) * 2020-12-30 2021-04-20 深圳前海微众银行股份有限公司 Scheduling method and device of timing task, terminal equipment and computer storage medium

Similar Documents

Publication Publication Date Title
CN107450971B (en) Task processing method and device
CN105677469B (en) Timed task execution method and device
CN111782360A (en) Distributed task scheduling method and device
CN110532205B (en) Data transmission method, data transmission device, computer equipment and computer readable storage medium
CN112241350B (en) Micro-service evaluation method and device, computing device and micro-service detection system
CN108509322B (en) Method for avoiding excessive return visit, electronic device and computer readable storage medium
US20220035666A1 (en) Method and apparatus for data processing, server and storage medium
CN113282381A (en) Task scheduling method and device, computer equipment and storage medium
CN112214291A (en) Task scheduling method and device
CN116431318A (en) Timing task processing method and device, electronic equipment and storage medium
US11194619B2 (en) Information processing system and non-transitory computer readable medium storing program for multitenant service
CN111241594B (en) Method, device, computer equipment and storage medium for signing transaction information
CN110061933B (en) Data processing method and device, equipment and storage medium
CN110209548B (en) Service control method, system, electronic device and computer readable storage medium
CN116126937A (en) Job scheduling method, job scheduling device, electronic equipment and storage medium
CN114461323B (en) Clamping and processing method and device, electronic equipment and storage medium
CN112286704A (en) Processing method and device of delay task, computer equipment and storage medium
US11934881B2 (en) Service program device allocation and release
CN113613063B (en) Application anomaly reduction method, device and storage medium
CN110929102A (en) Data processing method and device and electronic equipment
CN110187979B (en) Link message processing method and device, storage medium and computer equipment
CN116760697B (en) Network equipment risk monitoring method, computer equipment and computer storage medium
CN113377641B (en) Log statistical method and system
US20220413996A1 (en) Computer-readable recording medium storing acceleration test program, acceleration test method, and acceleration test apparatus
CN109189664B (en) Information acquisition method and terminal for application program

Legal Events

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

Application publication date: 20230714

RJ01 Rejection of invention patent application after publication